ping.h
来自「AMLOGIC DPF source code」· C头文件 代码 · 共 81 行
H
81 行
/******************************************************************* * * Copyright C 2006 by Amlogic, Inc. All Rights Reserved. * * Description: Mini ping client * * Author: Jerry Cao * Created: Wed Dec 21 14:21:23 2006 * *******************************************************************/#ifndef _PING_H_#define _PING_H_/***************************** INCLUDES *****************************/#include "includes.h"#include "AVmalloc.h"#include <sys/types.h>#include <sys/socket.h>#include <sys/time.h>#include <errno.h>#include "avnet.h"#include "lwip/sockets.h"#include "lwip/sys.h"#include "lwip/tcpip.h"/************************ CONSTANTS & MACROS ************************/#define DEFAULT_PING_COUNT 4#define DEFAULT_PING_INTERVAL (1 * 1000)#define DEFAULT_PING_DATALEN 56#define MAX_PING_DUP_CHECK (8 * 128)#define PROTO_ICMP 1#define pingDebug AVOS_printf_ext/****************************** TYPES ******************************/typedef struct pingSession_s{ struct raw_pcb *pcb; struct pbuf *p; void (*fini) (struct pingSession_s *); void *cookie; AVTimer_t timer; int refcnt; int interrupt; struct ip_addr addr; int datalen; int interval; long count; int id; int options; long ntransmitted; long nreceived; long nrepeats; unsigned long tmin; unsigned long tmax; unsigned long tsum; char rcvd_tbl[MAX_PING_DUP_CHECK / 8];} pingSession_t;/**************************** PROTOTYPES ****************************/pingSession_t * ping_start(char *host, int count, int interval, int pktsize, int quiet, void (*fini) (pingSession_t *), void *cookie);void ping_interrupt(pingSession_t *session);void ping_ref(pingSession_t *session);void ping_unref(pingSession_t *session);#endif /* _PING_H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?