Documentation ¶
Index ¶
- Constants
- type Link
- func (l *Link) Accept(ip net.IP) bool
- func (l *Link) Close()
- func (l *Link) Decode(teatype uint8, b []byte) (db []byte)
- func (l *Link) DecodePreshared(additional uint16, b []byte) (db []byte)
- func (l *Link) Destroy()
- func (l *Link) Encode(teatype uint8, b []byte) (eb []byte)
- func (l *Link) EncodePreshared(additional uint16, b []byte) (eb []byte)
- func (l *Link) IsToMe(ip net.IP) bool
- func (l *Link) Read() *head.Packet
- func (l *Link) String() (n string)
- func (l *Link) WriteAndPut(p *head.Packet, istransfer bool) (n int, err error)
- type Me
- func (m *Me) AddPeer(cfg *PeerConfig) (l *Link)
- func (m *Me) Close() error
- func (m *Me) Connect(peer string) (*Link, error)
- func (m *Me) DstPort() uint16
- func (m *Me) IsInPeer(peer string) (p *Link, ok bool)
- func (m *Me) ListenFromNIC() (written int64, err error)
- func (m *Me) MTU() uint16
- func (m *Me) SrcPort() uint16
- func (m *Me) Write(packet []byte) (n int, err error)
- type MyConfig
- type PeerConfig
- type Router
Constants ¶
View Source
const ( LINK_STATUS_DOWN = iota LINK_STATUS_HALFUP LINK_STATUS_UP )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
Link 是本机到 peer 的连接抽象
func (*Link) DecodePreshared ¶ added in v0.9.4
DecodePreshared 使用 xchacha20poly1305 解密
func (*Link) EncodePreshared ¶ added in v0.9.4
EncodePreshared 使用 xchacha20poly1305 加密
type Me ¶
type Me struct {
// contains filtered or unexported fields
}
Me 是本机的抽象
func (*Me) ListenFromNIC ¶
type PeerConfig ¶
Click to show internal directories.
Click to hide internal directories.