@@ -17,7 +17,7 @@ use std::net::IpAddr;
1717/// Represents a single, atomic connection attempt.
1818///
1919/// This is the pixel of the scan. Scanners (TCP, SYN, UDP) ingest these
20- /// objects to perform individual probes .
20+ /// objects to perform individual targets .
2121#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
2222pub struct Target {
2323 pub ip : IpAddr ,
@@ -27,7 +27,7 @@ pub struct Target {
2727
2828/// A blueprint pairing a set of IP addresses with a set of ports.
2929///
30- /// `TargetSet` does not store individual probes in memory; instead, it
30+ /// `TargetSet` does not store individual targets in memory; instead, it
3131/// defines the boundaries of a Scan Area. This allows Zond to handle
3232/// massive ranges without significant RAM overhead.
3333#[ derive( Debug , Clone , Default ) ]
@@ -42,10 +42,10 @@ impl TargetSet {
4242 Self { ips, ports }
4343 }
4444
45- /// Returns the total number of probes defined by this set.
45+ /// Returns the total number of targets defined by this set.
4646 ///
4747 /// Calculated as (Number of IPs) × (Number of Ports).
48- pub fn total_probes ( & self ) -> u128 {
48+ pub fn total_targets ( & self ) -> u128 {
4949 ( self . ips . len ( ) * ( self . ports . len ( ) ) as u64 ) as u128
5050 }
5151
@@ -83,7 +83,7 @@ impl TargetMap {
8383
8484 /// Returns the total targets across all defined units.
8585 pub fn total_targets ( & self ) -> u128 {
86- self . units . iter ( ) . map ( |u| u. total_probes ( ) ) . sum ( )
86+ self . units . iter ( ) . map ( |u| u. total_targets ( ) ) . sum ( )
8787 }
8888
8989 /// Returns the total number of unique IP addresses targeted.
@@ -111,12 +111,10 @@ mod tests {
111111 use super :: * ;
112112 use crate :: models:: port:: Protocol ;
113113
114- // Helper to build a simple IpSet from a string
115114 fn mock_ip_set ( input : & str ) -> IpSet {
116115 IpSet :: try_from ( input) . expect ( "Valid IP input for tests" )
117116 }
118117
119- // Helper to build a simple PortSet from a string
120118 fn mock_port_set ( input : & str ) -> PortSet {
121119 PortSet :: try_from ( input) . expect ( "Valid Port input for tests" )
122120 }
@@ -127,7 +125,7 @@ mod tests {
127125 let ports = mock_port_set ( "80, 443, 1000-1007" ) ; // 10 Ports
128126 let ts = TargetSet :: new ( ips, ports) ;
129127
130- assert_eq ! ( ts. total_probes ( ) , 2560 ) ;
128+ assert_eq ! ( ts. total_targets ( ) , 2560 ) ;
131129 }
132130
133131 #[ test]
@@ -158,13 +156,13 @@ mod tests {
158156 fn test_target_map_aggregation ( ) {
159157 let mut map = TargetMap :: new ( ) ;
160158
161- // Unit 1: 5 IPs, 2 Ports = 10 Probes
159+ // Unit 1: 5 IPs, 2 Ports = 10 targets
162160 map. add_unit ( TargetSet :: new (
163161 mock_ip_set ( "10.0.0.1-10.0.0.5" ) ,
164162 mock_port_set ( "80, 443" ) ,
165163 ) ) ;
166164
167- // Unit 2: 1 IP, 5 Ports = 5 Probes
165+ // Unit 2: 1 IP, 5 Ports = 5 targets
168166 map. add_unit ( TargetSet :: new (
169167 mock_ip_set ( "1.1.1.1" ) ,
170168 mock_port_set ( "22, 80, 443, 8080, 8443" ) ,
@@ -181,7 +179,7 @@ mod tests {
181179 assert ! ( map. is_empty( ) ) ;
182180
183181 let ts_empty = TargetSet :: new ( mock_ip_set ( "" ) , mock_port_set ( "" ) ) ;
184- assert_eq ! ( ts_empty. total_probes ( ) , 0 ) ;
182+ assert_eq ! ( ts_empty. total_targets ( ) , 0 ) ;
185183 }
186184
187185 #[ test]
0 commit comments