Improve logging, support pre-authorized ports

This commit is contained in:
Daniel
2019-05-10 11:57:18 +02:00
parent 55ef385dcb
commit e72ed023db
5 changed files with 118 additions and 3 deletions

View File

@@ -3,17 +3,29 @@
package packet
import (
"context"
"fmt"
"net"
)
// Base is a base structure for satisfying the Packet interface.
type Base struct {
ctx context.Context
info Info
linkID string
Payload []byte
}
// SetCtx sets the packet context.
func (pkt *Base) SetCtx(ctx context.Context) {
pkt.ctx = ctx
}
// Ctx returns the packet context.
func (pkt *Base) Ctx() context.Context {
return pkt.ctx
}
// Info returns the packet Info.
func (pkt *Base) Info() *Info {
return &pkt.info
@@ -195,6 +207,8 @@ type Packet interface {
RerouteToTunnel() error
// INFO
SetCtx(context.Context)
Ctx() context.Context
Info() *Info
SetPacketInfo(Info)
IsInbound() bool