00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _DTNPING_H_
00018 #define _DTNPING_H_
00019
00020 typedef struct {
00021 char ping[8];
00022 u_int32_t seqno;
00023 u_int32_t nonce;
00024 u_int32_t time;
00025 } ping_payload_t;
00026
00027 #define PING_STR "dtnping!"
00028
00029 #define TIMEVAL_DIFF_MSEC(t1, t2) \
00030 ((unsigned long int)(((t1).tv_sec - (t2).tv_sec) * 1000) + \
00031 (((t1).tv_usec - (t2).tv_usec) / 1000))
00032
00033 #define DTNTIME_OFFSET 946684800
00034
00035 #define DTNTIMEVAL_DIFF_MSEC(t1, t2) \
00036 ((unsigned long int)(((t1).secs + DTNTIME_OFFSET - (t2).tv_sec)))
00037
00038 #endif