Changeset 331 for EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/ping.c
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/ping.c
r321 r331 2 2 * TINET (TCP/IP Protocol Stack) 3 3 * 4 * Copyright (C) 2001-20 09by Dep. of Computer Science and Engineering4 * Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 6 * … … 61 61 #include <net/ppp_ipcp.h> 62 62 #include <net/net.h> 63 #include <net/net_endian.h> 63 64 #include <net/net_buf.h> 64 65 #include <net/net_timer.h> … … 74 75 #ifdef USE_PING 75 76 77 #if defined(SUPPORT_INET4) 78 76 79 /* 77 80 * 変数 78 81 */ 79 82 80 static uint16_t icmp_id = 0; 83 #if 0 81 84 static uint16_t curr_icmp_id; 82 85 static uint16_t curr_icmp_len; 86 #endif 87 88 static uint16_t icmp_id = 0; 83 89 static SYSTIM icmp_start_time; 84 90 … … 90 96 icmp_reply_timeout (void *arg) 91 97 { 92 syslog(LOG_NOTICE, "[PING ] request timeout.");98 syslog(LOG_NOTICE, "[PING4] request timeout."); 93 99 } 94 100 … … 100 106 icmp_echo_reply (T_NET_BUF *input, uint_t ihoff) 101 107 { 102 SYSTIM time; 108 SYSTIM time; 109 T_IN4_ADDR addr; 103 110 104 111 syscall(get_tim(&time)); 112 addr = ntohl(GET_IP4_HDR(input)->src); 105 113 untimeout(icmp_reply_timeout, NULL); 106 syslog(LOG_NOTICE, "[PING] reply, %d [ms].", 107 (time - icmp_start_time) * 1000 / SYSTIM_HZ); 114 syslog(LOG_NOTICE, "[PING4] reply: %5ld [ms] from: %s", 115 (time - icmp_start_time) * 1000 / SYSTIM_HZ, 116 ip2str(NULL, &addr)); 108 117 } 109 118 … … 143 152 144 153 /* 応答チェック用の変数を設定する。*/ 154 #if 0 145 155 curr_icmp_id = icmp_id ++; 146 156 curr_icmp_len = len; 157 #endif 147 158 148 159 NET_COUNT_MIB(icmp_stats.icmpOutMsgs, 1); … … 157 168 } 158 169 170 #endif /* of #if defined(SUPPORT_INET4) */ 171 159 172 #endif /* of #ifdef USE_PING */
Note:
See TracChangeset
for help on using the changeset viewer.