#include <stdlib.h>
#include <stdbool.h>
#include "lwip/opt.h"
#include "lwip/init.h"
#include "lwip/mem.h"
#include "lwip/icmp.h"
#include "lwip/netif.h"
#include "lwip/sys.h"
#include "lwip/timeouts.h"
#include "lwip/inet.h"
#include "lwip/inet_chksum.h"
#include "lwip/ip.h"
#include "lwip/netdb.h"
#include "lwip/sockets.h"
#include "xf_sys.h"
#include "xf_ping.h"
浏览源代码.
|
static const char * | TAG = "xf_ping" |
|
- 作者
- catcatBlue (catca.nosp@m.tblu.nosp@m.e@qq..nosp@m.com)
- 版本
- 1.0
- 日期
- 2024-10-12
Copyright (c) 2024, CorAL. All rights reserved.
在文件 xf_ping.c 中定义.
◆ PING_TIME_DIFF_MS
#define PING_TIME_DIFF_MS |
( |
|
_end, |
|
|
|
_start |
|
) |
| ((uint32_t)((_end - _start) / 1000)) |
◆ PING_CHECK_START_TIMEOUT_MS
#define PING_CHECK_START_TIMEOUT_MS (100) |
◆ PING_FLAGS_INIT
#define PING_FLAGS_INIT (1 << 0) |
◆ PING_FLAGS_RUN
#define PING_FLAGS_RUN (1 << 1) |
◆ THREAD_NOTIFY_BIT
#define THREAD_NOTIFY_BIT 0x01 |
◆ XF_GOTO_ON_FALSE
#define XF_GOTO_ON_FALSE |
( |
|
a, |
|
|
|
err_code, |
|
|
|
goto_tag, |
|
|
|
log_tag, |
|
|
|
format, |
|
|
|
... |
|
) |
| |
值: do { \
XF_LOGE(log_tag, format, ##__VA_ARGS__); \
ret = err_code; \
goto goto_tag; \
} \
} while (0)
#define unlikely(x)
分支预测,优化条件为 假 的可能性更大的情况。
在文件 xf_ping.c 第 59 行定义.
◆ WAIT_CNT_MAX
#define WAIT_CNT_MAX 1000 |
◆ xf_ping_send()
◆ xf_ping_receive()
< sock buffer, 64 字节足以容纳 IP 头和 ICMP 头
< ICMP 的数据部分
在文件 xf_ping.c 第 376 行定义.
◆ xf_ping_thread()
static void xf_ping_thread |
( |
void * |
args | ) |
|
|
static |
◆ TAG
const char* TAG = "xf_ping" |
|
static |