mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-12 11:40:39 +03:00
Debugging: Add coap_debug_set_packet_fail() for testing network failures
This is similar to coap_debug_set_packet_loss() which drops packets that are to be sent, but emulates network reported errors by reporting ECONNREFUSED.
This commit is contained in:
1 parent
c0ee83bcfb
commit
21b7a9a0eb
10 files changed
+139
-11
No files matched your search
@@ -408,6 +408,21 @@ const char *coap_print_ip_addr(const coap_address_t *address,
|
||||
*/
|
||||
int coap_debug_set_packet_loss(const char *loss_level);
|
||||
|
||||
/**
|
||||
* Set the packet transmit fail level for testing. This can be in one of two forms.
|
||||
*
|
||||
* Percentage : 0% to 100%. Use the specified probability.
|
||||
* 0% is send all packets, 100% is fail all packets.
|
||||
*
|
||||
* List: A comma separated list of numbers or number ranges that are the
|
||||
* packets to fail.
|
||||
*
|
||||
* @param fail_level The defined fail level (percentage or list).
|
||||
*
|
||||
* @return @c 1 If fail level set, @c 0 if there is an error.
|
||||
*/
|
||||
int coap_debug_set_packet_fail(const char *fail_level);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user