Rust ClamAV Client
A simple ClamAV client to stream files to clamd for antivirus scanning.
Please note: The functions ping_socket
and scan_socket
are only available on Unix platforms.
Installation
Add this to your Cargo.toml
:
[]
= "0.1.3"
Usage
Ensure ClamD is running by pinging the server for a response:
let clamd_host_address = "localhost:3310";
let clamd_available = match ping_tcp ;
if !clamd_available
Scan a file for detections:
let file_path = "virus.txt";
let scan_response = scan_tcp.unwrap;
let file_clean = clean.unwrap;
if file_clean else
Scan a buffer from memory:
let buffer = "X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"
.bytes
.;
let scan_response = scan_buffer_tcp.unwrap;
let file_clean = clean.unwrap;
assert!;