Some checks failed
Go Build Multi-Platform / build (amd64, darwin) (push) Failing after 12s
Go Build Multi-Platform / build (amd64, freebsd) (push) Successful in 51s
Go Build Multi-Platform / build (amd64, linux) (push) Successful in 49s
Go Build Multi-Platform / build (arm, freebsd) (push) Successful in 49s
Go Build Multi-Platform / build (amd64, windows) (push) Successful in 57s
Go Build Multi-Platform / build (arm, windows) (push) Failing after 19s
Go Build Multi-Platform / build (arm, linux) (push) Failing after 21s
Go Build Multi-Platform / build (arm64, darwin) (push) Successful in 44s
Go Build Multi-Platform / build (arm64, freebsd) (push) Successful in 48s
Go Build Multi-Platform / build (arm64, linux) (push) Successful in 47s
Go Build Multi-Platform / build (arm64, windows) (push) Successful in 46s
Run Gosec / tests (push) Successful in 45s
Go Build Multi-Platform / Create Release (push) Has been skipped
Go Revive Lint / lint (push) Successful in 9m48s
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (push) Successful in 19m13s
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (push) Successful in 19m19s
98 lines
1.7 KiB
Go
98 lines
1.7 KiB
Go
package common
|
|
|
|
const (
|
|
// Interface Types
|
|
IF_TYPE_NONE InterfaceType = iota
|
|
IF_TYPE_UDP
|
|
IF_TYPE_TCP
|
|
IF_TYPE_UNIX
|
|
IF_TYPE_I2P
|
|
IF_TYPE_BLUETOOTH
|
|
IF_TYPE_SERIAL
|
|
IF_TYPE_AUTO
|
|
|
|
// Interface Modes
|
|
IF_MODE_FULL InterfaceMode = iota
|
|
IF_MODE_POINT
|
|
IF_MODE_GATEWAY
|
|
IF_MODE_ACCESS_POINT
|
|
IF_MODE_ROAMING
|
|
IF_MODE_BOUNDARY
|
|
|
|
// Transport Modes
|
|
TRANSPORT_MODE_DIRECT TransportMode = iota
|
|
TRANSPORT_MODE_RELAY
|
|
TRANSPORT_MODE_GATEWAY
|
|
|
|
// Path Status
|
|
PATH_STATUS_UNKNOWN PathStatus = iota
|
|
PATH_STATUS_DIRECT
|
|
PATH_STATUS_RELAY
|
|
PATH_STATUS_FAILED
|
|
|
|
// Resource Status
|
|
RESOURCE_STATUS_PENDING = 0x00
|
|
RESOURCE_STATUS_ACTIVE = 0x01
|
|
RESOURCE_STATUS_COMPLETE = 0x02
|
|
RESOURCE_STATUS_FAILED = 0x03
|
|
RESOURCE_STATUS_CANCELLED = 0x04
|
|
|
|
// Link Status
|
|
LINK_STATUS_PENDING = 0x00
|
|
LINK_STATUS_ACTIVE = 0x01
|
|
LINK_STATUS_CLOSED = 0x02
|
|
LINK_STATUS_FAILED = 0x03
|
|
|
|
// Direction Constants
|
|
IN = 0x01
|
|
OUT = 0x02
|
|
|
|
// Common Constants
|
|
DEFAULT_MTU = 1500
|
|
MAX_PACKET_SIZE = 65535
|
|
BITRATE_MINIMUM = 5
|
|
|
|
// Timeouts and Intervals
|
|
ESTABLISH_TIMEOUT = 6
|
|
KEEPALIVE_INTERVAL = 360
|
|
STALE_TIME = 720
|
|
PATH_REQUEST_TTL = 300
|
|
ANNOUNCE_TIMEOUT = 15
|
|
|
|
// Common Numeric Constants
|
|
ZERO = 0
|
|
ONE = 1
|
|
TWO = 2
|
|
THREE = 3
|
|
FOUR = 4
|
|
FIVE = 5
|
|
SIX = 6
|
|
SEVEN = 7
|
|
EIGHT = 8
|
|
FIFTEEN = 15
|
|
|
|
// Common Size Constants
|
|
SIZE_16 = 16
|
|
SIZE_32 = 32
|
|
SIZE_64 = 64
|
|
SIXTY_SEVEN = 67
|
|
|
|
// Common Hex Constants
|
|
HEX_0x03 = 0x03
|
|
HEX_0xFF = 0xFF
|
|
|
|
// Common Float Constants
|
|
FLOAT_ZERO = 0.0
|
|
FLOAT_0_001 = 0.001
|
|
FLOAT_0_025 = 0.025
|
|
FLOAT_0_1 = 0.1
|
|
FLOAT_1_75 = 1.75
|
|
FLOAT_5_0 = 5.0
|
|
FLOAT_1E9 = 1e9
|
|
|
|
// Common String Constants
|
|
STR_LINK_ID = "link_id"
|
|
STR_BYTES = "bytes"
|
|
STR_FMT_HEX = "0x%02x"
|
|
)
|