Documentation ¶
Index ¶
- Constants
- func ConvertStorageErrorToGrpcStatus(err error) error
- func ExtractBytesReceived(output []byte) (float64, error)
- func PrettyPrintIperfResponse(input []byte) string
- type UESimConfig
- type UESimServer
- func (srv *UESimServer) AddUE(ctx context.Context, ue *cwfprotos.UEConfig) (ret *protos.Void, err error)
- func (srv *UESimServer) Authenticate(ctx context.Context, id *cwfprotos.AuthenticateRequest) (*cwfprotos.AuthenticateResponse, error)
- func (srv *UESimServer) CreateEAPIdentityRequest(imsi, calledStationID string) (*radius.Packet, error)
- func (srv *UESimServer) Disconnect(ctx context.Context, id *cwfprotos.DisconnectRequest) (*cwfprotos.DisconnectResponse, error)
- func (srv *UESimServer) EapToRadius(eapP eap.Packet, imsi string, calledStationID string, identifier uint8) (*radius.Packet, error)
- func (srv *UESimServer) GenTraffic(ctx context.Context, req *cwfprotos.GenTrafficRequest) (*cwfprotos.GenTrafficResponse, error)
- func (srv *UESimServer) HandleEap(ue *cwfprotos.UEConfig, req eap.Packet) (eap.Packet, error)
- func (srv *UESimServer) HandleRadius(imsi string, calledStationID string, p *radius.Packet) (*radius.Packet, error)
- func (srv *UESimServer) MakeAccountingStopRequest(calledStationID string) (*radius.Packet, error)
Constants ¶
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
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
const (
EapIdentityRequestPacket = "\x01\x00\x00\x05\x01"
)
todo use a config to assign this value
const (
IdentityPostfix = "@wlan.mnc001.mcc001.3gppnetwork.org"
)
todo Replace constants with configurable fields
Variables ¶
This section is empty.
Functions ¶
func ConvertStorageErrorToGrpcStatus ¶
ConvertStorageErrorToGrpcStatus converts a UE error into a gRPC status error.
func ExtractBytesReceived ¶
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
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 ¶
func (srv *UESimServer) Authenticate(ctx context.Context, id *cwfprotos.AuthenticateRequest) (*cwfprotos.AuthenticateResponse, error)
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 (srv *UESimServer) Disconnect(ctx context.Context, id *cwfprotos.DisconnectRequest) (*cwfprotos.DisconnectResponse, error)
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 ¶
func (srv *UESimServer) GenTraffic(ctx context.Context, req *cwfprotos.GenTrafficRequest) (*cwfprotos.GenTrafficResponse, error)
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) 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