• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

Revision3652bb6c4696c75c500ca526a5d0006b48c08947 (tree)
Zeit2022-12-01 18:44:46
AutorSatoshi Yasuda <7m3tjz@jarl...>
CommiterSatoshi Yasuda

Log Message

modified: dmonitor.h
modified: dmonitor_utils.c
modified: dvap.c
modified: dvmega_utils.c
modified: extern_dmonitor.h
modified: from_node.c
modified: inet_read.c
modified: init.c
modified: main.c
modified: repeater_mon.c
modified: rig_read.c
modified: rpt_conn.c

Ändern Zusammenfassung

Diff

--- a/config.h
+++ b/config.h
@@ -102,7 +102,7 @@
102102 #define PACKAGE_NAME "dmonitor"
103103
104104 /* Define to the full name and version of this package. */
105-#define PACKAGE_STRING "dmonitor 01.81"
105+#define PACKAGE_STRING "dmonitor 01.82"
106106
107107 /* Define to the one symbol short name of this package. */
108108 #define PACKAGE_TARNAME "dmonitor"
@@ -111,13 +111,13 @@
111111 #define PACKAGE_URL ""
112112
113113 /* Define to the version of this package. */
114-#define PACKAGE_VERSION "01.81"
114+#define PACKAGE_VERSION "01.82"
115115
116116 /* Define to 1 if you have the ANSI C header files. */
117117 #define STDC_HEADERS 1
118118
119119 /* Version number of package */
120-#define VERSION "01.81"
120+#define VERSION "01.82"
121121
122122 /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
123123 <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
11 #! /bin/sh
22 # Guess values for system-dependent variables and create Makefiles.
3-# Generated by GNU Autoconf 2.69 for dmonitor 01.81.
3+# Generated by GNU Autoconf 2.69 for dmonitor 01.82.
44 #
55 # Report bugs to <7m3tjz@jarl.com>.
66 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
580580 # Identity of this package.
581581 PACKAGE_NAME='dmonitor'
582582 PACKAGE_TARNAME='dmonitor'
583-PACKAGE_VERSION='01.81'
584-PACKAGE_STRING='dmonitor 01.81'
583+PACKAGE_VERSION='01.82'
584+PACKAGE_STRING='dmonitor 01.82'
585585 PACKAGE_BUGREPORT='7m3tjz@jarl.com'
586586 PACKAGE_URL=''
587587
@@ -1277,7 +1277,7 @@ if test "$ac_init_help" = "long"; then
12771277 # Omit some internal or obsolete options to make the list less imposing.
12781278 # This message is too long to be a string in the A/UX 3.1 sh.
12791279 cat <<_ACEOF
1280-\`configure' configures dmonitor 01.81 to adapt to many kinds of systems.
1280+\`configure' configures dmonitor 01.82 to adapt to many kinds of systems.
12811281
12821282 Usage: $0 [OPTION]... [VAR=VALUE]...
12831283
@@ -1344,7 +1344,7 @@ fi
13441344
13451345 if test -n "$ac_init_help"; then
13461346 case $ac_init_help in
1347- short | recursive ) echo "Configuration of dmonitor 01.81:";;
1347+ short | recursive ) echo "Configuration of dmonitor 01.82:";;
13481348 esac
13491349 cat <<\_ACEOF
13501350
@@ -1435,7 +1435,7 @@ fi
14351435 test -n "$ac_init_help" && exit $ac_status
14361436 if $ac_init_version; then
14371437 cat <<\_ACEOF
1438-dmonitor configure 01.81
1438+dmonitor configure 01.82
14391439 generated by GNU Autoconf 2.69
14401440
14411441 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1912,7 +1912,7 @@ cat >config.log <<_ACEOF
19121912 This file contains any messages produced by compilers while
19131913 running configure, to aid debugging if configure makes a mistake.
19141914
1915-It was created by dmonitor $as_me 01.81, which was
1915+It was created by dmonitor $as_me 01.82, which was
19161916 generated by GNU Autoconf 2.69. Invocation command line was
19171917
19181918 $ $0 $@
@@ -2773,7 +2773,7 @@ fi
27732773
27742774 # Define the identity of the package.
27752775 PACKAGE='dmonitor'
2776- VERSION='01.81'
2776+ VERSION='01.82'
27772777
27782778
27792779 cat >>confdefs.h <<_ACEOF
@@ -5043,7 +5043,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
50435043 # report actual input values of CONFIG_FILES etc. instead of their
50445044 # values after options handling.
50455045 ac_log="
5046-This file was extended by dmonitor $as_me 01.81, which was
5046+This file was extended by dmonitor $as_me 01.82, which was
50475047 generated by GNU Autoconf 2.69. Invocation command line was
50485048
50495049 CONFIG_FILES = $CONFIG_FILES
@@ -5109,7 +5109,7 @@ _ACEOF
51095109 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
51105110 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
51115111 ac_cs_version="\\
5112-dmonitor config.status 01.81
5112+dmonitor config.status 01.82
51135113 configured by $0, generated by GNU Autoconf 2.69,
51145114 with options \\"\$ac_cs_config\\"
51155115
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,33 @@
1+dmonitor (01.82) unstable; urgency=low
2+
3+ * V01.82 release (#145)
4+
5+ -- Satoshi Yasuda <7m3tjz@jarl.com> Wed, 27 Oct 2022 06:20:00 +0900
6+
7+dmonitor (01.82c) unstable; urgency=low
8+
9+ * added gps_skip_sw (#144)
10+
11+ -- Satoshi Yasuda <7m3tjz@jarl.com> Wed, 26 Oct 2022 14:00:00 +0900
12+
13+dmonitor (01.82b) unstable; urgency=low
14+
15+ * changed repeacter_mon cookie (#143)
16+
17+ -- Satoshi Yasuda <7m3tjz@jarl.com> Tue, 25 Oct 2022 11:50:00 +0900
18+
19+dmonitor (01.82a) unstable; urgency=low
20+
21+ * changed droppacket routine (#142)
22+
23+ -- Satoshi Yasuda <7m3tjz@jarl.com> Mon, 24 Oct 2022 23:30:00 +0900
24+
125 dmonitor (01.81) unstable; urgency=low
226
327 * bug fixed main.c (#141)
428 * added skip the gps only packet & ci-v mode
529
6- -- Satoshi Yasuda <7m3tjz@jarl.com> Tue, 18 Oct 2022 09:20:00 +0900
30+ -- Satoshi Yasuda <7m3tjz@jarl.com> Sat, 22 Oct 2022 23:20:00 +0900
731
832 dmonitor (01.80) unstable; urgency=low
933
--- a/dmonitor.h
+++ b/dmonitor.h
@@ -41,6 +41,7 @@
4141 //#define _DEBUG_DVAP_SQUELCH
4242 //#define _DEBUG_JITTER
4343 //#define _DEBUG_INET
44+//#define _DEBUG_RIG_WRITE_PACKET
4445 //#define _DEBUG_GPS_ONLY
4546 #define _DEBUG_MD5
4647
@@ -53,7 +54,7 @@
5354 #define HOLE_PUNCHD_SERVER "hole-punchd.d-star.info"
5455 #define HOLE_PUNCHD_PORT 30010
5556
56-#define KEEP_ALIVE_INTERVAL 2
57+#define KEEP_ALIVE_INTERVAL 5
5758
5859 #define CONNECTED_LIST "/var/tmp/connected_table.html"
5960 #define CONNECTED_LIST_TEMP "/var/tmp/connected_table.temp"
@@ -108,6 +109,8 @@ int rig_fd;
108109 struct termios save_attr;
109110 struct termios attr;
110111
112+struct sockaddr_in hole_punch_server_addr;
113+
111114 time_t send_time;
112115
113116 time_t rig_alive_recv;
@@ -133,6 +136,10 @@ struct timeval inet_recv_time;
133136 struct timeval inet_recv_time_save;
134137 struct timeval inet_recv_timeout;
135138
139+struct timeval dvmega_recv_time;
140+struct timeval dvmega_status_time;
141+struct timeval dvmega_temp;
142+
136143 struct timeval rig_last_timeout;
137144 int seq;
138145 unsigned char send_buff[128];
@@ -324,7 +331,8 @@ long int l_int;
324331 /* GPS skip */
325332 int gps_wait;
326333 int gps_only;
334+int gps_skip_sw;
327335
328336 char rf_header_save[44];
329337
330-
338+char voice_save[9];
--- a/dmonitor_utils.c
+++ b/dmonitor_utils.c
@@ -16,6 +16,7 @@ void lcd_write(void);
1616 int node_space_check (int length);
1717 int check_getFifo(void);
1818 void send_dvap_keep_alive(void);
19+void send_synmetric_nat (void);
1920
2021 extern char dummy_frame_1[12];
2122 extern char dummy_frame_2[12];
@@ -44,6 +45,25 @@ int htoi (const char *s)
4445 return n;
4546 }
4647
48+void get_hole_punch_server_addr (void)
49+{
50+ int k;
51+ int n;
52+ int ret;
53+ char buff[88];
54+ struct hostent *host;
55+
56+ hole_punch_server_addr.sin_family = AF_INET;
57+ hole_punch_server_addr.sin_port = htons(hole_punch_port);
58+ hole_punch_server_addr.sin_addr.s_addr = inet_addr(hole_punch_server);
59+ if (hole_punch_server_addr.sin_addr.s_addr == 0xffffffff)
60+ {
61+ host = gethostbyname(hole_punch_server);
62+ if (host == NULL) return;
63+ hole_punch_server_addr.sin_addr.s_addr = *(unsigned int *)host->h_addr_list[0];
64+ }
65+}
66+
4767 int rig_open(void)
4868 {
4969 struct termios attr;
@@ -138,7 +158,7 @@ void pselectSet(void)
138158 {
139159 FD_ZERO (&fd_save);
140160 timeout.tv_sec = 0;
141- timeout.tv_nsec = 10000000;
161+ timeout.tv_nsec = 2000000;
142162 }
143163
144164 void handler (int sig)
@@ -261,6 +281,7 @@ int send_dest_keep_alive (void)
261281 {
262282 int k;
263283 int n;
284+ int ret;
264285 char buff[80];
265286 struct hostent *host;
266287
@@ -277,8 +298,9 @@ int send_dest_keep_alive (void)
277298 memset (buff, 0x00, sizeof(buff));
278299 memcpy (&buff[20], connect_call, 8);
279300 sprintf (&buff[4], "%s", inet_ntoa (in_addr.sin_addr));
280- sendto(in_addr_sock, &buff[4], 24, MSG_DONTWAIT,
301+ ret = sendto(in_addr_sock, &buff[4], 24, MSG_DONTWAIT,
281302 (struct sockaddr *)&in_addr, sizeof(in_addr));
303+ if (ret == -1) syslog (LOG_ERR, "dest keep alive send error %s", strerror(errno));
282304 time(&hole_punch_send_time);
283305 time(&dest_keep_alive_send_time);
284306 return TRUE;
@@ -348,22 +370,13 @@ void send_keep_alive(void)
348370 }
349371 }
350372
351- in_addr.sin_family = AF_INET;
352- in_addr.sin_port = htons(hole_punch_port);
353- in_addr.sin_addr.s_addr = inet_addr(hole_punch_server);
354- if (in_addr.sin_addr.s_addr == 0xffffffff)
355- {
356- host = gethostbyname(hole_punch_server);
357- if (host == NULL) return;
358- in_addr.sin_addr.s_addr = *(unsigned int *)host->h_addr_list[0];
359- }
360373 memcpy (buff, "HPCH", 4);
361374 memcpy (&buff[64], area_call, 8);
362375 memcpy (&buff[72], zone_call, 7);
363376 memcpy (&buff[80], connect_call, 8);
364377 buff[79] = 0x20;
365378 ret = sendto(in_addr_sock, buff, 88, MSG_DONTWAIT,
366- (struct sockaddr *)&in_addr, sizeof(in_addr));
379+ (struct sockaddr *)&hole_punch_server_addr, sizeof(hole_punch_server_addr));
367380 time(&hole_punch_send_time);
368381 time(&dest_keep_alive_send_time);
369382 }
@@ -401,14 +414,17 @@ void send_drop_packet (void)
401414 {
402415 send_buff[0] = 0x10;
403416 send_buff[1] = 0x22;
417+ send_buff[3]++;
404418 if (send_buff[3] > 20)
405419 {
406420 send_buff[3] = 0;
407421 memcpy (&send_buff[4], NullVoice, 12);
422+ memcpy (&send_buff[4], voice_save, 9);
408423 }
409424 else
410425 {
411426 memcpy (&send_buff[4], NullVoice1, 12);
427+ memcpy (&send_buff[4], voice_save, 9);
412428 }
413429 send_buff[2] = seq & 0xff;
414430 seq++;
@@ -443,6 +459,7 @@ int send_rig (void)
443459 else if (length == 42)
444460 {
445461 rig_write (42, &send_buff[3]);
462+ memcpy (voice_save, NullVoice, 9);
446463 seq = 0;
447464 }
448465 else if (length == 13)
@@ -475,6 +492,7 @@ int send_rig (void)
475492 frameID = 0;
476493 }
477494 }
495+ memcpy (voice_save, &send_buff[4], 9);
478496 return TRUE;
479497 }
480498
@@ -1078,3 +1096,31 @@ void right_os (void)
10781096 ret = system (cmd);
10791097 }
10801098
1099+void send_synmetric_nat (void)
1100+{
1101+ int k;
1102+ int n;
1103+ char buff[42];
1104+ struct hostent *host;
1105+
1106+ in_addr.sin_family = AF_INET;
1107+ in_addr.sin_port = htons(dest_inet_port);
1108+ //in_addr.sin_port = htons(51000);
1109+ in_addr.sin_addr.s_addr = inet_addr(dest_address);
1110+ if (in_addr.sin_addr.s_addr == 0xffffffff)
1111+ {
1112+ host = gethostbyname(dest_address);
1113+ if (host == NULL) return;
1114+ in_addr.sin_addr.s_addr = *(unsigned int *)host->h_addr_list[0];
1115+ }
1116+ memset (buff, 0x00, sizeof(buff));
1117+ memcpy (buff, "HPCH", 4);
1118+ sprintf (&buff[4], "%s:%d", inet_ntoa (in_addr.sin_addr), dest_inet_port);
1119+ //memcpy (&buff[4], "0.0.0.0:0", 9);
1120+ memcpy (&buff[26], area_call, 8);
1121+ memcpy (&buff[34], zone_call, 8);
1122+ buff[41] = 0x20;
1123+ sendto(in_addr_sock, buff, 42, MSG_DONTWAIT,
1124+ (struct sockaddr *)&in_addr, sizeof(in_addr));
1125+}
1126+
--- a/dvap.c
+++ b/dvap.c
@@ -699,11 +699,14 @@ void dvap_send_voice (void)
699699 if (gps_wait)
700700 {
701701 gps_wait = FALSE;
702- if (!memcmp (&dvap_voice[6], NullVoice, 12)
703- || !memcmp (&dvap_voice[6], gps_only_1, 12))
702+ if (gps_skip_sw)
704703 {
705- gps_only = TRUE;
706- goto gps_skip;
704+ if (!memcmp (&dvap_voice[6], NullVoice, 12)
705+ || !memcmp (&dvap_voice[6], gps_only_1, 12))
706+ {
707+ gps_only = TRUE;
708+ goto gps_skip;
709+ }
707710 }
708711 inet_send_buff[16] = 0x80;
709712 //memcpy (&inet_send_buff[17], &dvap_header[6], 41);
--- a/dvmega_utils.c
+++ b/dvmega_utils.c
@@ -216,6 +216,7 @@ void dvmega_read (void)
216216 break;
217217
218218 case DVMEGA_DSTAR_DATA:
219+ gettimeofday (&dvmega_recv_time, NULL);
219220 if (gps_only) break;
220221 if (gps_wait)
221222 {
@@ -226,17 +227,21 @@ void dvmega_read (void)
226227 rig_buff[3], rig_buff[4], rig_buff[5], rig_buff[6], rig_buff[7], rig_buff[8],
227228 rig_buff[9], rig_buff[10], rig_buff[11], rig_buff[12], rig_buff[13], rig_buff[14]);
228229 syslog (LOG_DEBUG, "gps only 100 %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
229- gps_only_1[0], gps_only_1[1],gps_only_1[2],gps_only_1[3],gps_only_1[4],gps_only_1[5],gps_only_1[6],gps_only_1[7],gps_only_1[8],gps_only_1[9],gps_only_1[10],gps_only_1[11]);
230+ gps_only_1[0], gps_only_1[1],gps_only_1[2],gps_only_1[3],gps_only_1[4],gps_only_1[5],gps_only_1[6],
231+ gps_only_1[7],gps_only_1[8],gps_only_1[9],gps_only_1[10],gps_only_1[11]);
230232 #endif
231- if (!memcmp (&rig_buff[3], NullVoice, 12)
232- || !memcmp (&rig_buff[3], gps_only_1, 12))
233+ if (gps_skip_sw)
233234 {
234- #ifdef _DEBUG_GPS_ONLY
235- syslog (LOG_DEBUG, "gps only Set");
236- #endif
237- frameID = 0;
238- gps_only = TRUE;
239- break;
235+ if (!memcmp (&rig_buff[3], NullVoice, 12)
236+ || !memcmp (&rig_buff[3], gps_only_1, 12))
237+ {
238+ #ifdef _DEBUG_GPS_ONLY
239+ syslog (LOG_DEBUG, "gps only Set");
240+ #endif
241+ frameID = 0;
242+ gps_only = TRUE;
243+ break;
244+ }
240245 }
241246 gw_on = FALSE;
242247 if (!inet_send_buff_set()) break;
@@ -377,12 +382,13 @@ void dvmega_read (void)
377382 #ifdef _DEBUG_DVMEGA
378383 syslog (LOG_DEBUG, "EOT");
379384 #endif
385+eot:
380386 send_header_sw = FALSE;
381387 if (!dvmega_last_frame_sw)
382388 {
383389 if (send_sw && no_cmd_sw)
384390 {
385- //if (!gps_only)
391+ if (!gps_only)
386392 {
387393 inet_send_buff[9] = 0x13;
388394 inet_send_buff[4] = (m_seq >> 8) & 0xff;
@@ -408,8 +414,6 @@ void dvmega_read (void)
408414 inet_send_buff[9] = 0x13;
409415 inet_send_buff[4] = (m_seq >> 8) & 0xff;
410416 inet_send_buff[5] = m_seq & 0xff;
411- inet_send_buff[7] &= 0x33;
412- inet_send_buff[7] |= FWD | ZR;
413417 inet_send_buff[16] = dvmega_frame_seq;
414418 inet_send_buff[16] |= 0x40;
415419 dvmega_frame_seq++;
@@ -437,6 +441,12 @@ void dvmega_read (void)
437441 #ifdef _DEBUG_DVMEGA
438442 syslog (LOG_INFO, "dvmega dstar space:%d dvmega_mode:%2.2x dvmega_tx:%2.2x", dvmega_dstarSpace, dvmega_mode, dvmega_tx);
439443 #endif
444+ if ((inet_frame_id[0] == 0xff) && (inet_frame_id[1] == 0xff))
445+ {
446+ gettimeofday (&dvmega_status_time, NULL);
447+ timersub (&dvmega_status_time, &dvmega_recv_time, &dvmega_temp);
448+ if (dvmega_temp.tv_sec || (dvmega_temp.tv_usec > 40000)) goto eot;
449+ }
440450 break;
441451
442452 default:
--- a/extern_dmonitor.h
+++ b/extern_dmonitor.h
@@ -40,6 +40,7 @@
4040 //#define _DEBUG_DVAP_SQUELCH
4141 //#define _DEBUG_JITTER
4242 //#define _DEBUG_INET
43+//#define _DEBUG_RIG_WRITE_PACKET
4344 //#define _DEBUG_GPS_ONLY
4445
4546 #define GW 0x80
@@ -51,7 +52,7 @@
5152 #define HOLE_PUNCHD_SERVER "hole-punchd.d-star.info"
5253 #define HOLE_PUNCHD_PORT 30010
5354
54-#define KEEP_ALIVE_INTERVAL 2
55+#define KEEP_ALIVE_INTERVAL 5
5556
5657 #define CONNECTED_LIST "/var/tmp/connected_table.html"
5758 #define CONNECTED_LIST_TEMP "/var/tmp/connected_table.temp"
@@ -102,6 +103,8 @@ extern int in_addr_sock;
102103
103104 extern struct sockaddr_in out_addr;
104105
106+extern struct sockaddr_in hole_punch_server_addr;
107+
105108 extern int rig_fd;
106109 extern struct termios save_attr;
107110 extern struct termios attr;
@@ -131,6 +134,10 @@ extern struct timeval inet_recv_time;
131134 extern struct timeval inet_recv_time_save;
132135 extern struct timeval inet_recv_timeout;
133136
137+extern struct timeval dvmega_recv_time;
138+extern struct timeval dvmega_status_time;
139+extern struct timeval dvmega_temp;
140+
134141 extern struct timeval rig_last_timeout;
135142 extern int seq;
136143 extern unsigned char send_buff[128];
@@ -321,8 +328,10 @@ extern long int l_int;
321328 /* GPS only cehck */
322329 extern int gps_wait;
323330 extern int gps_only;
331+extern int gps_skip_sw;
324332
325-extern char rf_header_save[44];
333+extern char rf_header_save[44];
334+extern char voice_save[9];
326335
327336 extern unsigned char NullVoice[12];
328337 extern unsigned char NullVoice1[12];
--- a/from_node.c
+++ b/from_node.c
@@ -183,12 +183,15 @@ int voice_read_from_node()
183183 }
184184 if (gps_wait)
185185 {
186- if (!memcmp (&node_voice_save[12], NullVoice, 12)
187- || !memcmp (&node_voice_save[12], gps_only_1, 12))
186+ if (gps_skip_sw)
188187 {
189- gps_only = TRUE;
190- voice_pnt = 12;
191- goto loop_end;;
188+ if (!memcmp (&node_voice_save[12], NullVoice, 12)
189+ || !memcmp (&node_voice_save[12], gps_only_1, 12))
190+ {
191+ gps_only = TRUE;
192+ voice_pnt = 12;
193+ goto loop_end;;
194+ }
192195 }
193196 gw_on = FALSE;
194197 if (!inet_send_buff_set()) return len;
--- a/inet_read.c
+++ b/inet_read.c
@@ -85,9 +85,10 @@ void inet_read (void)
8585 syslog (LOG_ERR, "recvfrom error (inet_read) %s", strerror (errno));
8686 return;
8787 }
88-//syslog (LOG_DEBUG, "test length %d %4.4s", length, recvBuff);
88+syslog (LOG_DEBUG, "length:%d %s", length, inet_ntoa (in_addr.sin_addr));
8989 if (length == 24)
9090 {
91+ //time (&dest_keep_alive_send_time);
9192 dest_keep_alive_send_time = 0;
9293 dest_keep_alive_cnt = 0;
9394 return;
@@ -97,7 +98,7 @@ void inet_read (void)
9798 if (!memcmp (recvBuff, "HPCH", 4))
9899 {
99100 in_addr.sin_family = AF_INET;
100- in_addr.sin_port = htons(dest_inet_port);
101+ //in_addr.sin_port = htons(dest_inet_port); //debug test
101102 in_addr.sin_addr.s_addr = inet_addr(dest_address);
102103 if (in_addr.sin_addr.s_addr == 0xffffffff)
103104 {
--- a/init.c
+++ b/init.c
@@ -9,11 +9,13 @@ void init (void)
99 if (!scan_sw) syslog (LOG_INFO, "dmonitor start V%s (Compiled %s %s)\n", PACKAGE_VERSION, __DATE__, __TIME__);
1010 else fprintf (status_fd, "dmonitor start V%s (Compiled %s %s)\n", PACKAGE_VERSION, __DATE__, __TIME__);
1111 in_addr_sock = socket(AF_INET, SOCK_DGRAM, 0);
12- if (setsockopt (in_addr_sock, SOL_SOCKET, SO_REUSEADDR, (const char *)&yes, sizeof(yes)) < 0)
12+ #if 0 // for symmetric nat
13+ if (setsockopt (in_addr_sock, SOL_SOCKET, SO_REUSEADDR, (const char *)&yes, sizeof(yes)) < 0) // symmetric nat
1314 {
1415 syslog(LOG_ERR, "Monitor socket (setsockopt) error");
1516 if(scan_sw) fprintf (status_fd, "Monitor socket (setsockopt) error");
1617 }
18+ #endif
1719
1820 #if 0
1921 out_addr.sin_family = AF_INET;
--- a/main.c
+++ b/main.c
@@ -46,7 +46,8 @@ void lcd_write (void);
4646 void ntpdate(void);
4747 void dvap_reopen(void);
4848 void invalid_os (void);
49-
49+void send_synmetric_nat (void);
50+void get_hole_punch_server_addr (void);
5051
5152 time_t send_time;
5253 unsigned char *ppp;
@@ -148,6 +149,7 @@ os_ok:
148149 {
149150 rig_type = ICOM;
150151 lcd_type = NONE;
152+ gps_skip_sw = TRUE;
151153 }
152154 else
153155 {
@@ -163,6 +165,13 @@ os_ok:
163165 else if (!memcmp (recvBuff, "G20x4", 5)) lcd_type = LCD_20x4;
164166 else if (!memcmp (recvBuff, "G16x2", 5)) lcd_type = LCD_16x2;
165167 }
168+ fgets (recvBuff, sizeof (recvBuff), dmonitor_file); // callsign skip
169+ if (fgets (recvBuff, sizeof (recvBuff), dmonitor_file))
170+ {
171+ if (!memcmp (recvBuff, "SKIP", 4)) gps_skip_sw = TRUE;
172+ else
173+ gps_skip_sw = FALSE;
174+ }
166175 }
167176 fclose (dmonitor_file);
168177 }
@@ -348,13 +357,14 @@ os_ok:
348357 else if (rig_type == NODE) node_conf();
349358 dvap_first_voice_pkt = FALSE;
350359
360+ get_hole_punch_server_addr();
351361 for (k = 0 ; k < 2 ; k++)
352362 {
353363 send_keep_alive();
354364 usleep (10000);
355365 }
356366
357- dest_keep_alive_cnt= 0;
367+ dest_keep_alive_cnt = 0;
358368 memset (short_msg, 0x20, 20);
359369 memset (used_call, 0x20, 8);
360370 memset (used_call2, 0x20, 4);
@@ -439,7 +449,7 @@ top:
439449 if (hole_punch_send_cnt < 3) send_dest_keep_alive();
440450 else alt_send_dest_keep_alive();
441451 #else
442- send_dest_keep_alive();
452+ send_keep_alive();
443453 #endif
444454 }
445455 if (dest_keep_alive_send_time)
@@ -447,7 +457,8 @@ top:
447457 if ((cur_time - dest_keep_alive_send_time) >= KEEP_ALIVE_INTERVAL)
448458 {
449459 dest_keep_alive_cnt++;
450- if (dest_keep_alive_cnt >= 10)
460+syslog (LOG_DEBUG, "dest_keep_alive_send_time:%d", dest_keep_alive_send_time);
461+ if (dest_keep_alive_cnt >= (60 / KEEP_ALIVE_INTERVAL))
451462 {
452463 sprintf (msg_temp, "RPT DOWN %8.8s ", area_call);
453464 memcpy (mycall2, "DOWN", 4);
@@ -463,7 +474,7 @@ top:
463474 }
464475 break;
465476 }
466- send_keep_alive();
477+ send_dest_keep_alive();
467478 }
468479 }
469480 if(rig_send_sw)
@@ -472,15 +483,12 @@ top:
472483 timeradd (&rig_send_time, &rig_send_time_20mSec, &temp_time);
473484 if (timercmp (&c_time, &temp_time, >=))
474485 {
475- if (send_rig())
486+ rig_send_time.tv_sec = temp_time.tv_sec;
487+ rig_send_time.tv_usec = temp_time.tv_usec;
488+ if (!send_rig())
476489 {
477- rig_send_time.tv_sec = temp_time.tv_sec;
478- rig_send_time.tv_usec = temp_time.tv_usec;
479- }
480- else
481- {
482- syslog (LOG_INFO, "Empty of the jitter buffer");
483490 send_drop_packet();
491+ syslog (LOG_INFO, "Empty of the jitter buffer");
484492 //LastFrameSend();
485493 }
486494 }
@@ -494,14 +502,16 @@ top:
494502 if (timercmp (&c_time, &temp_time, >))
495503 {
496504 syslog (LOG_INFO, "%19.19s:%03ld", ctime(&c_time.tv_sec), c_time.tv_usec/1000);
497- syslog (LOG_INFO, "%19.19s:%03ld", ctime(&inet_recv_timeout.tv_sec), inet_recv_timeout.tv_usec/1000);
505+ syslog (LOG_INFO, "%19.19s:%03ld", ctime(&temp_time.tv_sec), temp_time.tv_usec/1000);
498506 syslog (LOG_INFO, "insert dummy_last_frame (main)");
499507 dummy_last_frame();
500508 //#ifdef _SPECIFICATION_CHECK
501509 timersub (&c_time, &inet_recv_time, &temp_time);
502510 syslog (LOG_INFO, "long interval %ld.%03ld Sec.", temp_time.tv_sec, temp_time.tv_usec/1000);
503511 //#endif
504- gettimeofday (&inet_recv_time, NULL);
512+ //gettimeofday (&inet_recv_time, NULL);
513+ inet_recv_time.tv_sec = temp_time.tv_sec;
514+ inet_recv_time.tv_usec = temp_time.tv_usec;
505515 }
506516 }
507517 }
--- a/repeater_mon.c
+++ b/repeater_mon.c
@@ -212,7 +212,7 @@ void prase (char str[])
212212 col = 0;
213213 }
214214 area_save = area;
215- fprintf (html_fd, "<a name=\"area%c\"></a>%cエリア<br>\n", area, area);
215+ fprintf (html_fd, "<a id=\"area%c\">%cエリア</a><br>\n", area, area);
216216 fprintf (html_fd, "<table border=\"1\" style=\"font-size:0.9em;\">\n");
217217 }
218218 if ((col % COL) == 0) fprintf (html_fd, "<tr>");
@@ -565,7 +565,7 @@ os_ok:
565565 fprintf (html_fd, "}\n");
566566 fprintf (html_fd, "return(\"\");\n");
567567 fprintf (html_fd, "}\n");
568- fprintf (html_fd, "function setCookie(key, val, tmp) {\n");
568+ fprintf (html_fd, "function setCookie(key, val) {\n");
569569 fprintf (html_fd, "tmp = key + \"=\" + escape(val) + \"; \";\n");
570570 fprintf (html_fd, "tmp += \"expires=Tue, 31-Dec-2030 23:59:59; \";\n");
571571 fprintf (html_fd, "document.cookie = tmp;\n");
--- a/rig_read.c
+++ b/rig_read.c
@@ -518,11 +518,14 @@ int rig_read (void)
518518 if (gps_wait)
519519 {
520520 gps_wait = FALSE;
521- if (!memcmp (&rig_buff[4], NullVoice, 12)
522- || !memcmp (&rig_buff[4], gps_only_1, 12))
521+ if (gps_skip_sw)
523522 {
524- gps_only = TRUE;
525- goto voice_skip;
523+ if (!memcmp (&rig_buff[4], NullVoice, 12)
524+ || !memcmp (&rig_buff[4], gps_only_1, 12))
525+ {
526+ gps_only = TRUE;
527+ goto voice_skip;
528+ }
526529 }
527530 inet_send_buff[16] = 0x80;
528531 //memcpy (&inet_send_buff[17], &rig_buff[2], 41);
@@ -655,6 +658,7 @@ void rig_write (int length, unsigned char buff[])
655658 {
656659 int ret;
657660 unsigned char temp[8];
661+ struct timeval check_time;
658662
659663 if (length == 17)
660664 {
@@ -695,8 +699,10 @@ void rig_write (int length, unsigned char buff[])
695699 #ifdef _DEBUG_RIG_WRITE_PACKET
696700 if (length == 17)
697701 {
698- syslog (LOG_DEBUG,
699- "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %d %d",
702+ gettimeofday (&check_time, NULL);
703+ syslog (LOG_DEBUG,
704+ "%03ld %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %d %d",
705+ check_time.tv_usec/1000,
700706 buff[0], buff[1], buff[2], buff[3], buff[4], buff[5], buff[6], buff[7], buff[8], buff[9], buff[10],
701707 buff[11], buff[12], buff[13], buff[14], buff[15], buff[16], fifo_hold_limit, Fifo_cnt);
702708 }
--- a/rpt_conn.c
+++ b/rpt_conn.c
@@ -333,6 +333,6 @@ end:
333333 if (udev) node_close();
334334 closelog();
335335 remove (PID_FILE);
336- usleep (500000);
336+ usleep (1000000);
337337 }
338338