Lines Matching +full:0 +full:x20

42 static uint8_t ppp_frame_wrapped[] = {0x7E, 0xFF, 0x7D, 0x23, 0xC0, 0x21, 0x7D, 0x21, 0x7D,
43 0x21, 0x7D, 0x20, 0x7D, 0x24, 0xD1, 0xB5, 0x7E};
45 static uint8_t ppp_frame_unwrapped[] = {0xC0, 0x21, 0x01, 0x01, 0x00, 0x04};
48 0x7E, 0xFF, 0x7D, 0x23, 0x7D, 0x20, 0x21, 0x45, 0x7D, 0x20, 0x7D, 0x20, 0x29, 0x87, 0x6E,
49 0x40, 0x7D, 0x20, 0xE8, 0x7D, 0x31, 0xC1, 0xE9, 0x7D, 0x23, 0xFB, 0x7D, 0x25, 0x20, 0x7D,
50 0x2A, 0x2B, 0x36, 0x26, 0x25, 0x7D, 0x32, 0x8C, 0x3E, 0x7D, 0x20, 0x7D, 0x35, 0xBD, 0xF3,
51 0x2D, 0x7D, 0x20, 0x7D, 0x2B, 0x7D, 0x20, 0x7D, 0x27, 0x7D, 0x20, 0x7D, 0x24, 0x7D, 0x20,
52 0x7D, 0x24, 0x7D, 0x2A, 0x7D, 0x20, 0x7D, 0x2A, 0x7D, 0x20, 0xD4, 0x31, 0x7E};
55 0x45, 0x00, 0x00, 0x29, 0x87, 0x6E, 0x40, 0x00, 0xE8, 0x11, 0xC1, 0xE9, 0x03, 0xFB,
56 0x05, 0x20, 0x0A, 0x2B, 0x36, 0x26, 0x25, 0x12, 0x8C, 0x3E, 0x00, 0x15, 0xBD, 0xF3,
57 0x2D, 0x00, 0x0B, 0x00, 0x07, 0x00, 0x04, 0x00, 0x04, 0x0A, 0x00, 0x0A, 0x00};
60 0x00, 0x21, 0x45, 0x00, 0x00, 0x29, 0x87, 0x6E, 0x40, 0x00, 0xE8, 0x11, 0xC1, 0xE9, 0x03,
61 0xFB, 0x05, 0x20, 0x0A, 0x2B, 0x36, 0x26, 0x25, 0x12, 0x8C, 0x3E, 0x00, 0x15, 0xBD, 0xF3,
62 0x2D, 0x00, 0x0B, 0x00, 0x07, 0x00, 0x04, 0x00, 0x04, 0x0A, 0x00, 0x0A, 0x00};
64 static uint8_t corrupt_start_end_ppp_frame_wrapped[] = {0x2A, 0x46, 0x7E, 0x7E, 0xFF, 0x7D, 0x23,
65 0xC0, 0x21, 0x7D, 0x21, 0x7D, 0x21, 0x7D,
66 0x20, 0x7D, 0x24, 0xD1, 0xB5, 0x7E};
80 static uint8_t test_net_link_addr[] = {0x00, 0x00, 0x5E, 0x00, 0x53, 0x01};
154 return (uint8_t)(prng_state & 0xFF); in test_modem_ppp_prng_random()
161 for (size_t i = 0; i < size; i++) { in test_modem_ppp_fill_net_pkt()
162 if (net_pkt_write_u8(pkt, test_modem_ppp_prng_random(false)) < 0) { in test_modem_ppp_fill_net_pkt()
173 size_t unwrapped_pos = 0; in test_modem_ppp_unwrap()
177 if (wrapped[wrapped_pos] == 0x7D) { in test_modem_ppp_unwrap()
178 unwrapped[unwrapped_pos] = wrapped[wrapped_pos + 1] ^ 0x20; in test_modem_ppp_unwrap()
199 for (size_t i = 0; i < size; i++) { in test_modem_ppp_validate_fill()
215 byte = 0x03; in test_modem_ppp_generate_ppp_frame()
216 fcs = crc16_ccitt(0xFFFF, &byte, 0x01); in test_modem_ppp_generate_ppp_frame()
218 frame[0] = 0x00; in test_modem_ppp_generate_ppp_frame()
219 frame[1] = 0x21; in test_modem_ppp_generate_ppp_frame()
226 fcs = crc16_ccitt(fcs, frame, size) ^ 0xFFFF; in test_modem_ppp_generate_ppp_frame()
236 wrapped[0] = 0x7E; in test_modem_ppp_wrap_ppp_frame()
237 wrapped[1] = 0xFF; in test_modem_ppp_wrap_ppp_frame()
238 wrapped[2] = 0x7D; in test_modem_ppp_wrap_ppp_frame()
239 wrapped[3] = 0x23; in test_modem_ppp_wrap_ppp_frame()
241 for (size_t i = 0; i < size; i++) { in test_modem_ppp_wrap_ppp_frame()
242 if ((frame[i] == 0x7E) || (frame[i] == 0x7D) || (frame[i] < 0x20)) { in test_modem_ppp_wrap_ppp_frame()
243 wrapped[wrapped_pos] = 0x7D; in test_modem_ppp_wrap_ppp_frame()
244 wrapped[wrapped_pos + 1] = frame[i] ^ 0x20; in test_modem_ppp_wrap_ppp_frame()
253 wrapped[wrapped_pos] = 0x7E; in test_modem_ppp_wrap_ppp_frame()
267 zassert_true(modem_ppp_init_internal(&ppp_net_dev) == 0, "Failed to run internal init"); in test_modem_ppp_setup()
279 zassert_true(modem_pipe_open(mock_pipe, K_SECONDS(10)) == 0, "Failed to open mock pipe"); in test_modem_ppp_setup()
287 for (size_t i = 0; i < received_packets_len; i++) { in test_modem_ppp_before()
292 received_packets_len = 0; in test_modem_ppp_before()
315 pkt = received_packets[0]; in ZTEST()
325 zassert_true(memcmp(buffer, ppp_frame_unwrapped, pkt_len) == 0, in ZTEST()
345 pkt = received_packets[0]; in ZTEST()
352 zassert_true(memcmp(buffer, ppp_frame_unwrapped, pkt_len) == 0, in ZTEST()
362 pkt = net_pkt_alloc_with_buffer(&test_iface, 256, AF_UNSPEC, 0, K_NO_WAIT); in ZTEST()
369 zassert_true(ret == 0, "Failed to write data to allocated network packet"); in ZTEST()
373 zassert_true(test_net_send(pkt) == 0, "Failed to send PPP pkt"); in ZTEST()
381 zassert_true(memcmp(buffer, ppp_frame_wrapped, ret) == 0, in ZTEST()
398 pkt = received_packets[0]; in ZTEST()
408 zassert_true(memcmp(buffer, ip_frame_unwrapped_with_protocol, pkt_len) == 0, in ZTEST()
418 pkt = net_pkt_alloc_with_buffer(&test_iface, 256, AF_UNSPEC, 0, K_NO_WAIT); in ZTEST()
424 zassert_true(ret == 0, "Failed to write data to allocated network packet"); in ZTEST()
436 zassert_true(memcmp(buffer, ip_frame_wrapped, ret) == 0, in ZTEST()
446 for (uint8_t i = 0; i < TEST_MODEM_PPP_IP_FRAME_SEND_MULT_N; i++) { in ZTEST()
447 pkts[i] = net_pkt_alloc_with_buffer(&test_iface, 256, AF_UNSPEC, 0, K_NO_WAIT); in ZTEST()
451 zassert_true(ret == 0, "Failed to write data to allocated network packet"); in ZTEST()
456 for (uint8_t i = 0; i < TEST_MODEM_PPP_IP_FRAME_SEND_MULT_N; i++) { in ZTEST()
474 AF_UNSPEC, 0, K_NO_WAIT); in ZTEST()
490 zassert_true(unwrapped_buffer[0] == 0x00, "Incorrect protocol"); in ZTEST()
491 zassert_true(unwrapped_buffer[1] == 0x21, "Incorrect protocol"); in ZTEST()
514 pkt = received_packets[0]; in ZTEST()