zond_engine/core/models/
localhost.rs1use std::collections::HashSet;
17use std::net::IpAddr;
18
19#[derive(Debug, Clone)]
21pub struct IpServiceGroup {
22 pub ip_addr: IpAddr,
23 pub tcp_services: Vec<Service>,
24 pub udp_services: Vec<Service>,
25}
26
27impl IpServiceGroup {
28 pub fn new(ip_addr: IpAddr, tcp_services: Vec<Service>, udp_services: Vec<Service>) -> Self {
29 Self {
30 ip_addr,
31 tcp_services,
32 udp_services,
33 }
34 }
35}
36
37#[derive(Debug, Clone)]
38pub struct Service {
39 pub name: String,
40 pub local_addr: IpAddr,
41 pub local_ports: HashSet<u16>,
42}
43
44impl Service {
45 pub fn new(name: String, local_addr: IpAddr, local_ports: HashSet<u16>) -> Self {
46 Self {
47 name,
48 local_addr,
49 local_ports,
50 }
51 }
52}
53
54#[derive(Debug, Clone, PartialEq, Eq)]
55pub enum FirewallStatus {
56 Active,
57 Inactive,
58 NotDetected,
59}