Expand description
The Windows Firewall rules that let LAN peers reach AgentMux, and what to change to get from the rules a machine
has to those rules (docs/specs/SPEC_LAN_FIREWALL_SETUP_2026_10_01.md 4.1). Pure: it reads and writes nothing.
The elevated helper in the launcher reads the machine’s rules into Existing, asks plan what to do and
applies the answer; running it twice changes nothing the second time.
Structs§
Enums§
- Mode
- What the helper is asked to do.
- Op
- One change, in the order to make it.
- Settled
- How a run ended, once it has looked at the machine again.
Constants§
- CONFIGURE_
FLAG - The flag that starts the helper (
agentmux.exe --configure-lan-firewall): the launcher answers it, and the server runs it when the person asks for the setup. - EXIT_
CANCELLED - The administrator answered no to Windows’ prompt (
ERROR_CANCELLED). - EXIT_
FAILED - Anything else; the reason is on stderr.
- EXIT_
MANAGED - A policy decides the firewall’s rules: local rules are ignored, so nothing the helper does can help.
- EXIT_OK
- The helper’s exit codes, which is how it says how it went. The rules are as asked, or were already.
- EXIT_
UNVERIFIED - The rules are as asked, but some of the firewall’s rules could not be read, so it cannot be said that none of them blocks AgentMux (or, when removing, is one of ours). Not a success: the count is on stderr.
- PROFILES_
PRIVATE_ DOMAIN NET_FW_PROFILE2_DOMAIN | NET_FW_PROFILE2_PRIVATE. Public is never in these rules: a Public network is the person’s decision, one network at a time (spec 4.4).- PROTO_
TCP - IANA protocol numbers, which is how the firewall stores them.
- PROTO_
UDP - REMOTE_
LOCAL_ SUBNET - What the firewall calls “my own subnet”.
- SPECS
- The two port rules, in the order they are created.
- TCP_
PORTS lan::ports::LAN_PORT_RANGEas the firewall spells a range.- TCP_
RULE_ NAME - The inbound TCP rule: the fixed block LAN listeners and the viewer take their ports from.
- UDP_
PORTS - mDNS (5353), the desktop discovery port (29700) and the mobile responder (47891).
- UDP_
RULE_ NAME - The inbound UDP rule: mDNS, the desktop peer discovery and the mobile broadcast responder.
Functions§
- is_
agentmux_ program - Whether a rule path is one of our own binaries:
agentmux.exe,agentmux-srv-<version>-....exe, and so on. - plan
- What to change so that
existingis whatmodeasks for. Empty when nothing needs changing, which is how the helper knows to ask for no elevation. - settled
- What a run came to:
leftis the plan made from the machine as it is now,unreadablethe rules that could not be read.