MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _wg_endpoint

Function _wg_endpoint

network_diagnostics.py:621–632  ·  view source on GitHub ↗

WireGuard peer endpoint (the VPN server's IP:port), if `wg` is available.

(name)

Source from the content-addressed store, hash-verified

619 return str(v).strip().lower() in ('yes', 'true', '1', 'on', 'enabled')
620
621 device_type = val('device-type') or val('device_type')
622 enabled = val('enabled')
623 supported = val('supported')
624 ptype = val('power-type') or val('power_type')
625 class_str = val('class')
626 class_num = _poe_class_num(class_str)
627 poe_type, standard = _poe_standard(ptype, class_num)
628 allocated_w = _poe_watts(power.get('allocated') if isinstance(power.get('allocated'), (str, int)) else _scalar(power.get('allocated')))
629 requested_w = _poe_watts(power.get('requested') if isinstance(power.get('requested'), (str, int)) else _scalar(power.get('requested')))
630 # The switch port is a PSE (Power Sourcing Equipment) and power is enabled
631 # => it is delivering, or ready to deliver, PoE to us.
632 powered = bool(device_type and device_type.upper() == 'PSE' and truthy(enabled))
633
634 # Active vs passive: an LLDP Power-via-MDI TLV means the PSE does 802.3
635 # detection/classification handshaking, i.e. ACTIVE (standards) PoE. Passive

Callers 1

_iface_vpn_infoFunction · 0.85

Calls 2

_haveFunction · 0.85
_runFunction · 0.85

Tested by

no test coverage detected