• R/O
  • HTTP
  • SSH
  • HTTPS

multi_forward: Commit


Commit MetaInfo

Revisionac997ab42edd1c8fd39a0ca0cc3d8a9b128e1f38 (tree)
Zeit2019-11-02 10:50:21
AutorSatoshi Yasuda <yasuda@jk1z...>
CommiterSatoshi Yasuda

Log Message

modified: main.c
modified: multi_forward.h
modified: multi_forward_utils.c

Ändern Zusammenfassung

Diff

--- a/main.c
+++ b/main.c
@@ -110,6 +110,8 @@ int main(int argc, char** argv)
110110 multi_send_seq = 0;
111111 fwd_send_seq = 0;
112112
113+ memset (current_use_call, 0x20, 8);
114+
113115 while (1)
114116 {
115117 memcpy (&read_set, &read_save, sizeof(fd_set));
--- a/multi_forward.h
+++ b/multi_forward.h
@@ -212,3 +212,4 @@ char forward_buff_save[256];
212212 unsigned int multi_send_seq;
213213 unsigned int fwd_send_seq;
214214
215+char current_use_call[8];
--- a/multi_forward_utils.c
+++ b/multi_forward_utils.c
@@ -270,6 +270,7 @@ struct MultiConnectTable *multi_table_create(struct sockaddr_in multi_addr)
270270 MultiConnectTablePnt = next;
271271 return next;
272272 }
273+
273274 void read_hole_punch (char buff[], int length)
274275 {
275276 char ip_add[20];
@@ -360,6 +361,8 @@ void status_on (char call[], char ur_call[], char my_call[], char rpt1_call[], c
360361 int ret;
361362 time_t atime;
362363
364+ memcpy (current_use_call, my_call, 8);
365+ send_current_use_call (current_use_call);
363366 memset (&hints, 0x00, sizeof(struct addrinfo));
364367 hints.ai_family = AF_UNSPEC;
365368 hints.ai_socktype = SOCK_DGRAM;
@@ -415,6 +418,8 @@ void status_off (char call[])
415418 int ret;
416419 time_t atime;
417420
421+ memcpy (current_use_call, "なし ", 8);
422+ send_current_use_call (current_use_call);
418423 memset (&hints, 0x00, sizeof(struct addrinfo));
419424 hints.ai_family = AF_UNSPEC;
420425 hints.ai_socktype = SOCK_DGRAM;
@@ -829,6 +834,23 @@ void send_no_error_xmit (struct MultiConnectTable *pnt)
829834 (struct sockaddr *)&pnt->multi_addr, sizeof(struct sockaddr));
830835 }
831836
837+void send_current_use_call (char call[8])
838+{
839+ unsigned char buff[64];
840+ struct MultiConnectTable *pnt;
841+
842+ memcpy (buff, "MESSG", 5);
843+ memset (&buff[5], 0x00, 59);
844+ sprintf (&buff[5], "使用中の局 %8.8s", call);
845+ pnt = MultiConnectTablePnt;
846+ while (pnt)
847+ {
848+ sendto (multi_sd, buff, 64, 0,
849+ (struct sockaddr *)&pnt->multi_addr, sizeof(struct sockaddr));
850+ pnt = pnt->f_chain;
851+ }
852+}
853+
832854 void send_disconnect_hole_punch (void)
833855 {
834856 struct area_callsign *ar_temp;
Show on old repository browser