2020-02-26 21:40:12 +01:00
|
|
|
package dsnet
|
|
|
|
|
2020-03-05 23:05:47 +01:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2020-02-26 21:40:12 +01:00
|
|
|
const (
|
2020-02-28 00:09:18 +01:00
|
|
|
// could be overridden in future via env
|
2020-03-04 00:32:07 +01:00
|
|
|
CONFIG_FILE = "/etc/dsnetconfig.json"
|
2020-02-28 00:09:18 +01:00
|
|
|
|
2020-02-27 23:31:44 +01:00
|
|
|
// these end up in the config file
|
|
|
|
DEFAULT_INTERFACE_NAME = "dsnet"
|
2020-03-04 00:32:07 +01:00
|
|
|
DEFAULT_REPORT_FILE = "/var/lib/dsnetreport.json"
|
2020-03-02 00:08:10 +01:00
|
|
|
DEFAULT_LISTEN_PORT = 51820
|
2020-02-27 23:31:44 +01:00
|
|
|
|
2020-03-04 00:32:56 +01:00
|
|
|
// keepalive always configured for everything. Set to a value likely to
|
|
|
|
// stop most NATs from dropping the connection.
|
2020-03-05 23:05:47 +01:00
|
|
|
KEEPALIVE = 21 * time.Second
|
|
|
|
// allow missing a single keepalive + margin. Received data resets timeout, too.
|
|
|
|
TIMEOUT = 50 * time.Second
|
2020-02-28 00:09:18 +01:00
|
|
|
|
|
|
|
// when is a peer considered gone forever? (could remove)
|
2020-03-02 00:08:10 +01:00
|
|
|
EXPIRY_DAYS = 28
|
2020-02-26 21:40:12 +01:00
|
|
|
)
|