Thu Jul 21, 2022 9:03 am
Actually, SwOS already has an API.
All we need is documentation for it (or reverse engineer it).
To wit:
URL: /link.b
The Authorization header uses a token to keep the session going.
The payload appears to be JSON (with a misleading text/plain MIME-type).
In that JSON payload I can already recognise:
en: Bitmask for all enabled ports. Disabled ports have a zero bit. Ports are numbered little endian style (i.e. bit zero = port 1).
fctc: Bitmask for flow-control TX. Ports are numbered the same as for en.
nm: Port names, normal array, ports are numbered normally.
fctr: Bitmask for flow-control RX. Same bitmask as other fields.
etc.
It's really easy to reverse engineer (which is a plus).
How about it, Mikrotik, and release the documentation for it?