Skip to main content

unifly_api/model/
supporting.rs

1// ── Supporting / auxiliary domain types ──
2//
3// VPN, WAN, traffic matching, RADIUS, device tags, and other
4// resources that don't warrant their own module.
5
6use serde::{Deserialize, Serialize};
7use std::net::IpAddr;
8
9use super::common::EntityOrigin;
10use super::entity_id::EntityId;
11
12#[derive(Debug, Clone, Serialize, Deserialize)]
13pub struct VpnServer {
14    pub id: EntityId,
15    pub name: Option<String>,
16    /// Server type: OPENVPN, WIREGUARD, L2TP, PPTP, UID
17    pub server_type: String,
18    pub enabled: Option<bool>,
19}
20
21#[derive(Debug, Clone, Serialize, Deserialize)]
22pub struct VpnTunnel {
23    pub id: EntityId,
24    pub name: Option<String>,
25    /// Tunnel type: OPENVPN, IPSEC, WIREGUARD
26    pub tunnel_type: String,
27    pub enabled: Option<bool>,
28}
29
30#[derive(Debug, Clone, Serialize, Deserialize)]
31pub struct WanInterface {
32    pub id: EntityId,
33    pub name: Option<String>,
34    pub ip: Option<IpAddr>,
35    pub gateway: Option<IpAddr>,
36    pub dns: Vec<IpAddr>,
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
40pub struct TrafficMatchingList {
41    pub id: EntityId,
42    pub name: String,
43    /// List type: PORTS, IPV4_ADDRESSES, IPV6_ADDRESSES
44    pub list_type: String,
45    pub items: Vec<String>,
46    pub origin: Option<EntityOrigin>,
47}
48
49#[derive(Debug, Clone, Serialize, Deserialize)]
50pub struct RadiusProfile {
51    pub id: EntityId,
52    pub name: String,
53}
54
55#[derive(Debug, Clone, Serialize, Deserialize)]
56pub struct DeviceTag {
57    pub id: EntityId,
58    pub name: String,
59}