pub struct HuginnNet<'a> {
pub tcp_matcher: Option<SignatureMatcher<'a>>,
pub http_matcher: Option<SignatureMatcher<'a>>,
/* private fields */
}
Expand description
A multi-protocol passive fingerprinting library inspired by p0f
with JA4 TLS client fingerprinting.
The HuginnNet
struct acts as the core component of the library, handling TCP, HTTP, and TLS packet
analysis and matching signatures using a database of known fingerprints, plus JA4 TLS
client analysis following the official FoxIO specification.
Fields§
§tcp_matcher: Option<SignatureMatcher<'a>>
§http_matcher: Option<SignatureMatcher<'a>>
Implementations§
Source§impl<'a> HuginnNet<'a>
impl<'a> HuginnNet<'a>
Sourcepub fn new(
database: Option<&'a Database>,
max_connections: usize,
config: Option<AnalysisConfig>,
) -> Result<Self, HuginnNetError>
pub fn new( database: Option<&'a Database>, max_connections: usize, config: Option<AnalysisConfig>, ) -> Result<Self, HuginnNetError>
Creates a new instance of HuginnNet
.
§Parameters
database
: Optional reference to the database containing known TCP/Http signatures from p0f. Only loaded ifmatcher_enabled
is true and HTTP or TCP analysis is enabled. Not needed for TLS-only analysis or when fingerprint matching is disabled.max_connections
: The maximum number of connections to maintain in the connection tracker and HTTP flows.config
: Optional configuration specifying which protocols to analyze. If None, uses default (all enabled). Whenmatcher_enabled
is false, the database won’t be loaded and no signature matching will be performed.
§Returns
A new HuginnNet
instance initialized with the given database, max connections, and configuration.
§Errors
Returns HuginnNetError::MissConfiguration
if matcher_enabled
is true but no database is provided.
Sourcepub fn analyze_network(
&mut self,
interface_name: &str,
sender: Sender<FingerprintResult>,
cancel_signal: Option<Arc<AtomicBool>>,
) -> Result<(), Box<dyn Error>>
pub fn analyze_network( &mut self, interface_name: &str, sender: Sender<FingerprintResult>, cancel_signal: Option<Arc<AtomicBool>>, ) -> Result<(), Box<dyn Error>>
Captures and analyzes packets on the specified network interface.
Sends FingerprintResult
through the provided channel.
§Parameters
interface_name
: The name of the network interface to analyze.sender
: ASender
to sendFingerprintResult
objects back to the caller.cancel_signal
: OptionalArc<AtomicBool>
to signal graceful shutdown.
§Errors
- If the network interface cannot be found or a channel cannot be created.
Sourcepub fn analyze_pcap(
&mut self,
pcap_path: &str,
sender: Sender<FingerprintResult>,
cancel_signal: Option<Arc<AtomicBool>>,
) -> Result<(), Box<dyn Error>>
pub fn analyze_pcap( &mut self, pcap_path: &str, sender: Sender<FingerprintResult>, cancel_signal: Option<Arc<AtomicBool>>, ) -> Result<(), Box<dyn Error>>
Sourcepub fn analyze_tcp(&mut self, packet: &[u8]) -> FingerprintResult
pub fn analyze_tcp(&mut self, packet: &[u8]) -> FingerprintResult
Auto Trait Implementations§
impl<'a> Freeze for HuginnNet<'a>
impl<'a> !RefUnwindSafe for HuginnNet<'a>
impl<'a> !Send for HuginnNet<'a>
impl<'a> !Sync for HuginnNet<'a>
impl<'a> Unpin for HuginnNet<'a>
impl<'a> !UnwindSafe for HuginnNet<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more