@@ -105,8 +105,10 @@ pub struct Sniffer {
105105 pub newer_release_available : Option < bool > ,
106106 /// Network device to be analyzed, or PCAP file to be imported
107107 pub capture_source : CaptureSource ,
108- /// Signals if a pcap error occurred
109- pub pcap_error : Option < String > ,
108+ /// Signals if the capture backend reported a problem; empty when the problem
109+ /// is the IPFIX collector rejecting datagrams, whose text the waiting page
110+ /// supplies itself so that it follows a language change
111+ pub capture_error : Option < String > ,
110112 /// Messages status
111113 pub dots_pulse : ( String , u8 ) ,
112114 /// Traffic chart displayed in the Overview page
@@ -170,7 +172,7 @@ impl Sniffer {
170172 logged_notifications : LoggedNotifications :: default ( ) ,
171173 newer_release_available : None ,
172174 capture_source,
173- pcap_error : None ,
175+ capture_error : None ,
174176 dots_pulse : ( "." . to_string ( ) , 0 ) ,
175177 traffic_chart : TrafficChart :: new ( style, language, data_repr) ,
176178 preview_charts,
@@ -363,6 +365,7 @@ impl Sniffer {
363365 Message :: SetIpfixPort ( port) => self . set_ipfix_port ( port) ,
364366 Message :: PendingHosts ( cap_id, host_msgs) => self . pending_hosts ( cap_id, host_msgs) ,
365367 Message :: OfflineGap ( cap_id, gap) => self . offline_gap ( cap_id, gap) ,
368+ Message :: IpfixRejection ( cap_id) => self . ipfix_rejection ( cap_id) ,
366369 Message :: Periodic => self . periodic ( ) ,
367370 Message :: ExpandNotification ( id, expand) => self . expand_notification ( id, expand) ,
368371 Message :: ToggleRemoteNotifications => self . toggle_remote_notifications ( ) ,
@@ -858,6 +861,13 @@ impl Sniffer {
858861 }
859862 }
860863
864+ fn ipfix_rejection ( & mut self , cap_id : usize ) {
865+ if cap_id == self . current_capture_rx . 0 {
866+ // the correct translated error is displayed in waiting_page
867+ self . capture_error = Some ( String :: new ( ) ) ;
868+ }
869+ }
870+
861871 fn periodic ( & mut self ) {
862872 self . update_waiting_dots ( ) ;
863873 self . capture_source . set_addresses ( ) ;
@@ -1007,7 +1017,7 @@ impl Sniffer {
10071017 let pcap_path = self . conf . export_pcap . full_path ( ) ;
10081018 let capture_context =
10091019 CaptureContext :: new ( & self . capture_source , pcap_path. as_ref ( ) , & self . conf . filters ) ;
1010- self . pcap_error = capture_context. error ( ) . map ( ToString :: to_string) ;
1020+ self . capture_error = capture_context. error ( ) . map ( ToString :: to_string) ;
10111021 self . running_page = Some ( self . conf . last_opened_page ) ;
10121022
10131023 if capture_context. error ( ) . is_none ( ) {
@@ -1077,6 +1087,9 @@ impl Sniffer {
10771087 BackendTrafficMessage :: OfflineGap ( cap_id, gap) => {
10781088 Message :: OfflineGap ( cap_id, gap)
10791089 }
1090+ BackendTrafficMessage :: IpfixRejection ( cap_id) => {
1091+ Message :: IpfixRejection ( cap_id)
1092+ }
10801093 } ) ;
10811094 }
10821095 }
@@ -1097,7 +1110,7 @@ impl Sniffer {
10971110 self . addresses_resolved = HashMap :: new ( ) ;
10981111 self . latency_statuses = HashMap :: new ( ) ;
10991112 self . logged_notifications = LoggedNotifications :: default ( ) ;
1100- self . pcap_error = None ;
1113+ self . capture_error = None ;
11011114 self . traffic_chart = TrafficChart :: new ( style, language, self . conf . data_repr ) ;
11021115 self . modal = None ;
11031116 self . settings_page = None ;
0 commit comments