servicers

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

package servcers implements EAP-AKA GRPC service

package servcers implements EAP-AKA GRPC service

package servicers implements EAP-AKA GRPC service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHandler

func AddHandler(st aka.Subtype, h Handler)

Types

type EapAkaSrv

type EapAkaSrv struct {
	// contains filtered or unexported fields
}

func NewEapAkaService

func NewEapAkaService(config *mconfig.EapAkaConfig) (*EapAkaSrv, error)

NewEapAkaService creates new Aka Service 'object'

func (*EapAkaSrv) ChallengeTimeout

func (s *EapAkaSrv) ChallengeTimeout() time.Duration

func (*EapAkaSrv) CheckPlmnId

func (s *EapAkaSrv) CheckPlmnId(imsi aka.IMSI) bool

CheckPlmnId returns true either if there is no PLMN ID filters (allowlist) configured or one the configured PLMN IDs matches passed IMSI

func (*EapAkaSrv) FindAndRemoveSession

func (s *EapAkaSrv) FindAndRemoveSession(sessionId string) (aka.IMSI, bool)

FindAndRemoveSession finds returns IMSI of a session and a flag indication if the find succeeded then it deletes the session ID from the map

func (*EapAkaSrv) FindSession

func (s *EapAkaSrv) FindSession(sessionId string) (aka.IMSI, *UserCtx, bool)

FindSession finds and returns IMSI of a session and a flag indication if the find succeeded If found, FindSession tries to stop outstanding session timer

func (*EapAkaSrv) Handle

func (s *EapAkaSrv) Handle(_ context.Context, req *protos.Eap) (*protos.Eap, error)

Handle implements AKA handler RPC

func (*EapAkaSrv) HandleImpl

func (s *EapAkaSrv) HandleImpl(req *protos.Eap) (*protos.Eap, error)

Handle implements AKA handler API

func (*EapAkaSrv) InitSession

func (s *EapAkaSrv) InitSession(sessionId string, imsi aka.IMSI) (lockedUserContext *UserCtx)

InitSession either creates new or updates existing session & user ctx, it session ID into the CTX and initializes session map as well as users map Returns Locked User Ctx

func (*EapAkaSrv) NotificationTimeout

func (s *EapAkaSrv) NotificationTimeout() time.Duration

func (*EapAkaSrv) RemoveSession

func (s *EapAkaSrv) RemoveSession(sessionId string) aka.IMSI

RemoveSession removes session ID from the session map and attempts to cancel corresponding timer It also removes associated with the session user CTX if any returns associated with the session IMSI or an empty string

func (*EapAkaSrv) ResetSessionTimeout

func (s *EapAkaSrv) ResetSessionTimeout(sessionId string, newTimeout time.Duration)

ResetSessionTimeout finds a session with specified ID, if found - attempts to cancel its current timeout (best effort) & schedules the new one. ResetSessionTimeout does not guarantee that the old timeout cleanup won't be executed

func (*EapAkaSrv) SessionAuthenticatedTimeout

func (s *EapAkaSrv) SessionAuthenticatedTimeout() time.Duration

func (*EapAkaSrv) SessionTimeout

func (s *EapAkaSrv) SessionTimeout() time.Duration

func (*EapAkaSrv) SetChallengeTimeout

func (s *EapAkaSrv) SetChallengeTimeout(tout time.Duration)

func (*EapAkaSrv) SetNotificationTimeout

func (s *EapAkaSrv) SetNotificationTimeout(tout time.Duration)

func (*EapAkaSrv) SetSessionAuthenticatedTimeout

func (s *EapAkaSrv) SetSessionAuthenticatedTimeout(tout time.Duration)

func (*EapAkaSrv) SetSessionTimeout

func (s *EapAkaSrv) SetSessionTimeout(tout time.Duration)

func (*EapAkaSrv) UpdateSessionTimeout

func (s *EapAkaSrv) UpdateSessionTimeout(sessionId string, timeout time.Duration) bool

UpdateSessionTimeout finds a session with specified ID, if found - cancels its current timeout & schedules the new one. Returns true if the session was found

func (*EapAkaSrv) UpdateSessionUnlockCtx

func (s *EapAkaSrv) UpdateSessionUnlockCtx(lockedCtx *UserCtx, timeout time.Duration)

UpdateSessionUnlockCtx sets session ID into the CTX and initializes session map & session timeout

type Handler

type Handler func(srvr *EapAkaSrv, ctx *protos.Context, req eap.Packet) (eap.Packet, error)

Handler - is an AKA Subtype

func GetHandler

func GetHandler(st aka.Subtype) Handler

type SessionCtx

type SessionCtx struct {
	*UserCtx
	CleanupTimer *time.Timer
}

type UserCtx

type UserCtx struct {
	Identity   string
	Imsi       aka.IMSI
	Profile    *protos.AuthenticationAnswer_UserProfile
	Identifier uint8
	Rand,
	K_aut,
	MSK,
	Xres []byte
	SessionId     string
	AuthSessionId string
	// contains filtered or unexported fields
}

func (*UserCtx) CreatedTime

func (lockedCtx *UserCtx) CreatedTime() time.Time

CreatedTime returns time of CTX creation

func (*UserCtx) Lifetime

func (lockedCtx *UserCtx) Lifetime() float64

Lifetime returns duration in seconds of the CTX existence

func (*UserCtx) SetState

func (lockedCtx *UserCtx) SetState(s aka.AkaState)

SetState updates current CTX state (CTX must be locked)

func (*UserCtx) State

func (lockedCtx *UserCtx) State() (aka.AkaState, time.Time)

State returns current CTX state (CTX must be locked)

func (*UserCtx) Unlock

func (lockedCtx *UserCtx) Unlock()

Unlock - unlocks the CTX

Directories

Path Synopsis
Package handlers provided AKA Response handlers for supported AKA subtypes Package handlers provided AKA Response handlers for supported AKA subtypes Package handlers provided AKA Response handlers for supported AKA subtypes Package handlers provided AKA Response handlers for supported AKA subtypes
Package handlers provided AKA Response handlers for supported AKA subtypes Package handlers provided AKA Response handlers for supported AKA subtypes Package handlers provided AKA Response handlers for supported AKA subtypes Package handlers provided AKA Response handlers for supported AKA subtypes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL