• R/O
  • HTTP
  • SSH
  • HTTPS

dxchange: Commit


Commit MetaInfo

Revision1816ffbccb4f076cd958df792d26e26029afa5fa (tree)
Time2016-06-26 23:17:14
AuthorSatoshi Yasuda <7m3tjz@jk1z...>
CommiterSatoshi Yasuda

Log Message

modified: repeater.c

Change Summary

Incremental Difference

--- a/repeater.c
+++ b/repeater.c
@@ -20,6 +20,7 @@ int rpt_zr_sd;
2020 int rpt_gw_sd;
2121 int recv_zr_seq = 0;
2222 int send_zr_seq = 0;
23+int send_zr_seq_save = 0;
2324 int recv_gw_seq = 0;
2425 int send_gw_seq = 0;
2526 int send_gw_seq_save = 0;
@@ -45,6 +46,8 @@ void repeater_zr(void)
4546 int zr_length;
4647 socklen_t zr_in_addr_len;
4748 struct forward *pnt;
49+ unsigned int seq_tmp;
50+ time_t atime;
4851
4952 zr_in_addr_len= sizeof(zr_in_addr);
5053 zr_length = recvfrom(rpt_zr_sd, &zr_buff, sizeof(zr_buff), 0,
@@ -68,6 +71,16 @@ void repeater_zr(void)
6871 }
6972 else if (zr_buff.zr_buffer[6] == 'r')
7073 {
74+ seq_tmp = (zr_buff.zr_buffer[4] << 8) | (zr_buff.zr_buffer[5] & 0xff);
75+ seq_tmp &= 0xffff;
76+ if (seq_tmp != send_zr_seq_save)
77+ {
78+ time(&atime);
79+ fprintf (log_file, "%24.24s zr seq. send:%d recv:%d\n", ctime(&atime), send_zr_seq_save, seq_tmp);
80+ fflush (log_file);
81+ //send_zr_seq = seq_tmp;
82+ }
83+ send_gw_seq &= 0xffff;
7184 }
7285 }
7386
@@ -98,6 +111,7 @@ void send_zr (char pkt[])
98111 length += 10;
99112 pkt[4] = send_zr_seq >> 8;
100113 pkt[5] = send_zr_seq & 0xff;
114+ send_zr_seq_save = send_zr_seq;
101115 send_zr_seq++;
102116 send_zr_seq &= 0xffff;
103117
@@ -111,6 +125,7 @@ void repeater_gw(void)
111125 socklen_t gw_in_addr_len;
112126 struct forward *pnt;
113127 unsigned int seq_tmp;
128+ time_t atime;
114129
115130 gw_in_addr_len = sizeof(gw_in_addr);
116131 gw_length = recvfrom(rpt_gw_sd, &gw_buff, sizeof(gw_buff), 0,
@@ -136,7 +151,13 @@ void repeater_gw(void)
136151 {
137152 seq_tmp = (gw_buff.gw_buffer[4] << 8) | (gw_buff.gw_buffer[5] & 0xff);
138153 seq_tmp &= 0xffff;
139- if (seq_tmp != send_gw_seq_save) send_gw_seq = seq_tmp;
154+ if (seq_tmp != send_gw_seq_save)
155+ {
156+ time(&atime);
157+ fprintf (log_file, "%24.24s gw seq. send:%d recv:%d\n", ctime(&atime), send_gw_seq_save, seq_tmp);
158+ fflush (log_file);
159+ send_gw_seq = seq_tmp;
160+ }
140161 send_gw_seq &= 0xffff;
141162 }
142163 }
Show on old repository browser