Documentation ¶
Index ¶
- func AddListener(src string, conn *ipv4.PacketConn)
- func RemoveListener(src string)
- type CertPair
- type ConnectionState
- type State
- func (s *State) Close()
- func (s *State) DoHandshake(local, remote string)
- func (s *State) Fingerprint() string
- func (s *State) GetCertPair() *CertPair
- func (s *State) HandleDTLSPacket(packet []byte, local, remote string) ([]byte, error)
- func (s *State) Send(packet []byte, local, remote string) (bool, error)
- func (s *State) Start(isOffer bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddListener ¶
func AddListener(src string, conn *ipv4.PacketConn)
AddListener adds the socket to a map that can be accessed by OpenSSL for sending This only needed until DTLS is rewritten in native Go
func RemoveListener ¶
func RemoveListener(src string)
RemoveListener removes the socket from a map that can be accessed by OpenSSL for sending This only needed until DTLS is rewritten in native Go
Types ¶
type ConnectionState ¶
type ConnectionState uint8
ConnectionState determines the DTLS connection state
const ( New ConnectionState = iota + 1 Established )
ConnectionState enums
func (ConnectionState) String ¶
func (a ConnectionState) String() string
type State ¶
State represents all the state needed for a DTLS session
func NewState ¶
func NewState(notifier func(ConnectionState)) (s *State, err error)
NewState creates a new DTLS session
func (*State) DoHandshake ¶
DoHandshake sends the DTLS handshake it the remote peer
func (*State) Fingerprint ¶
Fingerprint generates a SHA-256 fingerprint of the certificate
func (*State) GetCertPair ¶
GetCertPair gets the current CertPair if DTLS has finished
func (*State) HandleDTLSPacket ¶
HandleDTLSPacket checks if the packet is a DTLS packet, and if it is passes to the DTLS session If there is any data after decoding we pass back to the caller to handler