factory

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	N3ueExpectedConfigVersion = "1.0.1"
)

Variables

View Source
var (
	N3ueConfig Config
	N3ueInfo   N3UEInfo
	N3iwfInfo  N3IWFInfo
)

Functions

func InitConfigFactory

func InitConfigFactory(f string) error

func SyncConfigSQN

func SyncConfigSQN(offset uint8) error

func WriteConfigWithKey

func WriteConfigWithKey(key, value string) error

Types

type Config

type Config struct {
	Info          *Info          `yaml:"info" valid:"required"`
	Configuration *Configuration `yaml:"configuration" valid:"required"`
	Logger        *Logger        `yaml:"logger" valid:"optional"`
}

func (*Config) GetVersion

func (c *Config) GetVersion() string

func (*Config) Print

func (c *Config) Print()

func (*Config) SetLogLevel

func (c *Config) SetLogLevel()

func (*Config) Validate

func (c *Config) Validate() (bool, error)

type Configuration

type Configuration struct {
	N3IWFInfo N3IWFInfo `yaml:"N3IWFInformation" valid:"required"`
	N3UEInfo  N3UEInfo  `yaml:"N3UEInformation" valid:"required"`
}

type IMSI

type IMSI struct {
	PLMN PLMN   `yaml:"PLMNID" valid:"required"`
	MSIN string `yaml:"MSIN" valid:"numeric,stringlength(1|10),required"`
}

type Info

type Info struct {
	Version     string `yaml:"version" valid:"type(string),required"`
	Description string `yaml:"description" valid:"type(string),optional"`
}

type LogSetting

type LogSetting struct {
	DebugLevel   string `yaml:"debugLevel" valid:"debugLevel"`
	ReportCaller bool   `yaml:"ReportCaller" valid:"type(bool)"`
}

type Logger

type Logger struct {
	N3UE *LogSetting `yaml:"N3UE" valid:"optional"`
}

type N3IWFInfo

type N3IWFInfo struct {
	IPSecIfaceAddr string `yaml:"IPSecIfaceAddr" valid:"host,required"`
	IPsecInnerAddr string `yaml:"IPsecInnerAddr" valid:"host,required"`
}

type N3UEInfo

type N3UEInfo struct {
	IMSI           IMSI         `yaml:"IMSI" valid:"required"`
	AMFID          string       `yaml:"AMFID" valid:"hexadecimal,required"`
	IPSecIfaceName string       `yaml:"IPSecIfaceName" valid:"stringlength(1|10),required"`
	IPSecIfaceAddr string       `yaml:"IPSecIfaceAddr" valid:"host,required"`
	DnIPAddr       string       `yaml:"DnIPAddr" valid:"host,optional"`
	XfrmiId        uint32       `yaml:"XfrmiId" valid:"numeric,required"`
	XfrmiName      string       `yaml:"XfrmiName" valid:"stringlength(1|10),required"`
	GreIfaceName   string       `yaml:"GreIfaceName" valid:"stringlength(1|10),required"`
	IkeSaSPI       uint64       `yaml:"IkeSaSPI" valid:"hexadecimal,required"`
	IPSecSaCpSPI   uint32       `yaml:"IPSecSA3gppControlPlaneSPI" valid:"hexadecimal,required"`
	SmPolicy       []PolicyItem `yaml:"SmPolicy" valid:"required"`
	Security       Security     `yaml:"Security" valid:"required"`
}

func (*N3UEInfo) BuildMSIN

func (n *N3UEInfo) BuildMSIN() []byte

TS 24.501 9.11.3.4

func (*N3UEInfo) BuildPLMN

func (n *N3UEInfo) BuildPLMN() []byte

func (*N3UEInfo) GetAMFID

func (n *N3UEInfo) GetAMFID() ([]byte, error)

func (*N3UEInfo) GetSNN

func (n *N3UEInfo) GetSNN() string

func (*N3UEInfo) GetSUPI

func (n *N3UEInfo) GetSUPI() string

type PLMN

type PLMN struct {
	MCC string `yaml:"MCC" valid:"numeric,stringlength(3|3),required"`
	MNC string `yaml:"MNC" valid:"numeric,stringlength(2|3),required"`
}

type PolicyItem

type PolicyItem struct {
	DNN    string `yaml:"DNN" valid:"type(string),required"`
	SNSSAI SNSSAI `yaml:"SNSSAI" valid:"required"`
}

type SNSSAI

type SNSSAI struct {
	SST string `yaml:"SST" valid:"hexadecimal,stringlength(1|1),required"`
	SD  string `yaml:"SD,omitempty" valid:"hexadecimal,stringlength(6|6),required"`
}

func (*SNSSAI) ToBytes

func (s *SNSSAI) ToBytes() ([]byte, error)

type Security

type Security struct {
	K    string `yaml:"K" valid:"hexadecimal,required"`
	RAND string `yaml:"RAND" valid:"hexadecimal,required"`
	SQN  string `yaml:"SQN" valid:"hexadecimal,required"`
	AMF  string `yaml:"AMF" valid:"hexadecimal,required"`
	OP   string `yaml:"OP" valid:"hexadecimal,required"`
	OPC  string `yaml:"OPC" valid:"hexadecimal,required"`
}

Jump to

Keyboard shortcuts

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