mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00
Add new reject channel to router so we can send back rejected packets to adapter (e.g. for ICMPv6 Packet Too Big), implement ICMPv6 PTB in TUN/TAP instead of router
This commit is contained in:
parent
0715e829c2
commit
eb22ed44ac
3 changed files with 135 additions and 96 deletions
|
@ -13,12 +13,13 @@ type Adapter struct {
|
|||
Core *Core
|
||||
Send chan<- []byte
|
||||
Recv <-chan []byte
|
||||
Reject <-chan RejectedPacket
|
||||
Reconfigure chan chan error
|
||||
}
|
||||
|
||||
// Defines the minimum required functions for an adapter type
|
||||
type adapterImplementation interface {
|
||||
Init(*config.NodeState, *log.Logger, chan<- []byte, <-chan []byte)
|
||||
Init(*config.NodeState, *log.Logger, chan<- []byte, <-chan []byte, <-chan RejectedPacket)
|
||||
Name() string
|
||||
MTU() int
|
||||
IsTAP() bool
|
||||
|
@ -29,9 +30,10 @@ type adapterImplementation interface {
|
|||
}
|
||||
|
||||
// Initialises the adapter.
|
||||
func (adapter *Adapter) Init(config *config.NodeState, log *log.Logger, send chan<- []byte, recv <-chan []byte) {
|
||||
func (adapter *Adapter) Init(config *config.NodeState, log *log.Logger, send chan<- []byte, recv <-chan []byte, reject <-chan RejectedPacket) {
|
||||
log.Traceln("Adapter setup - given channels:", send, recv)
|
||||
adapter.Send = send
|
||||
adapter.Recv = recv
|
||||
adapter.Reject = reject
|
||||
adapter.Reconfigure = make(chan chan error, 1)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue