The admin socket provides an interface to query and configure Yggdrasil during runtime. By default, Yggdrasil listens for admin connections on `localhost:9001`.
The `yggdrasilctl` utility provides a human-friendly CLI interface to the Yggdrasil admin socket. It can connect to both local and remote Yggdrasil instances, and accepts the same verbs as below. Every field is specified in the `field=value` format.
The Yggdrasil admin socket uses JSON for request and response formats.
A request must be:
- A complete JSON stanza
- Followed by a newline `\n` character
Once a valid request is received, the response stanza is returned.
### Request
The structure of a typical request is as below:
```
{
"request": "XXX",
"foo": "bar",
"baz": "qux"
}
```
A request:
- *Must* have a `"request"` (`string`) field - a value containing the verb of the request
- *Can* have a `"keepalive"` (`bool`) field - a `true` or `false` value stating whether the connection should be kept alive for further requests (if not specified, Yggdrasil will close the admin connection after returning a response)
- *Must* have any other required fields for the request
- *Can* have any other optional fields for the request
Returns exactly one record containing information about the current Yggdrasil node.
For the current IPv6 address:
-`coords` (`string`) contains the coordinates of the node on the spanning tree
#### `getSessions`
Expects no additional request fields.
Returns zero or more records containing information about open sessions between the current Yggdrasil node and other nodes. Open sessions indicate that traffic has been exchanged with the remote node recently.
For each IPv6 address:
-`bytes_sent` (`uint64`) contains the number of bytes sent across that session
-`bytes_recvd` (`uint64`) contains the number of bytes received across that session
-`coords` (`string`) contains the coordinates of the remote node on the spanning tree
-`mtu` (`uint8`) contains the negotiated session MTU between the local end and the remote end of the session
-`was_mtu_fixed` (`bool`) shows whether or not the MTU has been adjusted since the session was opened to compensate for read errors