Documentation ¶
Index ¶
- Constants
- type KernelTunnel
- type NetNS
- type SGWGTPUTunnel
- type SGWGTPUTunnelType
- type Session
- type SessionCreateSessionResponseEvent
- type SessionDeleteSessionResponseEvent
- type SessionEvent
- type SessionEventHandler
- type SessionIncomingTPDUEvent
- type SessionModifyBearerResponseEvent
- type SessionTunnelStartEvent
- type SessionTunnelStopEvent
- type SimpleSession
- func (s *SimpleSession) IPv4() net.IP
- func (s *SimpleSession) IPv6() net.IP
- func (s *SimpleSession) Logger() *logrus.Entry
- func (s *SimpleSession) SetTunnelRegistered(r bool)
- func (s *SimpleSession) TEIDPGWs5u() uint32
- func (s *SimpleSession) TEIDSGWs5u() uint32
- func (s *SimpleSession) TriggerEvent(ev SessionEvent)
- func (s *SimpleSession) TunnelRegistered() bool
- func (s *SimpleSession) UNodeAddr() *net.UDPAddr
- type SimpleSessionConfig
- type TPDUHook
- type TunTunnel
- type UserPlaneConfig
- type UserPlaneServer
- func (up *UserPlaneServer) Context(parent context.Context) context.Context
- func (up *UserPlaneServer) RegisterSession(s Session) error
- func (up *UserPlaneServer) SendResponse(dstAddr *net.UDPAddr, receivedMsg, toBeSentMsg message.Message) error
- func (up *UserPlaneServer) Start(ctx context.Context) error
- func (up *UserPlaneServer) Stop() error
- func (up *UserPlaneServer) UnRegisterSession(s Session) error
- func (up *UserPlaneServer) WriteTo(dstAddr *net.UDPAddr, toBeSentMsg message.Message) error
- type UserPlaneTunnel
Constants ¶
View Source
const ( RoleSGSN = int(gtpv1.RoleSGSN) SCOPE_LINK = netlink.SCOPE_LINK FAMILY_ALL = netlink.FAMILY_ALL )
View Source
const (
GTPU_PORT = 2152
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KernelTunnel ¶
func NewKernelTunnel ¶
func NewKernelTunnel(up *UserPlaneServer, cfg SGWGTPUTunnel) *KernelTunnel
func (*KernelTunnel) Close ¶
func (kt *KernelTunnel) Close() error
func (*KernelTunnel) HandleTPDU ¶
func (kt *KernelTunnel) HandleTPDU(data []byte, src *net.UDPAddr) error
func (*KernelTunnel) RegisterSession ¶
func (kt *KernelTunnel) RegisterSession(s Session) error
func (*KernelTunnel) UnregisterSession ¶
func (kt *KernelTunnel) UnregisterSession(s Session) error
type NetNS ¶
type NetNS interface { Handle() netns.NsHandle ListenUDP(ctx context.Context, laddr *net.UDPAddr) (*net.UDPConn, error) Do(toCall func() error) error }
var DefaultNetNS NetNS = defaultNetNS{}
type SGWGTPUTunnel ¶
type SGWGTPUTunnel struct { Type SGWGTPUTunnelType `yaml:"type"` InterfaceName string `yaml:"interface_name" default:"gtpu_sgw"` MTU int `yaml:"mtu" default:"1300"` }
type SGWGTPUTunnelType ¶
type SGWGTPUTunnelType string
const ( SGWGTPUTunnelTypeNone SGWGTPUTunnelType = "" SGWGTPUTunnelTypeKernel SGWGTPUTunnelType = "kernel" SGWGTPUTunnelTypeTun SGWGTPUTunnelType = "tun" )
type SessionCreateSessionResponseEvent ¶
type SessionCreateSessionResponseEvent struct{ Error error }
type SessionDeleteSessionResponseEvent ¶
type SessionDeleteSessionResponseEvent struct{ Error error }
type SessionEvent ¶
type SessionEvent interface{}
type SessionEventHandler ¶
type SessionEventHandler = func(s Session, ev SessionEvent)
type SessionModifyBearerResponseEvent ¶
type SessionModifyBearerResponseEvent struct{ Error error }
type SessionTunnelStartEvent ¶
type SessionTunnelStartEvent struct{}
type SessionTunnelStopEvent ¶
type SessionTunnelStopEvent struct{}
type SimpleSession ¶
type SimpleSession struct {
// contains filtered or unexported fields
}
func NewSimpleSession ¶
func NewSimpleSession(cfg SimpleSessionConfig) *SimpleSession
func (*SimpleSession) IPv4 ¶
func (s *SimpleSession) IPv4() net.IP
func (*SimpleSession) IPv6 ¶
func (s *SimpleSession) IPv6() net.IP
func (*SimpleSession) Logger ¶
func (s *SimpleSession) Logger() *logrus.Entry
func (*SimpleSession) SetTunnelRegistered ¶
func (s *SimpleSession) SetTunnelRegistered(r bool)
func (*SimpleSession) TEIDPGWs5u ¶
func (s *SimpleSession) TEIDPGWs5u() uint32
func (*SimpleSession) TEIDSGWs5u ¶
func (s *SimpleSession) TEIDSGWs5u() uint32
func (*SimpleSession) TriggerEvent ¶
func (s *SimpleSession) TriggerEvent(ev SessionEvent)
func (*SimpleSession) TunnelRegistered ¶
func (s *SimpleSession) TunnelRegistered() bool
func (*SimpleSession) UNodeAddr ¶
func (s *SimpleSession) UNodeAddr() *net.UDPAddr
type SimpleSessionConfig ¶
type TunTunnel ¶
func NewTunTunnel ¶
func NewTunTunnel(up *UserPlaneServer, cfg SGWGTPUTunnel) *TunTunnel
func (*TunTunnel) RegisterSession ¶
func (*TunTunnel) UnregisterSession ¶
type UserPlaneConfig ¶
type UserPlaneConfig struct { S5uIP net.IP GTPUTunnel SGWGTPUTunnel GRXNetNS NetNS UENetNS NetNS AddRule bool // Specify a hook function to run on ougtoing and incoming // encapsulated T-PDUs. If this hook is non-nil, userspace // GTP mode must always be used TPDUHook TPDUHook }
func (*UserPlaneConfig) SetDefaults ¶
func (cfg *UserPlaneConfig) SetDefaults()
type UserPlaneServer ¶
type UserPlaneServer struct {
// contains filtered or unexported fields
}
func NewUserPlaneServer ¶
func NewUserPlaneServer(cfg UserPlaneConfig, restartCounter uint8) (up *UserPlaneServer, err error)
func (*UserPlaneServer) Context ¶
func (up *UserPlaneServer) Context(parent context.Context) context.Context
func (*UserPlaneServer) RegisterSession ¶
func (up *UserPlaneServer) RegisterSession(s Session) error
func (*UserPlaneServer) SendResponse ¶
func (*UserPlaneServer) Stop ¶
func (up *UserPlaneServer) Stop() error
func (*UserPlaneServer) UnRegisterSession ¶
func (up *UserPlaneServer) UnRegisterSession(s Session) error
Click to show internal directories.
Click to hide internal directories.