Documentation
¶
Index ¶
- Constants
- func ComputeDiff(newRoas []ROA, prevRoas []ROA) ([]ROA, []ROA, []ROA)
- func ConvertROAListToMap(roas []ROA) map[string]ROA
- func GenerateSessionId() uint16
- func IsCorrectPDUVersion(pdu PDU, version uint8) bool
- func TypeToString(t uint8) string
- type Client
- func (c *Client) Disconnect()
- func (c *Client) GetLocalAddress() net.Addr
- func (c *Client) GetRemoteAddress() net.Addr
- func (c *Client) GetVersion() uint8
- func (c *Client) Notify(sessionId uint16, serialNumber uint32)
- func (c *Client) SendCacheReset()
- func (c *Client) SendInternalError()
- func (c *Client) SendNoDataError()
- func (c *Client) SendPDU(pdu PDU)
- func (c *Client) SendROA(roa ROA)
- func (c *Client) SendROAs(sessionId uint16, serialNumber uint32, roas []ROA)
- func (c *Client) SendRawPDU(pdu PDU)
- func (c *Client) SendWrongVersionError()
- func (c *Client) SetDisableVersionCheck(disableCheck bool)
- func (c *Client) SetIntervals(refreshInterval uint32, retryInterval uint32, expireInterval uint32)
- func (c *Client) SetVersion(newversion uint8)
- func (c *Client) Start()
- func (c *Client) String() string
- type ClientCallback
- type ClientConfiguration
- type ClientSession
- func (c *ClientSession) Disconnect()
- func (c *ClientSession) SendPDU(pdu PDU)
- func (c *ClientSession) SendRawPDU(pdu PDU)
- func (c *ClientSession) SendResetQuery()
- func (c *ClientSession) SendSerialQuery(sessionid uint16, serial uint32)
- func (c *ClientSession) Start(addr string, connType int, configTLS *tls.Config, configSSH *ssh.ClientConfig) error
- func (c *ClientSession) StartPlain(addr string) error
- func (c *ClientSession) StartRW(rd io.Reader, wr io.Writer) error
- func (c *ClientSession) StartSSH(addr string, config *ssh.ClientConfig) error
- func (c *ClientSession) StartTLS(addr string, config *tls.Config) error
- func (c *ClientSession) StartWithConn(tcpconn net.Conn) error
- func (c *ClientSession) StartWithSSH(tcpconn *net.TCPConn, session *ssh.Session) error
- type DefaultRTREventHandler
- type Logger
- type PDU
- type PDUCacheReset
- type PDUCacheResponse
- type PDUEndOfData
- type PDUErrorReport
- type PDUIPv4Prefix
- type PDUIPv6Prefix
- type PDUResetQuery
- type PDURouterKey
- type PDUSerialNotify
- type PDUSerialQuery
- type ROA
- type ROAManager
- type RTRClientSessionEventHandler
- type RTREventHandler
- type RTRServerEventHandler
- type Server
- func (s *Server) AddROAs(roas []ROA)
- func (s *Server) AddROAsDiff(diff []ROA)
- func (s *Server) ClientConnected(c *Client)
- func (s *Server) ClientDisconnected(c *Client)
- func (s *Server) GenerateSerial() uint32
- func (s *Server) GetClientList() []*Client
- func (s *Server) GetCurrentROAs() ([]ROA, bool)
- func (s *Server) GetCurrentSerial(sessId uint16) (uint32, bool)
- func (s *Server) GetMaxConnections() int
- func (s *Server) GetROAsSerialDiff(serial uint32) ([]ROA, bool)
- func (s *Server) GetSessionId(c *Client) (uint16, error)
- func (s *Server) HandlePDU(c *Client, pdu PDU)
- func (s *Server) NotifyClients(serialNumber uint32)
- func (s *Server) NotifyClientsLatest()
- func (s *Server) RequestCache(c *Client)
- func (s *Server) RequestNewVersion(c *Client, sessionId uint16, serial uint32)
- func (s *Server) SendPDU(pdu PDU)
- func (s *Server) SetBaseVersion(version uint8)
- func (s *Server) SetManualSerial(v bool)
- func (s *Server) SetMaxConnections(maxconn int)
- func (s *Server) SetSerial(serial uint32)
- func (s *Server) SetSessionId(sessId uint16)
- func (s *Server) SetVersionEnforced(adapt bool)
- func (s *Server) Start(bind string) error
- func (s *Server) StartSSH(bind string, config *ssh.ServerConfig) error
- func (s *Server) StartTLS(bind string, config *tls.Config) error
- type ServerConfiguration
Constants ¶
View Source
const ( PROTOCOL_VERSION_0 = 0 PROTOCOL_VERSION_1 = 1 PDU_ID_SERIAL_NOTIFY = 0 PDU_ID_SERIAL_QUERY = 1 PDU_ID_RESET_QUERY = 2 PDU_ID_CACHE_RESPONSE = 3 PDU_ID_IPV4_PREFIX = 4 PDU_ID_IPV6_PREFIX = 6 PDU_ID_END_OF_DATA = 7 PDU_ID_CACHE_RESET = 8 PDU_ID_ROUTER_KEY = 9 PDU_ID_ERROR_REPORT = 10 FLAG_ADDED = 1 FLAG_REMOVED = 0 PDU_ERROR_CORRUPTDATA = 0 PDU_ERROR_INTERNALERR = 1 PDU_ERROR_NODATA = 2 PDU_ERROR_INVALIDREQUEST = 3 PDU_ERROR_BADPROTOVERSION = 4 PDU_ERROR_BADPDUTYPE = 5 PDU_ERROR_WITHDRAWUNKNOWN = 6 PDU_ERROR_DUPANNOUNCE = 7 TYPE_UNKNOWN = iota TYPE_PLAIN TYPE_TLS TYPE_SSH )
Variables ¶
This section is empty.
Functions ¶
func ConvertROAListToMap ¶ added in v0.12.0
func GenerateSessionId ¶
func GenerateSessionId() uint16
func IsCorrectPDUVersion ¶
func TypeToString ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func ClientFromConn ¶
func ClientFromConn(tcpconn net.Conn, handler RTRServerEventHandler, simpleHandler RTREventHandler) *Client
func ClientFromConnSSH ¶ added in v0.10.0
func ClientFromConnSSH(tcpconn net.Conn, channel ssh.Channel, handler RTRServerEventHandler, simpleHandler RTREventHandler) *Client
func (*Client) Disconnect ¶
func (c *Client) Disconnect()
func (*Client) GetLocalAddress ¶
func (*Client) GetRemoteAddress ¶
func (*Client) GetVersion ¶
func (*Client) SendCacheReset ¶
func (c *Client) SendCacheReset()
func (*Client) SendInternalError ¶
func (c *Client) SendInternalError()
func (*Client) SendNoDataError ¶
func (c *Client) SendNoDataError()
func (*Client) SendRawPDU ¶
func (*Client) SendWrongVersionError ¶
func (c *Client) SendWrongVersionError()
func (*Client) SetDisableVersionCheck ¶
func (*Client) SetIntervals ¶
func (*Client) SetVersion ¶
type ClientCallback ¶ added in v0.10.0
type ClientConfiguration ¶
type ClientSession ¶
type ClientSession struct {
// contains filtered or unexported fields
}
func NewClientSession ¶
func NewClientSession(configuration ClientConfiguration, handler RTRClientSessionEventHandler) *ClientSession
func (*ClientSession) Disconnect ¶
func (c *ClientSession) Disconnect()
func (*ClientSession) SendPDU ¶
func (c *ClientSession) SendPDU(pdu PDU)
func (*ClientSession) SendRawPDU ¶
func (c *ClientSession) SendRawPDU(pdu PDU)
func (*ClientSession) SendResetQuery ¶
func (c *ClientSession) SendResetQuery()
func (*ClientSession) SendSerialQuery ¶
func (c *ClientSession) SendSerialQuery(sessionid uint16, serial uint32)
func (*ClientSession) Start ¶
func (c *ClientSession) Start(addr string, connType int, configTLS *tls.Config, configSSH *ssh.ClientConfig) error
func (*ClientSession) StartPlain ¶ added in v0.10.0
func (c *ClientSession) StartPlain(addr string) error
func (*ClientSession) StartSSH ¶ added in v0.10.0
func (c *ClientSession) StartSSH(addr string, config *ssh.ClientConfig) error
func (*ClientSession) StartTLS ¶ added in v0.10.0
func (c *ClientSession) StartTLS(addr string, config *tls.Config) error
func (*ClientSession) StartWithConn ¶
func (c *ClientSession) StartWithConn(tcpconn net.Conn) error
func (*ClientSession) StartWithSSH ¶ added in v0.10.0
type DefaultRTREventHandler ¶
type DefaultRTREventHandler struct { Log Logger // contains filtered or unexported fields }
func (*DefaultRTREventHandler) RequestCache ¶
func (e *DefaultRTREventHandler) RequestCache(c *Client)
func (*DefaultRTREventHandler) RequestNewVersion ¶
func (e *DefaultRTREventHandler) RequestNewVersion(c *Client, sessionId uint16, serialNumber uint32)
func (*DefaultRTREventHandler) SetROAManager ¶
func (e *DefaultRTREventHandler) SetROAManager(m ROAManager)
type PDU ¶
type PDU interface { Bytes() []byte Write(io.Writer) String() string SetVersion(uint8) GetVersion() uint8 GetType() uint8 }
func DecodeBytes ¶
type PDUCacheReset ¶
type PDUCacheReset struct {
Version uint8
}
func (*PDUCacheReset) Bytes ¶
func (pdu *PDUCacheReset) Bytes() []byte
func (*PDUCacheReset) GetType ¶
func (pdu *PDUCacheReset) GetType() uint8
func (*PDUCacheReset) GetVersion ¶
func (pdu *PDUCacheReset) GetVersion() uint8
func (*PDUCacheReset) SetVersion ¶
func (pdu *PDUCacheReset) SetVersion(version uint8)
func (*PDUCacheReset) String ¶
func (pdu *PDUCacheReset) String() string
func (*PDUCacheReset) Write ¶
func (pdu *PDUCacheReset) Write(wr io.Writer)
type PDUCacheResponse ¶
func (*PDUCacheResponse) Bytes ¶
func (pdu *PDUCacheResponse) Bytes() []byte
func (*PDUCacheResponse) GetType ¶
func (pdu *PDUCacheResponse) GetType() uint8
func (*PDUCacheResponse) GetVersion ¶
func (pdu *PDUCacheResponse) GetVersion() uint8
func (*PDUCacheResponse) SetVersion ¶
func (pdu *PDUCacheResponse) SetVersion(version uint8)
func (*PDUCacheResponse) String ¶
func (pdu *PDUCacheResponse) String() string
func (*PDUCacheResponse) Write ¶
func (pdu *PDUCacheResponse) Write(wr io.Writer)
type PDUEndOfData ¶
type PDUEndOfData struct { Version uint8 SessionId uint16 SerialNumber uint32 RefreshInterval uint32 RetryInterval uint32 ExpireInterval uint32 }
func (*PDUEndOfData) Bytes ¶
func (pdu *PDUEndOfData) Bytes() []byte
func (*PDUEndOfData) GetType ¶
func (pdu *PDUEndOfData) GetType() uint8
func (*PDUEndOfData) GetVersion ¶
func (pdu *PDUEndOfData) GetVersion() uint8
func (*PDUEndOfData) SetVersion ¶
func (pdu *PDUEndOfData) SetVersion(version uint8)
func (*PDUEndOfData) String ¶
func (pdu *PDUEndOfData) String() string
func (*PDUEndOfData) Write ¶
func (pdu *PDUEndOfData) Write(wr io.Writer)
type PDUErrorReport ¶
func (*PDUErrorReport) Bytes ¶
func (pdu *PDUErrorReport) Bytes() []byte
func (*PDUErrorReport) GetType ¶
func (pdu *PDUErrorReport) GetType() uint8
func (*PDUErrorReport) GetVersion ¶
func (pdu *PDUErrorReport) GetVersion() uint8
func (*PDUErrorReport) SetVersion ¶
func (pdu *PDUErrorReport) SetVersion(version uint8)
func (*PDUErrorReport) String ¶
func (pdu *PDUErrorReport) String() string
func (*PDUErrorReport) Write ¶
func (pdu *PDUErrorReport) Write(wr io.Writer)
type PDUIPv4Prefix ¶
func (*PDUIPv4Prefix) Bytes ¶
func (pdu *PDUIPv4Prefix) Bytes() []byte
func (*PDUIPv4Prefix) GetType ¶
func (pdu *PDUIPv4Prefix) GetType() uint8
func (*PDUIPv4Prefix) GetVersion ¶
func (pdu *PDUIPv4Prefix) GetVersion() uint8
func (*PDUIPv4Prefix) SetVersion ¶
func (pdu *PDUIPv4Prefix) SetVersion(version uint8)
func (*PDUIPv4Prefix) String ¶
func (pdu *PDUIPv4Prefix) String() string
func (*PDUIPv4Prefix) Write ¶
func (pdu *PDUIPv4Prefix) Write(wr io.Writer)
type PDUIPv6Prefix ¶
func (*PDUIPv6Prefix) Bytes ¶
func (pdu *PDUIPv6Prefix) Bytes() []byte
func (*PDUIPv6Prefix) GetType ¶
func (pdu *PDUIPv6Prefix) GetType() uint8
func (*PDUIPv6Prefix) GetVersion ¶
func (pdu *PDUIPv6Prefix) GetVersion() uint8
func (*PDUIPv6Prefix) SetVersion ¶
func (pdu *PDUIPv6Prefix) SetVersion(version uint8)
func (*PDUIPv6Prefix) String ¶
func (pdu *PDUIPv6Prefix) String() string
func (*PDUIPv6Prefix) Write ¶
func (pdu *PDUIPv6Prefix) Write(wr io.Writer)
type PDUResetQuery ¶
type PDUResetQuery struct {
Version uint8
}
func (*PDUResetQuery) Bytes ¶
func (pdu *PDUResetQuery) Bytes() []byte
func (*PDUResetQuery) GetType ¶
func (pdu *PDUResetQuery) GetType() uint8
func (*PDUResetQuery) GetVersion ¶
func (pdu *PDUResetQuery) GetVersion() uint8
func (*PDUResetQuery) SetVersion ¶
func (pdu *PDUResetQuery) SetVersion(version uint8)
func (*PDUResetQuery) String ¶
func (pdu *PDUResetQuery) String() string
func (*PDUResetQuery) Write ¶
func (pdu *PDUResetQuery) Write(wr io.Writer)
type PDURouterKey ¶
type PDURouterKey struct { Version uint8 Flags uint8 SubjectKeyIdentifier [20]byte ASN uint32 SubjectPublicKeyInfo uint32 }
func (*PDURouterKey) Bytes ¶
func (pdu *PDURouterKey) Bytes() []byte
func (*PDURouterKey) GetType ¶
func (pdu *PDURouterKey) GetType() uint8
func (*PDURouterKey) GetVersion ¶
func (pdu *PDURouterKey) GetVersion() uint8
func (*PDURouterKey) SetVersion ¶
func (pdu *PDURouterKey) SetVersion(version uint8)
func (*PDURouterKey) String ¶
func (pdu *PDURouterKey) String() string
func (*PDURouterKey) Write ¶
func (pdu *PDURouterKey) Write(wr io.Writer)
type PDUSerialNotify ¶
func (*PDUSerialNotify) Bytes ¶
func (pdu *PDUSerialNotify) Bytes() []byte
func (*PDUSerialNotify) GetType ¶
func (pdu *PDUSerialNotify) GetType() uint8
func (*PDUSerialNotify) GetVersion ¶
func (pdu *PDUSerialNotify) GetVersion() uint8
func (*PDUSerialNotify) SetVersion ¶
func (pdu *PDUSerialNotify) SetVersion(version uint8)
func (*PDUSerialNotify) String ¶
func (pdu *PDUSerialNotify) String() string
func (*PDUSerialNotify) Write ¶
func (pdu *PDUSerialNotify) Write(wr io.Writer)
type PDUSerialQuery ¶
func (*PDUSerialQuery) Bytes ¶
func (pdu *PDUSerialQuery) Bytes() []byte
func (*PDUSerialQuery) GetType ¶
func (pdu *PDUSerialQuery) GetType() uint8
func (*PDUSerialQuery) GetVersion ¶
func (pdu *PDUSerialQuery) GetVersion() uint8
func (*PDUSerialQuery) SetVersion ¶
func (pdu *PDUSerialQuery) SetVersion(version uint8)
func (*PDUSerialQuery) String ¶
func (pdu *PDUSerialQuery) String() string
func (*PDUSerialQuery) Write ¶
func (pdu *PDUSerialQuery) Write(wr io.Writer)
type ROAManager ¶
type RTRClientSessionEventHandler ¶
type RTRClientSessionEventHandler interface { //RequestCache(*ClientSession) HandlePDU(*ClientSession, PDU) ClientConnected(*ClientSession) ClientDisconnected(*ClientSession) }
type RTREventHandler ¶
type RTRServerEventHandler ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(configuration ServerConfiguration, handler RTRServerEventHandler, simpleHandler RTREventHandler) *Server
func (*Server) AddROAsDiff ¶
func (*Server) ClientConnected ¶
func (*Server) ClientDisconnected ¶
func (*Server) GenerateSerial ¶
func (*Server) GetClientList ¶
func (*Server) GetCurrentROAs ¶
func (*Server) GetMaxConnections ¶
func (*Server) NotifyClients ¶
func (*Server) NotifyClientsLatest ¶
func (s *Server) NotifyClientsLatest()
func (*Server) RequestCache ¶
func (*Server) RequestNewVersion ¶
func (*Server) SetBaseVersion ¶
func (*Server) SetManualSerial ¶ added in v0.14.4
func (*Server) SetMaxConnections ¶
func (*Server) SetSerial ¶ added in v0.14.4
This function sets the serial. Function must be called before the ROAs data is added.
func (*Server) SetSessionId ¶
func (*Server) SetVersionEnforced ¶
Click to show internal directories.
Click to hide internal directories.