@@ -689,38 +689,57 @@ void networkinfo(void) {
689689
690690 wipe_display ();
691691
692- if (lan_active )
692+ int n_nodes = 0 ;
693+
694+ if (lan_active ) {
693695 mvprintw (1 , 10 , "Network status: on Node: %c" , thisnode );
694- else
695- mvaddstr (1 , 10 , "Network status: off" );
696+ mvprintw (3 , 32 , "Total packets rcvd: %d | %d" , recv_packets , recv_error );
696697
697- mvprintw (3 , 22 , "Total packets rcvd: %d | %d" , recv_packets , recv_error );
698+ for (int i = 0 ; i < nodes ; i ++ ) {
699+ if (* bc_hostaddress [i ] == 0 ) {
700+ continue ;
701+ }
702+ GString * info = g_string_new (NULL );
703+ int column = 10 ;
704+ if (using_named_nodes ) {
705+ char * id = g_strdup_printf ("%c%c) " ,
706+ (i == thisnode - 'A' ? '*' : ' ' ),
707+ 'A' + i
708+ );
709+ g_string_append (info , id );
710+ g_free (id );
711+ column -= 4 ;
712+ }
713+ g_string_append (info , bc_hostaddress [i ]);
714+ if (bc_hostport [i ] > 0 ) {
715+ char * port = g_strdup_printf (":%d" , bc_hostport [i ]);
716+ g_string_append (info , port );
717+ g_free (port );
718+ }
719+ char * s = g_string_free (info , FALSE);
720+ mvaddstr (4 + n_nodes , column , s );
721+ g_free (s );
698722
699- for (int i = 0 ; i < nodes ; i ++ ) {
700- mvaddstr (4 + i , 10 , bc_hostaddress [i ]);
701- mvprintw (4 + i , 28 , "Packets sent: %d | %d " ,
702- send_packets [i ], send_error [i ]);
723+ mvprintw (4 + n_nodes , 38 , "Packets sent: %d | %d " ,
724+ send_packets [i ], send_error [i ]);
725+ ++ n_nodes ;
726+ }
727+ } else {
728+ mvaddstr (1 , 10 , "Network status: off" );
703729 }
704730
705- if (strlen (config_file ) > 0 )
706- mvprintw (6 + nodes , 10 , "Config file: %s" , config_file );
707- else
708- mvprintw (6 + nodes , 10 ,
709- "Config file: /usr/local/share/tlf/logcfg.dat" );//FIXME
710- mvprintw (7 + nodes , 10 , "Contest : %s" , whichcontest );
711- mvprintw (8 + nodes , 10 , "Logfile : %s" , logfile );
712-
713- mvprintw (9 + nodes , 10 , "Cluster : %s" , pr_hostaddress );
714- mvprintw (10 + nodes , 10 , "TNCport : %s" , tncportname );
715- mvprintw (11 + nodes , 10 , "RIGport : %s" , rigportname );
716- if (use_bandoutput == 1 )
717- mvaddstr (12 + nodes , 10 , "Band output: on" );
718- else
719- mvaddstr (12 + nodes , 10 , "Band output: off" );
731+ mvprintw (6 + n_nodes , 10 , "Config file: %s" , config_file );
732+ mvprintw (7 + n_nodes , 10 , "Contest : %s" , whichcontest );
733+ mvprintw (8 + n_nodes , 10 , "Logfile : %s" , logfile );
720734
721- mvprintw (13 + nodes , 10 , "callmaster : %s" ,
735+ mvprintw (9 + n_nodes , 10 , "Cluster : %s" , pr_hostaddress );
736+ mvprintw (10 + n_nodes , 10 , "TNCport : %s" , tncportname );
737+ mvprintw (11 + n_nodes , 10 , "RIGport : %s" , rigportname );
738+ mvprintw (12 + n_nodes , 10 , "Band output: %s" ,
739+ (use_bandoutput ? "on" : "off" ));
740+ mvprintw (13 + n_nodes , 10 , "callmaster : %s" ,
722741 (callmaster_version [0 ] != 0 ? callmaster_version : "n/a" ));
723- mvprintw (14 + nodes , 10 , "cty.dat : %s" ,
742+ mvprintw (14 + n_nodes , 10 , "cty.dat : %s" ,
724743 (cty_dat_version [0 ] != 0 ? cty_dat_version : "n/a" ));
725744
726745 refreshp ();
0 commit comments