Documentation ¶
Overview ¶
Package service implements S6a GRPC proxy service which sends AIR, ULR messages over diameter connection, waits (blocks) for diameter's AIAs, ULAs & returns their RPC representation
package service implements S6a GRPC proxy service which sends AIR, ULR messages over diameter connection, waits (blocks) for diameter's AIAs, ULAs & returns their RPC representation It also handles CLR, sends sync rpc request to gateway, then returns a CLA over diameter connection.
Package servicers implements S6a GRPC proxy service which sends AIR, ULR, PUR messages over diameter connection, waits (blocks) for diameter's AIAs, ULAs, PURs & returns their RPC representation
Package service implements S6a GRPC proxy service which sends AIR, ULR messages over diameter connection, waits (blocks) for diameter's AIAs, ULAs & returns their RPC representation It also handles CLR & RSR sends sync rpc request to gateway, then returns a CLA/RSA over diameter connection.
package servce implements S6a GRPC proxy service which sends AIR, ULR messages over diameter connection, waits (blocks) for diameter's AIAs, ULAs & returns their RPC representation
package servce implements S6a GRPC proxy service which sends AIR, ULR messages over diameter connection, waits (blocks) for diameter's AIAs, ULAs & returns their RPC representation
Package service implements S6a GRPC proxy service which sends AIR, ULR messages over diameter connection, waits (blocks) for diameter's AIAs, ULAs & returns their RPC representation
package servce implements S6a GRPC proxy service which sends AIR, ULR messages over diameter connection, waits (blocks) for diameter's AIAs, ULAs & returns their RPC representation
Index ¶
- Constants
- func Error(code codes.Code, err error) error
- func Errorf(code codes.Code, format string, a ...interface{}) error
- func GetS6aProxyConfigs() (*diameter.DiameterClientConfig, *diameter.DiameterServerConfig)
- func NewS6aProxy(clientCfg *diameter.DiameterClientConfig, ...) (*s6aProxy, error)
- type AIA
- type AIR
- type AMBR
- type APNConfiguration
- type APNConfigurationProfile
- type AllocationRetentionPriority
- type AuthenticationInfo
- type CLR
- type EPSSubscribedQoSProfile
- type EUtranVector
- type ExperimentalResult
- type OCSupportedFeatures
- type OC_OLR
- type PUA
- type PUR
- type RSR
- type RequestedEUTRANAuthInfo
- type SubscriptionData
- type SupportedFeatures
- type ULA
- type ULR
- type VendorSpecificApplicationId
Constants ¶
const ( MaxSyncRPCRetries = 3 MaxDiamClRetries = 3 )
const ( HSSAddrEnv = "HSS_ADDR" S6aNetworkEnv = "S6A_NETWORK" S6aDiamHostEnv = "S6A_DIAM_HOST" S6aDiamRealmEnv = "S6A_DIAM_REALM" S6aDiamProductEnv = "S6A_DIAM_PRODUCT" S6aLocalAddrEnv = "S6A_LOCAL_ADDR" HSSHostEnv = "HSS_HOST" HSSRealmEnv = "HSS_REALM" DisableDestHostEnv = "DISABLE_DEST_HOST" OverwriteDestHostEnv = "OVERWRITE_DEST_HOST" S6aProxyServiceName = "s6a_proxy" DefaultS6aDiamRealm = "epc.mnc070.mcc722.3gppnetwork.org" DefaultS6aDiamHost = "feg-s6a.epc.mnc070.mcc722.3gppnetwork.org" )
S6a Environment Variables to overwrite default configs
const ( ULR_RAT_TYPE = 1004 ULR_FLAGS = 1<<1 | 1<<5 TIMEOUT_SECONDS = 10 MAX_DIAM_RETRIES = 1 )
const (
// MaxDiamRsRetries - number of retries for forwarding RSR to a gateway
MaxDiamRsRetries = 1
)
const (
// 3GPP 29.273 5.2.3.6
RadioAccessTechnologyType_EUTRAN = 1004
)
Variables ¶
This section is empty.
Functions ¶
func GetS6aProxyConfigs ¶
func GetS6aProxyConfigs() (*diameter.DiameterClientConfig, *diameter.DiameterServerConfig)
Get GetS6aProxyConfigs returns the server config for an HSS based on the input flags and environment variables
func NewS6aProxy ¶
func NewS6aProxy( clientCfg *diameter.DiameterClientConfig, serverCfg *diameter.DiameterServerConfig, ) (*s6aProxy, error)
Types ¶
type AIA ¶
type AIA 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"` AIs []AuthenticationInfo `avp:"Authentication-Info"` }
type AIR ¶
type AIR struct { SessionID datatype.UTF8String `avp:"Session-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"` VisitedPLMNID datatype.Unsigned32 `avp:"Visited-PLMN-Id"` RequestedEUTRANAuthInfo RequestedEUTRANAuthInfo `avp:"Requested-EUTRAN-Authentication-Info"` }
AIR encapsulates all of the information contained in an authentication information request. This information is sent to fetch data in order to authenticate a subscriber.
type AMBR ¶
type AMBR struct { MaxRequestedBandwidthUL uint32 `avp:"Max-Requested-Bandwidth-UL"` MaxRequestedBandwidthDL uint32 `avp:"Max-Requested-Bandwidth-DL"` }
Definitions for ULA, see sample below:
Update-Location-Answer (ULA) {Code:316,Flags:0x40,Version:0x1,Length:516,ApplicationId:16777251,HopByHopId:0x22910d0a,EndToEndId:0x8d330652}
Session-Id {Code:263,Flags:0x40,Length:24,VendorId:0,Value:UTF8String{session;89988919},Padding:0} ULA-Flags {Code:1406,Flags:0xc0,Length:16,VendorId:10415,Value:Unsigned32{1}} Subscription-Data {Code:1400,Flags:0xc0,Length:380,VendorId:10415,Value:Grouped{ MSISDN {Code:701,Flags:0xc0,Length:20,VendorId:10415,Value:OctetString{0x33638060010f},Padding:2}, Access-Restriction-Data {Code:1426,Flags:0xc0,Length:16,VendorId:10415,Value:Unsigned32{47}}, Subscriber-Status {Code:1424,Flags:0xc0,Length:16,VendorId:10415,Value:Enumerated{0}}, Network-Access-Mode {Code:1417,Flags:0xc0,Length:16,VendorId:10415,Value:Enumerated{2}}, AMBR {Code:1435,Flags:0xc0,Length:44,VendorId:10415,Value:Grouped{ Max-Requested-Bandwidth-UL {Code:516,Flags:0xc0,Length:16,VendorId:10415,Value:Unsigned32{50000000}}, Max-Requested-Bandwidth-DL {Code:515,Flags:0xc0,Length:16,VendorId:10415,Value:Unsigned32{100000000}}, }} APN-Configuration-Profile {Code:1429,Flags:0xc0,Length:240,VendorId:10415,Value:Grouped{ Context-Identifier {Code:1423,Flags:0xc0,Length:16,VendorId:10415,Value:Unsigned32{0}}, All-APN-Configurations-Included-Indicator {Code:1428,Flags:0xc0,Length:16,VendorId:10415,Value:Enumerated{0}}, APN-Configuration {Code:1430,Flags:0xc0,Length:196,VendorId:10415,Value:Grouped{ Context-Identifier {Code:1423,Flags:0xc0,Length:16,VendorId:10415,Value:Unsigned32{0}}, PDN-Type {Code:1456,Flags:0xc0,Length:16,VendorId:10415,Value:Enumerated{0}}, Service-Selection {Code:493,Flags:0xc0,Length:20,VendorId:10415,Value:UTF8String{oai.ipv4},Padding:0}, EPS-Subscribed-QoS-Profile {Code:1431,Flags:0xc0,Length:88,VendorId:10415,Value:Grouped{ QoS-Class-Identifier {Code:1028,Flags:0xc0,Length:16,VendorId:10415,Value:Enumerated{9}}, Allocation-Retention-Priority {Code:1034,Flags:0x80,Length:60,VendorId:10415,Value:Grouped{ Priority-Level {Code:1046,Flags:0x80,Length:16,VendorId:10415,Value:Unsigned32{15}}, Pre-emption-Capability {Code:1047,Flags:0x80,Length:16,VendorId:10415,Value:Enumerated{1}}, Pre-emption-Vulnerability {Code:1048,Flags:0x80,Length:16,VendorId:10415,Value:Enumerated{0}}, }} }} AMBR {Code:1435,Flags:0xc0,Length:44,VendorId:10415,Value:Grouped{ Max-Requested-Bandwidth-UL {Code:516,Flags:0xc0,Length:16,VendorId:10415,Value:Unsigned32{50000000}}, Max-Requested-Bandwidth-DL {Code:515,Flags:0xc0,Length:16,VendorId:10415,Value:Unsigned32{100000000}}, }} }} }} Subscribed-Periodic-RAU-TAU-Timer {Code:1619,Flags:0x80,Length:16,VendorId:10415,Value:Unsigned32{120}}, }} Auth-Session-State {Code:277,Flags:0x40,Length:12,VendorId:0,Value:Enumerated{0}} Origin-Host {Code:264,Flags:0x40,Length:28,VendorId:0,Value:DiameterIdentity{hss.openair4G.eur},Padding:3} Origin-Realm {Code:296,Flags:0x40,Length:24,VendorId:0,Value:DiameterIdentity{openair4G.eur},Padding:3} Result-Code {Code:268,Flags:0x40,Length:12,VendorId:0,Value:Unsigned32{2001}}
type APNConfiguration ¶
type APNConfiguration struct { ContextIdentifier uint32 `avp:"Context-Identifier"` PDNType uint32 `avp:"PDN-Type"` ServiceSelection string `avp:"Service-Selection"` EPSSubscribedQoSProfile EPSSubscribedQoSProfile `avp:"EPS-Subscribed-QoS-Profile"` AMBR AMBR `avp:"AMBR"` }
type APNConfigurationProfile ¶
type APNConfigurationProfile struct { ContextIdentifier uint32 `avp:"Context-Identifier"` AllAPNConfigurationsIncludedIndicator int32 `avp:"All-APN-Configurations-Included-Indicator"` APNConfigs []APNConfiguration `avp:"APN-Configuration"` }
type AuthenticationInfo ¶
type AuthenticationInfo struct {
EUtranVectors []EUtranVector `avp:"E-UTRAN-Vector"`
}
type CLR ¶
type CLR struct { SessionID string `avp:"Session-Id"` AuthSessionState int32 `avp:"Auth-Session-State"` OriginHost datatype.DiameterIdentity `avp:"Origin-Host"` OriginRealm datatype.DiameterIdentity `avp:"Origin-Realm"` CancellationType int32 `avp:"Cancellation-Type"` DestinationHost datatype.DiameterIdentity `avp:"Destination-Host"` DestinationRealm datatype.DiameterIdentity `avp:"Destination-Realm"` UserName string `avp:"User-Name"` }
type EPSSubscribedQoSProfile ¶
type EPSSubscribedQoSProfile struct { QoSClassIdentifier int32 `avp:"QoS-Class-Identifier"` AllocationRetentionPriority AllocationRetentionPriority `avp:"Allocation-Retention-Priority"` }
type EUtranVector ¶
type EUtranVector struct { RAND datatype.OctetString `avp:"RAND"` XRES datatype.OctetString `avp:"XRES"` AUTN datatype.OctetString `avp:"AUTN"` KASME datatype.OctetString `avp:"KASME"` }
type ExperimentalResult ¶
type OCSupportedFeatures ¶
type OCSupportedFeatures struct {
OCFeatureVector uint64 `avp:"OC-Feature-Vector"`
}
OCSupportedFeatures -> OC-Supported-Features AVP
type OC_OLR ¶
type OC_OLR struct { OCSequenceNumber uint64 `avp:"OC-Sequence-Number"` OCReportType uint32 `avp:"OC-Report-Type"` OCReductionPercentage uint32 `avp:"OC-Reduction-Percentage"` OCValidityDuration uint32 `avp:"OC-Validity-Duration"` }
OC_OLR -> OC-OLR AVP
type PUA ¶
type PUA struct { SessionID string `avp:"Session-Id"` DRMP uint32 `avp:"DRMP"` VendorSpecificApplicationId VendorSpecificApplicationId `avp:"Vendor-Specific-Application-Id"` SupportedFeatures []SupportedFeatures `avp:"Supported-Features"` ResultCode uint32 `avp:"Result-Code"` ExperimentalResult ExperimentalResult `avp:"Experimental-Result"` AuthSessionState int32 `avp:"Auth-Session-State"` OriginHost datatype.DiameterIdentity `avp:"Origin-Host"` OriginRealm datatype.DiameterIdentity `avp:"Origin-Realm"` OCSupportedFeatures OCSupportedFeatures `avp:"OC-Supported-Features"` OC_OLR OC_OLR `avp:"OC-OLR"` PUAFlags uint32 `avp:"PUA-Flags"` }
PUA is Go representation of Purge-UE-Answer message
< Purge-UE-Answer> ::= < Diameter Header: 321, PXY, 16777251 > < Session-Id > [ DRMP ] [ Vendor-Specific-Application-Id ] *[ Supported-Features ] [ Result-Code ] [ Experimental-Result ] { Auth-Session-State } { Origin-Host } { Origin-Realm } [ OC-Supported-Features ] [ OC-OLR ] *[ Load ] [ PUA-Flags ] *[ AVP ] [ Failed-AVP ] *[ Proxy-Info ] *[ Route-Record ]
type PUR ¶
type PUR struct { SessionID string `avp:"Session-Id"` DRMP uint32 `avp:"DRMP"` VendorSpecificApplicationId VendorSpecificApplicationId `avp:"Vendor-Specific-Application-Id"` AuthSessionState int32 `avp:"Auth-Session-State"` OriginHost datatype.DiameterIdentity `avp:"Origin-Host"` OriginRealm datatype.DiameterIdentity `avp:"Origin-Realm"` DestinationHost datatype.DiameterIdentity `avp:"Destination-Host"` DestinationRealm datatype.DiameterIdentity `avp:"Destination-Realm"` UserName datatype.UTF8String `avp:"User-Name"` OCSupportedFeatures OCSupportedFeatures `avp:"OC-Supported-Features"` PURFlags uint32 `avp:"PUR-Flags"` SupportedFeatures []SupportedFeatures `avp:"Supported-Features"` }
Definitions for PU
PUR is Go representation of Purge-UE-Request message
< Purge-UE-Request> ::= < Diameter Header: 321, REQ, PXY, 16777251 > < Session-Id > [ DRMP ] [ Vendor-Specific-Application-Id ] { Auth-Session-State } { Origin-Host } { Origin-Realm } [ Destination-Host ] { Destination-Realm } { User-Name } [ OC-Supported-Features ] [ PUR-Flags ] *[ Supported-Features ] [ EPS-Location-Information ] *[ AVP ] *[ Proxy-Info ] *[ Route-Record ]
type RSR ¶
type RSR struct { SessionID string `avp:"Session-Id"` VendorSpecificApplicationId VendorSpecificApplicationId `avp:"Vendor-Specific-Application-Id"` AuthSessionState int32 `avp:"Auth-Session-State"` OriginHost datatype.DiameterIdentity `avp:"Origin-Host"` OriginRealm datatype.DiameterIdentity `avp:"Origin-Realm"` DestinationHost datatype.DiameterIdentity `avp:"Destination-Host"` DestinationRealm datatype.DiameterIdentity `avp:"Destination-Realm"` SupportedFeatures []SupportedFeatures `avp:"Supported-Features"` UserId []datatype.UTF8String `avp:"User-Id"` }
RSR is Go representation of Reset-Request message
< Reset-Request> ::= < Diameter Header: 322, REQ, PXY, 16777251 >
< Session-Id > [ Vendor-Specific-Application-Id ] { Auth-Session-State } { Origin-Host } { Origin-Realm } { Destination-Host } { Destination-Realm } *[ Supported-Features ] *[ User-Id ] *[ AVP ] *[ Proxy-Info ] *[ Route-Record ]
type RequestedEUTRANAuthInfo ¶
type RequestedEUTRANAuthInfo struct { NumVectors datatype.Unsigned32 `avp:"Number-Of-Requested-Vectors"` ImmediateResponse datatype.Unsigned32 `avp:"Immediate-Response-Preferred"` ResyncInfo datatype.OctetString `avp:"Re-synchronization-Info"` }
RequestedEUTRANAuthInfo contains the information needed for authentication requests for E-UTRAN.
type SubscriptionData ¶
type SubscriptionData struct { MSISDN datatype.OctetString `avp:"MSISDN"` AccessRestrictionData uint32 `avp:"Access-Restriction-Data"` SubscriberStatus int32 `avp:"Subscriber-Status"` NetworkAccessMode int32 `avp:"Network-Access-Mode"` AMBR AMBR `avp:"AMBR"` APNConfigurationProfile APNConfigurationProfile `avp:"APN-Configuration-Profile"` SubscribedPeriodicRauTauTimer uint32 `avp:"Subscribed-Periodic-RAU-TAU-Timer"` }
type SupportedFeatures ¶
type SupportedFeatures struct { VendorId uint32 `avp:"Vendor-Id"` FeatureListID uint32 `avp:"Feature-List-ID"` FeatureList uint32 `avp:"Feature-List"` }
SupportedFeatures -> Supported-Features AVP
type ULA ¶
type ULA struct { SessionID string `avp:"Session-Id"` ULAFlags uint32 `avp:"ULA-Flags"` SubscriptionData SubscriptionData `avp:"Subscription-Data"` 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"` }
type ULR ¶
type ULR struct { SessionID datatype.UTF8String `avp:"Session-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"` VisitedPLMNID datatype.Unsigned32 `avp:"Visited-PLMN-Id"` RATType datatype.Unsigned32 `avp:"RAT-Type"` ULRFlags datatype.Unsigned32 `avp:"ULR-Flags"` }
ULR is an update location request. It is used to update location information in the HSS.
type VendorSpecificApplicationId ¶
type VendorSpecificApplicationId struct { VendorId uint32 `avp:"Vendor-Id"` AuthApplicationId uint32 `avp:"Auth-Application-Id"` AcctApplicationId uint32 `avp:"Acct-Application-Id"` }
VendorSpecificApplicationId -> Vendor-Specific-Application-Id AVP