Documentation ¶
Index ¶
Constants ¶
const ( TransportTCP = uint8(iota) TransportUDP TransportICMP )
const ( Networkv4 = uint8(iota) Networkv6 )
const ( GetRoutesReqCmd = "GetRoutesReq" EstablishConnectionCmd = "EstablishConnection" )
Commands for communication within the VPN protocol.
const (
ApplicationOK = quic.ApplicationErrorCode(0x0)
)
Constants representing QUIC application error codes.
const (
Name = "raido"
)
Constants representing the VPN name and transport protocols (TCP, UDP, ICMP).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectResponse ¶
type ConnectResponse struct {
Established bool
}
ConnectResponse indicates whether a connection was successfully established.
type Decoder ¶
type Decoder[T any] struct { // contains filtered or unexported fields }
Decoder wraps the gob decoder for a specific type.
func NewDecoder ¶
func NewDecoder[T any](rd io.ReadCloser) Decoder[T]
NewDecoder initializes a new Decoder for type T.
type Encoder ¶
type Encoder[T any] struct { // contains filtered or unexported fields }
Encoder wraps the gob encoder for a specific type.
func NewEncoder ¶
func NewEncoder[T any](wr io.WriteCloser) Encoder[T]
NewEncoder initializes a new Encoder for type T.
type GetRoutesResp ¶
GetRoutesResp holds the name and list of routes for the VPN.
type IPAddressWithPortProtocol ¶
type IPAddressWithPortProtocol struct { IP net.IP // Can hold both IPv4 (4 bytes) or IPv6 (16 bytes) Port uint16 // 16 bits for the port Protocol uint8 // 2 bits for protocol (TCP, UDP, ICMP) Network uint8 // 2 bits for network version (v4 or v6) }
IPAddressWithPortProtocol holds IP, port, protocol, and network information for both IPv4 and IPv6.
func Decode ¶
func Decode(encoded []byte) (*IPAddressWithPortProtocol, error)
Decode decodes the byte slice back into the IPAddressWithPortProtocol structure.
func (*IPAddressWithPortProtocol) Encode ¶
func (ipStruct *IPAddressWithPortProtocol) Encode() ([]byte, error)
Encode encodes the structure into a byte slice that contains all the necessary information.