servicers

package
v1.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CheckcodeValue = "\x00\x00\x86\xe8\x20\x4d\xc6\xe1\xe3\xd8\x94\x44\x3c\x26" +
		"\xa7\xc6\x5d\xee\x3c\x42\xab\xf8"

	SqnLen    = 6
	MacAStart = 8
)

todo Replace constants with configurable fields

View Source
const (
	Auth = "\x73\xea\x5e\xdf\x10\x25\x45\x3b\x21\x15\xdb\xc2\xa9\x8a\x7c\x99"

	// MessageAuthenticatorAttrLength the length, in bytes, of the Message-Authenticator
	// attribute, including attribute Type and Length fields
	MessageAuthenticatorAttrLength uint16 = 18
)

todo Replace constants with configurable fields

View Source
const (
	EapIdentityRequestPacket = "\x01\x00\x00\x05\x01"
)

todo use a config to assign this value

View Source
const (
	IdentityPostfix = "@wlan.mnc001.mcc001.3gppnetwork.org"
)

todo Replace constants with configurable fields

Variables

This section is empty.

Functions

func ConvertStorageErrorToGrpcStatus

func ConvertStorageErrorToGrpcStatus(err error) error

ConvertStorageErrorToGrpcStatus converts a UE error into a gRPC status error.

func ExtractBytesReceived

func ExtractBytesReceived(output []byte) (float64, error)

TODO: create a new file and structs to to parse and dump iperf message extractBytesReceived returns the amount of bytes sent by the Server to the UE

func PrettyPrintIperfResponse

func PrettyPrintIperfResponse(input []byte) string

Types

type UESimConfig

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

type UESimServer

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

UESimServer tracks all the UEs being simulated.

func NewUESimServer

func NewUESimServer(factory blobstore.BlobStorageFactory) (*UESimServer, error)

NewUESimServer initializes a UESimServer with an empty store map. Output: a new UESimServer

func (*UESimServer) AddUE

func (srv *UESimServer) AddUE(ctx context.Context, ue *cwfprotos.UEConfig) (ret *protos.Void, err error)

AddUE tries to add this UE to the server. Input: The UE data which will be added.

func (*UESimServer) Authenticate

Authenticate triggers an authentication for the UE with the specified IMSI. Input: The IMSI of the UE to try to authenticate. Output: The resulting Radius packet returned by the Radius server.

func (*UESimServer) CreateEAPIdentityRequest

func (srv *UESimServer) CreateEAPIdentityRequest(imsi, calledStationID string) (*radius.Packet, error)

CreateEAPIdentityRequest simulates starting the EAP-AKA authentication by sending a UE an EAP Identity Request packet.

func (*UESimServer) Disconnect

func (*UESimServer) EapToRadius

func (srv *UESimServer) EapToRadius(eapP eap.Packet, imsi string, calledStationID string, identifier uint8) (*radius.Packet, error)

EapToRadius puts an Eap packet payload in a Radius packet.

func (*UESimServer) GenTraffic

GenTraffic generates traffic using a remote iperf server. The command to be sent is configured using GenTrafficRequest Note that GenTrafficRequest have parameter that configures iperf client itself, and parameters that configure UESim Configuration parameters related to the UESim client itself (not iperf) are:

  • timeout: if different than 0 stops iperf externally after n seconds. Use it to avoid the test to hang on a unreachable server If the test timesout it will be counted as an error. By default this is 0 (DISABLED)
  • disableServerReachabilityCheck: enables/disables the function to request the server to send the UE small packets to check if the server is alive. By default this is ENABLED

func (*UESimServer) HandleEap

func (srv *UESimServer) HandleEap(ue *cwfprotos.UEConfig, req eap.Packet) (eap.Packet, error)

HandleEAP routes the EAP request to the UE with the specified imsi.

func (*UESimServer) HandleRadius

func (srv *UESimServer) HandleRadius(imsi string, calledStationID string, p *radius.Packet) (*radius.Packet, error)

HandleRadius routes the Radius packet to the UE with the specified imsi.

func (*UESimServer) MakeAccountingStopRequest

func (srv *UESimServer) MakeAccountingStopRequest(calledStationID string) (*radius.Packet, error)

MakeAccountStopRequest creates an Accounting Stop radius packet

Jump to

Keyboard shortcuts

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