mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-08 14:39:09 +02:00
Add userspace flow implementation (#3393)
This commit is contained in:
@@ -7,17 +7,52 @@ import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Protocol uint8
|
||||
|
||||
const (
|
||||
ProtocolUnknown = 0
|
||||
ICMP = 1
|
||||
TCP = 6
|
||||
UDP = 17
|
||||
)
|
||||
|
||||
func (p Protocol) String() string {
|
||||
switch p {
|
||||
case 1:
|
||||
return "ICMP"
|
||||
case 6:
|
||||
return "TCP"
|
||||
case 17:
|
||||
return "UDP"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
type Type int
|
||||
|
||||
const (
|
||||
TypeStart = iota
|
||||
TypeUnknown = iota
|
||||
TypeStart
|
||||
TypeEnd
|
||||
)
|
||||
|
||||
type Direction int
|
||||
|
||||
func (d Direction) String() string {
|
||||
switch d {
|
||||
case Ingress:
|
||||
return "ingress"
|
||||
case Egress:
|
||||
return "egress"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
const (
|
||||
Ingress = iota
|
||||
DirectionUnknown = iota
|
||||
Ingress
|
||||
Egress
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user