|
OpenVPN
|
#include "syshead.h"#include <stdarg.h>#include <stddef.h>#include <setjmp.h>#include <cmocka.h>#include "control_msg.h"#include "probe.h"#include "test_common.h"#include "test_probe.h"
Go to the source code of this file.
Functions | |
| void | test_probe_request_roundtrip (void **state) |
| void | test_probe_request_wire_format (void **state) |
| void | test_probe_reply_roundtrip (void **state) |
| void | test_probe_reply_wire_format (void **state) |
| void | test_probe_request_forward_compat (void **state) |
| void | test_probe_request_too_short (void **state) |
| void | test_probe_reply_too_short (void **state) |
| void | test_probe_reply_flags_contradict (void **state) |
| void | test_find_tlv_value_truncated (void **state) |
| void | test_find_tlv_trailing_bytes (void **state) |
| void | test_find_tlv_skips_optional_after_wanted (void **state) |
| void | test_find_tlv_rejects_unknown_mandatory (void **state) |
| void | test_find_tlv_rejects_duplicate (void **state) |
| void | test_find_tlv_empty_payload (void **state) |
| void test_find_tlv_empty_payload | ( | void ** | state | ) |
Definition at line 416 of file test_probe.c.
References alloc_buf_gc(), ctrl_msg_find_tlv(), gc, gc_free(), gc_new(), and TLV_TYPE_PROBE_REQUEST.
Referenced by main().
| void test_find_tlv_rejects_duplicate | ( | void ** | state | ) |
Definition at line 391 of file test_probe.c.
References alloc_buf_gc(), buf_write_u32(), ctrl_msg_find_tlv(), ctrl_msg_tlv_write_header(), gc, gc_free(), gc_new(), probe_request_write(), and TLV_TYPE_PROBE_REQUEST.
Referenced by main().
| void test_find_tlv_rejects_unknown_mandatory | ( | void ** | state | ) |
Definition at line 366 of file test_probe.c.
References alloc_buf_gc(), buf_write_u32(), ctrl_msg_find_tlv(), ctrl_msg_tlv_write_header(), gc, gc_free(), gc_new(), probe_request_write(), and TLV_TYPE_PROBE_REQUEST.
Referenced by main().
| void test_find_tlv_skips_optional_after_wanted | ( | void ** | state | ) |
Definition at line 342 of file test_probe.c.
References alloc_buf_gc(), BLEN, buf_write_u32(), ctrl_msg_find_tlv(), ctrl_msg_tlv_write_header(), gc, gc_free(), gc_new(), PROBE_REQUEST_LEN, probe_request_read(), probe_request_write(), probe_request::timestamp, and TLV_TYPE_PROBE_REQUEST.
Referenced by main().
| void test_find_tlv_trailing_bytes | ( | void ** | state | ) |
Definition at line 318 of file test_probe.c.
References alloc_buf_gc(), buf_write_u8(), ctrl_msg_find_tlv(), CTRL_MSG_TLV_HEADER_LEN, gc, gc_free(), gc_new(), probe_request_write(), and TLV_TYPE_PROBE_REQUEST.
Referenced by main().
| void test_find_tlv_value_truncated | ( | void ** | state | ) |
Definition at line 294 of file test_probe.c.
References alloc_buf_gc(), buf_write_u32(), buf_write_u64(), ctrl_msg_find_tlv(), ctrl_msg_tlv_write_header(), gc, gc_free(), gc_new(), PROBE_REQUEST_LEN, and TLV_TYPE_PROBE_REQUEST.
Referenced by main().
| void test_probe_reply_flags_contradict | ( | void ** | state | ) |
Definition at line 256 of file test_probe.c.
References alloc_buf_gc(), ctrl_msg_find_tlv(), probe_reply::flags, gc, gc_free(), gc_new(), PROBE_REPLY_FLAG_ADDRS_EQUAL, PROBE_REPLY_FLAG_LIFETIME_SHARED, PROBE_REPLY_FLAG_PROBE_MORE, probe_reply_read(), probe_reply_write(), SIZE, and TLV_TYPE_PROBE_REPLY.
Referenced by main().
| void test_probe_reply_roundtrip | ( | void ** | state | ) |
Definition at line 108 of file test_probe.c.
References alloc_buf_gc(), BLEN, probe_reply::connect_lifetime, ctrl_msg_find_tlv(), CTRL_MSG_TLV_HEADER_LEN, ctrl_msg_tlv_peek_header(), probe_reply::flags, gc, gc_free(), gc_new(), probe_reply::max_latency_diff, ctrl_msg_tlv_header::optional, probe_reply::priority, PROBE_REPLY_FLAG_RESEND_WKC, PROBE_REPLY_LEN, probe_reply_read(), probe_reply_write(), probe_reply::request_id, TLV_TYPE_PROBE_REPLY, ctrl_msg_tlv_header::type, ctrl_msg_tlv_header::value_len, and probe_reply::weight.
Referenced by main().
| void test_probe_reply_too_short | ( | void ** | state | ) |
Definition at line 235 of file test_probe.c.
References alloc_buf_gc(), buf_write_u16(), buf_write_u64(), gc, gc_free(), gc_new(), and probe_reply_read().
Referenced by main().
| void test_probe_reply_wire_format | ( | void ** | state | ) |
Definition at line 151 of file test_probe.c.
References alloc_buf_gc(), BLEN, BPTR, gc, gc_free(), gc_new(), PROBE_REPLY_FLAG_RESEND_WKC, and probe_reply_write().
Referenced by main().
| void test_probe_request_forward_compat | ( | void ** | state | ) |
Definition at line 189 of file test_probe.c.
References alloc_buf_gc(), BLEN, buf_write_u32(), buf_write_u64(), ctrl_msg_find_tlv(), ctrl_msg_tlv_write_header(), probe_request::flags, gc, gc_free(), gc_new(), PROBE_REQUEST_LEN, probe_request_read(), probe_request::request_id, probe_request::timestamp, and TLV_TYPE_PROBE_REQUEST.
Referenced by main().
| void test_probe_request_roundtrip | ( | void ** | state | ) |
Definition at line 42 of file test_probe.c.
References alloc_buf_gc(), BLEN, ctrl_msg_find_tlv(), CTRL_MSG_TLV_HEADER_LEN, ctrl_msg_tlv_peek_header(), probe_request::flags, gc, gc_free(), gc_new(), ctrl_msg_tlv_header::optional, PROBE_REQUEST_FLAG_PROBE_ONLY, PROBE_REQUEST_LEN, probe_request_read(), probe_request_write(), probe_request::request_id, probe_request::timestamp, TLV_TYPE_PROBE_REQUEST, ctrl_msg_tlv_header::type, and ctrl_msg_tlv_header::value_len.
Referenced by main().
| void test_probe_request_too_short | ( | void ** | state | ) |
Definition at line 219 of file test_probe.c.
References alloc_buf_gc(), buf_write_u64(), gc, gc_free(), gc_new(), and probe_request_read().
Referenced by main().
| void test_probe_request_wire_format | ( | void ** | state | ) |
Definition at line 79 of file test_probe.c.
References alloc_buf_gc(), BLEN, BPTR, gc, gc_free(), gc_new(), and probe_request_write().
Referenced by main().