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: 27 Imported by: 0

Documentation

Overview

Package servicers implements Swx GRPC proxy service which sends MAR/SAR messages over diameter connection, waits (blocks) for diameter's MAA/SAAs and returns their RPC representation

Package servicers implements Swx GRPC proxy service which sends MAR/SAR messages over diameter connection, waits (blocks) for diameter's MAA/SAAs and returns their RPC representation

Package servicers implements Swx GRPC proxy service which sends MAR/SAR messages over diameter connection, waits (blocks) for diameter's MAA/SAAs returns their RPC representation

Index

Constants

View Source
const (
	SwxProxyServiceName = "swx_proxy"

	HSSAddrEnv           = "HSS_ADDR"
	SwxNetworkEnv        = "SWX_NETWORK"
	SwxDiamHostEnv       = "SWX_DIAM_HOST"
	SwxDiamRealmEnv      = "SWX_DIAM_REALM"
	SwxDiamProductEnv    = "SWX_DIAM_PRODUCT"
	SwxLocalAddrEnv      = "SWX_LOCAL_ADDR"
	HSSHostEnv           = "HSS_HOST"
	HSSRealmEnv          = "HSS_REALM"
	DisableDestHostEnv   = "DISABLE_DEST_HOST"
	OverwriteDestHostEnv = "OVERWRITE_DEST_HOST"

	DefaultSwxDiamRealm          = "epc.mnc070.mcc722.3gppnetwork.org"
	DefaultSwxDiamHost           = "feg-swx.epc.mnc070.mcc722.3gppnetwork.org"
	DefaultVerifyAuthorization   = false
	DefaultRegisterOnAuth        = false
	DefaultDeriveUnregisterRealm = false
)
View Source
const (
	// 3GPP 29.273 8.2.3.12:
	// register AAA server serving authenticated user to HSS
	ServerAssignmentType_REGISTRATION = 1
	// de-register AAA server serving authenticated user to HSS
	ServerAssignnmentType_USER_DEREGISTRATION = 5
	// request user profile from HSS
	ServerAssignmentType_AAA_USER_DATA_REQUEST = 12

	// 3GPP 29.273 5.2.3.6
	RadioAccessTechnologyType_WLAN = 0

	// 3GPP 29.273 8.1.2.1.1/2
	SipAuthScheme_EAP_AKA       = "EAP-AKA"
	SipAuthScheme_EAP_AKA_PRIME = "EAP-AKA'"

	// END_USER_E164 - Subscription-ID Type indicating that the identifier is
	// in international E.164 format (eg. MSISDN).
	// See IETF RFC 4006 section 8.47.
	END_USER_E164 = 0

	// 3GPP 29.273 8.2.3.4
	Non3GPPIPAccess_ENABLED = 0

	// Value of AVP auth-session-state indicating that no state is maintained
	// between calls.
	AuthSessionState_NO_STATE_MAINTAINED = 1
)
View Source
const (
	TIMEOUT_SECONDS  = 10
	MAX_DIAM_RETRIES = 1
)
View Source
const (
	// MaxDiamRTRetries - number of retries for responding to RTR
	MaxDiamRTRetries = 1
)
View Source
const MinRequestedVectors uint32 = 5

Variables

This section is empty.

Functions

func NewSwxProxy

func NewSwxProxy(config *SwxProxyConfig) (*swxProxy, error)

NewSwxProxy creates a new instance of the proxy with configured cache TTL

func NewSwxProxyWithCache

func NewSwxProxyWithCache(config *SwxProxyConfig, cache *cache.Impl) (*swxProxy, error)

NewSwxProxyWithCache creates a new instance of the proxy with given cache implementation

func ValidateSwxProxyConfig

func ValidateSwxProxyConfig(config *SwxProxyConfig) error

ValidateSwxProxyConfig ensures that the swx proxy config specified has valid diameter client and server configs

Types

type CloseableSwxGatewayServiceResponderClient

type CloseableSwxGatewayServiceResponderClient struct {
	protos.SwxGatewayServiceClient
	// contains filtered or unexported fields
}

func GetSwxGatewayServiceResponderClient

func GetSwxGatewayServiceResponderClient(
	cloudRegistry service_registry.GatewayRegistry) (*CloseableSwxGatewayServiceResponderClient, error)

GetSwxGatewayServiceResponderClient returns a client to the local terminate registration client

func (*CloseableSwxGatewayServiceResponderClient) Close

type DeregistrationReason

type DeregistrationReason struct {
	ReasonCode datatype.Enumerated `avp:"Reason-Code"`
	ReasonInfo datatype.UTF8String `avp:"Reason-Info"`
}

type ExperimentalResult

type ExperimentalResult struct {
	VendorId               uint32 `avp:"Vendor-Id"`
	ExperimentalResultCode uint32 `avp:"Experimental-Result-Code"`
}

type MAA

type MAA struct {
	SessionID          string                    `avp:"Session-Id"`
	ResultCode         uint32                    `avp:"Result-Code"`
	OriginHost         datatype.DiameterIdentity `avp:"Origin-Host"`
	OriginRealm        datatype.DiameterIdentity `avp:"Origin-Realm"`
	AuthSessionState   int32                     `avp:"Auth-Session-State"`
	ExperimentalResult ExperimentalResult        `avp:"Experimental-Result"`
	SIPAuthDataItems   []SIPAuthDataItem         `avp:"SIP-Auth-Data-Item"`
	SIPNumberAuthItems uint32                    `avp:"SIP-Number-Auth-Items"`
	AAAServerName      datatype.DiameterIdentity `avp:"TGPP-AAA-Server-Name"`
}

3GPP 29.273 8.2.2.1 - Multimedia Authentication Answer

type MAR

type MAR struct {
	SessionID           datatype.UTF8String         `avp:"Session-Id"`
	VendorSpecificAppId VendorSpecificApplicationId `avp:"Vendor-Specific-Application-Id"`
	OriginHost          datatype.DiameterIdentity   `avp:"Origin-Host"`
	OriginRealm         datatype.DiameterIdentity   `avp:"Origin-Realm"`
	AuthSessionState    datatype.UTF8String         `avp:"Auth-Session-State"`
	UserName            string                      `avp:"User-Name"`
	RATType             datatype.Enumerated         `avp:"RAT-Type"`
	AuthData            SIPAuthDataItem             `avp:"SIP-Auth-Data-Item"`
	NumberAuthItems     uint32                      `avp:"SIP-Number-Auth-Items"`
}

3GPP 29.273 8.2.2.1 - Multimedia Authentication Request

type Non3GPPUserData

type Non3GPPUserData struct {
	SubscriptionId  SubscriptionId      `avp:"Subscription-Id"`
	Non3GPPIPAccess datatype.Enumerated `avp:"Non-3GPP-IP-Access"`
}

type PlmnIdVal

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

type RTA

type RTA struct {
	SessionID          string                    `avp:"Session-Id"`
	AuthSessionState   int32                     `avp:"Auth-Session-State"`
	ResultCode         uint32                    `avp:"Result-Code"`
	OriginHost         datatype.DiameterIdentity `avp:"Origin-Host"`
	OriginRealm        datatype.DiameterIdentity `avp:"Origin-Realm"`
	ExperimentalResult ExperimentalResult        `avp:"Experimental-Result"`
}

3GPP 29.273 8.2.2.4 - Registration Termination Answer

type RTR

type RTR struct {
	SessionID            datatype.UTF8String         `avp:"Session-Id"`
	VendorSpecificAppId  VendorSpecificApplicationId `avp:"Vendor-Specific-Application-Id"`
	OriginHost           datatype.DiameterIdentity   `avp:"Origin-Host"`
	OriginRealm          datatype.DiameterIdentity   `avp:"Origin-Realm"`
	AuthSessionState     datatype.Unsigned32         `avp:"Auth-Session-State"`
	UserName             datatype.UTF8String         `avp:"User-Name"`
	DeregistrationReason DeregistrationReason        `avp:"Deregistration-Reason"`
}

3GPP 29.273 8.2.2.4 - Registration Termination Request

type Relay

type Relay interface {
	RelayRTR(*RTR) (protos.ErrorCode, error)
	RelayASR(*diameter.ASR) (protos.ErrorCode, error)
}

type SAA

type SAA struct {
	SessionID          string                    `avp:"Session-Id"`
	AuthSessionState   int32                     `avp:"Auth-Session-State"`
	ResultCode         uint32                    `avp:"Result-Code"`
	OriginHost         datatype.DiameterIdentity `avp:"Origin-Host"`
	OriginRealm        datatype.DiameterIdentity `avp:"Origin-Realm"`
	ExperimentalResult ExperimentalResult        `avp:"Experimental-Result"`
	UserName           datatype.UTF8String       `avp:"User-Name"`
	UserData           Non3GPPUserData           `avp:"Non-3GPP-User-Data"`
	AAAServerName      datatype.DiameterIdentity `avp:"TGPP-AAA-Server-Name"`
}

3GPP 29.273 8.2.2.3 - Server Assignment Answer

type SAR

type SAR struct {
	SessionID            datatype.UTF8String         `avp:"Session-Id"`
	VendorSpecificAppId  VendorSpecificApplicationId `avp:"Vendor-Specific-Application-Id"`
	OriginHost           datatype.DiameterIdentity   `avp:"Origin-Host"`
	OriginRealm          datatype.DiameterIdentity   `avp:"Origin-Realm"`
	AuthSessionState     datatype.Unsigned32         `avp:"Auth-Session-State"`
	UserName             datatype.UTF8String         `avp:"User-Name"`
	ServerAssignmentType datatype.Enumerated         `avp:"Server-Assignment-Type"`
}

3GPP 29.273 8.2.2.3 - Server Assignment Request

type SIPAuthDataItem

type SIPAuthDataItem struct {
	AuthScheme         string               `avp:"SIP-Authentication-Scheme"`
	Authenticate       datatype.OctetString `avp:"SIP-Authenticate"`
	Authorization      datatype.OctetString `avp:"SIP-Authorization"`
	ConfidentialityKey datatype.OctetString `avp:"Confidentiality-Key"`
	IntegrityKey       datatype.OctetString `avp:"Integrity-Key"`
}

type SubscriptionId

type SubscriptionId struct {
	SubscriptionIdType datatype.Enumerated `avp:"Subscription-Id-Type"`
	SubscriptionIdData datatype.UTF8String `avp:"Subscription-Id-Data"`
}

type SwxProxies

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

func NewSwxProxies

func NewSwxProxies(configs []*SwxProxyConfig, mux multiplex.Multiplexor) (*SwxProxies, error)

NewSwxProxies creates several SwxProxys but it uses a shared cache fir all of them

func (*SwxProxies) Authenticate

Calls Authenticate on the chosen swx proxy based on IMSI of the incoming request

func (*SwxProxies) Deregister

Calls Deregister on the chosen swx proxy based on IMSI of the incoming request

func (*SwxProxies) Disable

func (s *SwxProxies) Disable(ctx context.Context, req *protos.DisableMessage) (*orcprotos.Void, error)

Calls Disable on each swx proxy

func (*SwxProxies) Enable

func (s *SwxProxies) Enable(ctx context.Context, req *orcprotos.Void) (*orcprotos.Void, error)

Calls Enable on each swx proxy

func (*SwxProxies) GetHealthStatus

func (s *SwxProxies) GetHealthStatus(ctx context.Context, req *orcprotos.Void) (*protos.HealthStatus, error)

Calls GetHealthStatus on each Swx Proxy

func (*SwxProxies) Register

Calls Register on the chosen swx proxy based on IMSI of the incoming request

type SwxProxiesWithHealth

type SwxProxiesWithHealth interface {
	protos.SwxProxyServer
	fegprotos.ServiceHealthServer
}

SwxProxiesWithHealth is an interface just to group SwxProxies and ServiceHealthServer. This is used to be able to return either SwxProxies or SwxProxy (without S)

func NewSwxProxiesWithHealthAndDefaultMultiplexor

func NewSwxProxiesWithHealthAndDefaultMultiplexor(
	configs []*SwxProxyConfig,
) (SwxProxiesWithHealth, error)

NewSwxProxiesWithHealthAndDefaultMultiplex creates either a single swxProxy or a SwxProxies In case of SwxProxies it uses StaticMultiplexByIMSI as a multiplexer

type SwxProxyConfig

type SwxProxyConfig struct {
	ClientCfg             *diameter.DiameterClientConfig
	ServerCfg             *diameter.DiameterServerConfig
	VerifyAuthorization   bool // should we verify non-3gpp IP access is enabled for user
	RegisterOnAuth        bool // should we send SAR REGISTER on every MAR/A
	DeriveUnregisterRealm bool // use returned maa.AAAServerName to derive Origin Realm from
	CacheTTLSeconds       uint32
	HlrPlmnIds            map[string]PlmnIdVal
}

func GetSwxProxyConfig

func GetSwxProxyConfig() []*SwxProxyConfig

GetSwxProxyConfig returns the service config based on the the values in mconfig or default values provided

func (*SwxProxyConfig) IsHlrClient

func (config *SwxProxyConfig) IsHlrClient(imsi string) bool

type VendorSpecificApplicationId

type VendorSpecificApplicationId struct {
	VendorId          uint32 `avp:"Vendor-Id"`
	AuthApplicationId uint32 `avp:"Auth-Application-Id"`
	AcctApplicationId uint32 `avp:"Acct-Application-Id"`
}

VendorSpecificApplicationId

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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