1 #ifndef __LIB_ICMP_INCLUDE_H__ 2 #define __LIB_ICMP_INCLUDE_H__ 15 #elif defined(ICMP_DLL) // || defined(_WINDLL) 16 # if defined(ICMP_EXPORTS) || defined(protocol_EXPORTS) 18 # define ICMP_API __declspec(dllexport) 20 # elif !defined(ICMP_API) 21 # define ICMP_API __declspec(dllimport) 23 #elif !defined(ICMP_API) 104 const char *ip,
size_t npkt,
size_t dlen,
int delay,
int timeout);
138 const char *ip,
size_t npkt,
int delay,
int timeout);
156 unsigned char code,
size_t npkt,
size_t dlen,
157 int delay,
int timeout);
162 unsigned char code,
unsigned short id,
163 const void *payload,
size_t payload_len);
183 const void *data,
size_t len);
ICMP_API ICMP_HOST * icmp_host_alloc(ICMP_CHAT *chat, const char *domain, const char *ip)
ICMP_API void icmp_stat_host(ICMP_HOST *host, int show_flag)
ICMP_API int icmp_chat_finish(ICMP_CHAT *chat)
ICMP_API unsigned short icmp_pkt_id(const ICMP_PKT *pkt)
ICMP_API void icmp_stream_from(ICMP_STREAM *is, struct sockaddr_in *addr)
ICMP_API void icmp_chat(ICMP_HOST *host)
ICMP_API ICMP_PKT * icmp_pkt_check(const ICMP_HOST *host, const ICMP_PKT *pkt)
ICMP_API void icmp_stat(ICMP_CHAT *chat)
ICMP_API void icmp_pkt_pack(ICMP_PKT *pkt, unsigned char type, unsigned char code, unsigned short id, const void *payload, size_t payload_len)
struct ICMP_CHAT ICMP_CHAT
ICMP_API const ICMP_PKT_STATUS * icmp_pkt_status(const ICMP_PKT *pkt)
ICMP_API unsigned char icmp_pkt_code(const ICMP_PKT *pkt)
ICMP_API void icmp_stream_set_dest(ICMP_STREAM *is, struct sockaddr_in addr)
ICMP_API void icmp_stream_close(ICMP_STREAM *is)
ICMP_API ICMP_HOST * icmp_host_new(ICMP_CHAT *chat, const char *domain, const char *ip, size_t npkt, size_t dlen, int delay, int timeout)
ICMP_API void icmp_host_free(ICMP_HOST *host)
ICMP_API unsigned short icmp_pkt_cksum(const ICMP_PKT *pkt)
ICMP_API void icmp_pkt_build(ICMP_PKT *pkt, unsigned short seq)
ICMP_API unsigned short icmp_pkt_seq(const ICMP_PKT *pkt)
ICMP_API size_t icmp_pkt_wlen(const ICMP_PKT *pkt)
ICMP_API const ICMP_PKT * icmp_pkt_peer(const ICMP_PKT *pkt)
ICMP_API ACL_VSTREAM * icmp_vstream(ICMP_STREAM *is)
ICMP_API int icmp_pkt_unpack(struct sockaddr_in from, const char *buf, int bytes, ICMP_PKT *pkt)
ICMP_API void icmp_pkt_save_status(ICMP_PKT *to, const ICMP_PKT *from)
ICMP_API void icmp_host_set(ICMP_HOST *host, void *arg, void(*stat_respond)(ICMP_PKT_STATUS *, void *), void(*stat_timeout)(ICMP_PKT_STATUS *, void *), void(*stat_unreach)(ICMP_PKT_STATUS *, void *), void(*stat_finish)(ICMP_HOST *, void *))
ICMP_API unsigned short icmp_chat_seqno(ICMP_CHAT *chat)
ICMP_API int icmp_chat_size(ICMP_CHAT *chat)
ICMP_API void icmp_pkt_set_code(ICMP_PKT *pkt, unsigned char code)
ICMP_API void icmp_pkt_set_type(ICMP_PKT *pkt, unsigned char type)
ICMP_API void icmp_pkt_set_seq(ICMP_PKT *pkt, unsigned short seq)
struct ICMP_STREAM ICMP_STREAM
ICMP_API ICMP_CHAT * icmp_chat_create(ACL_AIO *aio, int check_tid)
ICMP_API void icmp_stream_dest(ICMP_STREAM *is, struct sockaddr_in *addr)
ICMP_API int icmp_chat_count(ICMP_CHAT *chat)
ICMP_API size_t icmp_pkt_len(const ICMP_PKT *pkt)
ICMP_API size_t icmp_pkt_set_extra(ICMP_PKT *pkt, const void *data, size_t len)
ICMP_API void icmp_host_init(ICMP_HOST *host, unsigned char type, unsigned char code, size_t npkt, size_t dlen, int delay, int timeout)
ICMP_API void icmp_pkt_set_data(ICMP_PKT *pkt, void *data, size_t size)
ICMP_API void icmp_pkt_set_cksum(ICMP_PKT *pkt, unsigned short cksum)
ICMP_API void icmp_pkt_set_id(ICMP_PKT *pkt, unsigned short id)
ICMP_API void icmp_chat_free(ICMP_CHAT *chat)
ICMP_API unsigned char icmp_pkt_type(const ICMP_PKT *pkt)
ICMP_API void icmp_ping_one(ICMP_CHAT *chat, const char *domain, const char *ip, size_t npkt, int delay, int timeout)
ICMP_API ICMP_PKT * icmp_pkt_alloc(void)
ICMP_API void icmp_pkt_free(ICMP_PKT *ipkt)
ICMP_API size_t icmp_pkt_payload(const ICMP_PKT *pkt, char *buf, size_t size)
ICMP_API unsigned int icmp_pkt_gid(const ICMP_PKT *pkt)
ICMP_API ICMP_STREAM * icmp_stream_open(ACL_AIO *aio)