@@ -25,6 +25,7 @@ pub enum ReportCol {
2525 DstPort ,
2626 Proto ,
2727 Service ,
28+ Process ,
2829 Bytes ,
2930 Packets ,
3031}
@@ -37,8 +38,9 @@ impl ReportCol {
3738 ReportCol :: DstPort ,
3839 ReportCol :: Proto ,
3940 ReportCol :: Service ,
41+ ReportCol :: Process ,
4042 ReportCol :: Bytes ,
41- ReportCol :: Packets ,
43+ // ReportCol::Packets,
4244 ] ;
4345
4446 pub ( crate ) const FILTER_COLUMNS_WIDTH : f32 = 4.0 * SMALL_COL_WIDTH + 2.0 * LARGE_COL_WIDTH ;
@@ -49,6 +51,7 @@ impl ReportCol {
4951 ReportCol :: SrcPort | ReportCol :: DstPort => port_translation ( language) . to_string ( ) ,
5052 ReportCol :: Proto => protocol_translation ( language) . to_string ( ) ,
5153 ReportCol :: Service => service_translation ( language) . to_string ( ) ,
54+ ReportCol :: Process => "Process" . to_string ( ) ,
5255 ReportCol :: Bytes => {
5356 let mut str = bytes_translation ( language) . to_string ( ) ;
5457 str. remove ( 0 ) . to_uppercase ( ) . to_string ( ) + & str
@@ -92,14 +95,15 @@ impl ReportCol {
9295 }
9396 ReportCol :: Proto => key. protocol . to_string ( ) ,
9497 ReportCol :: Service => val. service . to_string ( ) ,
98+ ReportCol :: Process => val. process . clone ( ) ,
9599 ReportCol :: Bytes => ByteMultiple :: formatted_string ( val. transmitted_bytes ) ,
96100 ReportCol :: Packets => val. transmitted_packets . to_string ( ) ,
97101 }
98102 }
99103
100104 pub ( crate ) fn get_width ( & self ) -> f32 {
101105 match self {
102- ReportCol :: SrcIp | ReportCol :: DstIp => LARGE_COL_WIDTH ,
106+ ReportCol :: SrcIp | ReportCol :: DstIp | ReportCol :: Process => LARGE_COL_WIDTH ,
103107 _ => SMALL_COL_WIDTH ,
104108 }
105109 }
@@ -113,7 +117,9 @@ impl ReportCol {
113117 1
114118 } ;
115119 match self {
116- ReportCol :: SrcIp | ReportCol :: DstIp => LARGE_COL_MAX_CHARS / reduction_factor,
120+ ReportCol :: SrcIp | ReportCol :: DstIp | ReportCol :: Process => {
121+ LARGE_COL_MAX_CHARS / reduction_factor
122+ }
117123 _ => SMALL_COL_MAX_CHARS / reduction_factor,
118124 }
119125 }
@@ -126,6 +132,7 @@ impl ReportCol {
126132 ReportCol :: DstPort => FilterInputType :: PortDst ,
127133 ReportCol :: Proto => FilterInputType :: Proto ,
128134 ReportCol :: Service => FilterInputType :: Service ,
135+ ReportCol :: Process => FilterInputType :: Process ,
129136 ReportCol :: Bytes | ReportCol :: Packets => FilterInputType :: Country , // just to not panic...
130137 }
131138 }
0 commit comments