| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- package bridge
- // BridgeInstance represents a MikroTik-style /interface bridge
- type BridgeInstance struct {
- ID string `json:"id"`
- Name string `json:"name"` // e.g. "bridge1" or "bridge-lan"
- MTU int `json:"mtu"` // default 1500
- MACAddress string `json:"mac_address"` // Admin MAC or auto
- STP string `json:"stp"` // "rstp", "stp", "none"
- Priority int `json:"priority"` // STP bridge priority (default 32768 / 0x8000)
- VlanFiltering bool `json:"vlan_filtering"` // 802.1Q VLAN aware bridge
- PVID int `json:"pvid"` // default VLAN ID (1)
- FastForward bool `json:"fast_forward"` // bridge fastpath
- Comment string `json:"comment,omitempty"`
- Disabled bool `json:"disabled"`
- Running bool `json:"running"` // MikroTik 'R' flag
- PortsCount int `json:"ports_count"`
- IPAddresses []string `json:"ip_addresses,omitempty"`
- RxPackets uint64 `json:"rx_packets"`
- TxPackets uint64 `json:"tx_packets"`
- RxBytes uint64 `json:"rx_bytes"`
- TxBytes uint64 `json:"tx_bytes"`
- RxHuman string `json:"rx_human,omitempty"`
- TxHuman string `json:"tx_human,omitempty"`
- }
- // BridgePort represents a slave interface attached to a bridge (/interface bridge port)
- type BridgePort struct {
- ID string `json:"id"`
- Bridge string `json:"bridge"` // Parent bridge name, e.g. "bridge1"
- Interface string `json:"interface"` // e.g. "eth0", "Goldix", "eth0.10"
- PVID int `json:"pvid"` // Port VLAN ID (default 1)
- FrameTypes string `json:"frame_types"` // "admit-all", "admit-only-vlan-tagged", "admit-only-untagged-and-priority-tagged"
- IngressFiltering bool `json:"ingress_filtering"` // Drop frames with unexpected VLAN tags
- Priority int `json:"priority"` // STP port priority (default 128 / 0x80)
- PathCost int `json:"path_cost"` // STP port path cost (default 10)
- Horizon int `json:"horizon"` // Split-horizon domain (0=none, 1, 2...)
- Learn bool `json:"learn"` // MAC learning enabled (default true)
- Comment string `json:"comment,omitempty"`
- Disabled bool `json:"disabled"`
- Status string `json:"status"` // "forwarding", "learning", "blocking", "disabled"
- }
- // BridgeVLAN represents a VLAN entry in the bridge VLAN filtering table (/interface bridge vlan)
- type BridgeVLAN struct {
- ID string `json:"id"`
- Bridge string `json:"bridge"` // e.g. "bridge1"
- VlanIDs string `json:"vlan_ids"` // e.g. "10", "10,20,30", "10-20"
- Tagged []string `json:"tagged"` // Tagged member interfaces
- Untagged []string `json:"untagged"` // Untagged member interfaces
- Comment string `json:"comment,omitempty"`
- Disabled bool `json:"disabled"`
- CurrentTagged []string `json:"current_tagged,omitempty"`
- CurrentUntagged []string `json:"current_untagged,omitempty"`
- }
- // BridgeHost represents a learned or static MAC address in the FDB table (/interface bridge host)
- type BridgeHost struct {
- MAC string `json:"mac"`
- Interface string `json:"interface"` // Port learned on, or "local"
- Bridge string `json:"bridge"`
- VlanID int `json:"vlan_id"`
- Age float64 `json:"age"` // seconds
- Local bool `json:"local"`
- Static bool `json:"static"`
- Flags string `json:"flags"` // e.g. "D" (Dynamic), "S" (Static), "L" (Local)
- }
- // BridgeSummary provides count totals for navigation badges
- type BridgeSummary struct {
- BridgesCount int `json:"bridges_count"`
- PortsCount int `json:"ports_count"`
- VLANsCount int `json:"vlans_count"`
- HostsCount int `json:"hosts_count"`
- }
|