Documentation ¶
Index ¶
- Constants
- func ConstructMMEName() (string, error)
- func ConstructSCTPAddr(ip string, port int) *sctp.SCTPAddr
- func GetCsfbConfig() *mconfProtos.CsfbConfig
- func SplitIP(IPsandPort string) (ipStr string, portInt int, err error)
- type ClientConnectionInterface
- type CsfbServer
- func (srv *CsfbServer) AlertAc(ctx context.Context, req *protos.AlertAck) (*orcprotos.Void, error)
- func (srv *CsfbServer) AlertRej(ctx context.Context, req *protos.AlertReject) (*orcprotos.Void, error)
- func (srv *CsfbServer) EPSDetachInd(ctx context.Context, req *protos.EPSDetachIndication) (*orcprotos.Void, error)
- func (srv *CsfbServer) IMSIDetachInd(ctx context.Context, req *protos.IMSIDetachIndication) (*orcprotos.Void, error)
- func (srv *CsfbServer) LocationUpdateReq(ctx context.Context, req *protos.LocationUpdateRequest) (*orcprotos.Void, error)
- func (srv *CsfbServer) MMEResetAck(ctx context.Context, req *protos.ResetAck) (*orcprotos.Void, error)
- func (srv *CsfbServer) MMEResetIndication(ctx context.Context, req *protos.ResetIndication) (*orcprotos.Void, error)
- func (srv *CsfbServer) MMEStatus(ctx context.Context, req *protos.Status) (*orcprotos.Void, error)
- func (srv *CsfbServer) PagingRej(ctx context.Context, req *protos.PagingReject) (*orcprotos.Void, error)
- func (srv *CsfbServer) SendResetAck() error
- func (srv *CsfbServer) ServiceReq(ctx context.Context, req *protos.ServiceRequest) (*orcprotos.Void, error)
- func (srv *CsfbServer) TMSIReallocationComp(ctx context.Context, req *protos.TMSIReallocationComplete) (*orcprotos.Void, error)
- func (srv *CsfbServer) UEActivityInd(ctx context.Context, req *protos.UEActivityIndication) (*orcprotos.Void, error)
- func (srv *CsfbServer) UEUnreach(ctx context.Context, req *protos.UEUnreachable) (*orcprotos.Void, error)
- func (srv *CsfbServer) Uplink(ctx context.Context, req *protos.UplinkUnitdata) (*orcprotos.Void, error)
- type PortNumber
- type SCTPClientConnection
- func (conn *SCTPClientConnection) CloseConn() error
- func (conn *SCTPClientConnection) EstablishConn() error
- func (conn *SCTPClientConnection) GetLocalIPandPort() ([]string, int)
- func (conn *SCTPClientConnection) GetVlrIPandPort() ([]string, int)
- func (conn *SCTPClientConnection) Receive() ([]byte, error)
- func (conn *SCTPClientConnection) Send(message []byte) error
- type SCTPServerConnection
- func (conn *SCTPServerConnection) AcceptConn() error
- func (conn *SCTPServerConnection) CloseConn() error
- func (conn *SCTPServerConnection) CloseListener() error
- func (conn *SCTPServerConnection) ConnectionEstablished() bool
- func (conn *SCTPServerConnection) ReceiveThroughListener() ([]byte, error)
- func (conn *SCTPServerConnection) SendFromServer(msg []byte) error
- func (conn *SCTPServerConnection) StartListener(ipAddr string, port PortNumber) (PortNumber, error)
- type SafeBuffer
- type ServerConnectionInterface
Constants ¶
const ( DefaultMMEName = ".mmec01.mmegi0001.mme.epc.mnc001.mcc001.3gppnetwork.org" MMECLength = 2 MMEGILength = 4 MNCLength = 3 MCCLength = 3 MMEServiceName = "mme" CsfbServiceName = "csfb" )
const ( VLRAddrEnv = "VLR_ADDR" DefaultVLRIPAddress = "127.0.0.1" DefaultVLRPort = 1357 LocalAddrEnv = "SGS_LOCAL_ADDR" LocalIPAddress = "127.0.0.1" LocalPort = 0 )
const (
TimeOut = 1 // TimeOut in second for reading a chunk
)
Variables ¶
This section is empty.
Functions ¶
func ConstructMMEName ¶
TODO: MME should be gathered from the gRPC request not hardcoded/fixed per feg ConstructMMEName constructs MME name from mconfig
func ConstructSCTPAddr ¶
Suports strings with multiple IP comma separated like "ip" or "ip1,ip2,ip3"
func GetCsfbConfig ¶
func GetCsfbConfig() *mconfProtos.CsfbConfig
Types ¶
type ClientConnectionInterface ¶
type ClientConnectionInterface interface { // Establish connection to a remote server through DialSCTP from client side EstablishConn() error // Close the established connection from client side CloseConn() error // Send data through the established connection from client side Send(message []byte) error // Receive data through the established connection in client side Receive() ([]byte, error) }
type CsfbServer ¶
type CsfbServer struct { Conn ClientConnectionInterface ReceivingBuffer SafeBuffer }
func NewCsfbServer ¶
func NewCsfbServer(ConnectionInterface ClientConnectionInterface) (*CsfbServer, error)
func (*CsfbServer) AlertAc ¶
func (srv *CsfbServer) AlertAc( ctx context.Context, req *protos.AlertAck, ) (*orcprotos.Void, error)
AlertAc sends SGsAP-ALERT-ACK to VLR to acknowledge a previous SGsAP-ALERT-REQUEST message
func (*CsfbServer) AlertRej ¶
func (srv *CsfbServer) AlertRej( ctx context.Context, req *protos.AlertReject, ) (*orcprotos.Void, error)
AlertRej sends SGsAP-ALERT-REJECT to VLR to indicate that the MME could not identify the IMSI indicated in the SGsAP-ALERT-REQUEST message
func (*CsfbServer) EPSDetachInd ¶
func (srv *CsfbServer) EPSDetachInd( ctx context.Context, req *protos.EPSDetachIndication, ) (*orcprotos.Void, error)
EPSDetachInd sends SGsAP-EPS-DETACH-INDICATION to VLR to indicate an EPS detach performed from the UE or the MME
func (*CsfbServer) IMSIDetachInd ¶
func (srv *CsfbServer) IMSIDetachInd( ctx context.Context, req *protos.IMSIDetachIndication, ) (*orcprotos.Void, error)
IMSIDetachInd sends SGsAP-IMSI-DETACH-INDICATION to VLR to indicate an IMSI detach performed from the UE
func (*CsfbServer) LocationUpdateReq ¶
func (srv *CsfbServer) LocationUpdateReq( ctx context.Context, req *protos.LocationUpdateRequest, ) (*orcprotos.Void, error)
LocationUpdateReq sends SGsAP-LOCATION-UPDATE-REQUEST to VLR either to request update of its location file (normal update) or to request IMSI attach
func (*CsfbServer) MMEResetAck ¶
func (srv *CsfbServer) MMEResetAck( ctx context.Context, req *protos.ResetAck, ) (*orcprotos.Void, error)
MMEResetAck sends SGsAP-RESET-ACK to VLR to acknowledge a previous SGsAP-RESET-INDICATION message. This message indicates that all the SGs associations to the VLR or the MME have been marked as invalid.
func (*CsfbServer) MMEResetIndication ¶
func (srv *CsfbServer) MMEResetIndication( ctx context.Context, req *protos.ResetIndication, ) (*orcprotos.Void, error)
MMEResetIndication sends SGsAP-RESET-INDICATION to VLR to indicate that a failure in the MME has occurred and all the SGs associations to the MME are be marked as invalid.
func (*CsfbServer) MMEStatus ¶
func (srv *CsfbServer) MMEStatus( ctx context.Context, req *protos.Status, ) (*orcprotos.Void, error)
MMEStatus sends SGsAP-STATUS to VLR to indicate an error
func (*CsfbServer) PagingRej ¶
func (srv *CsfbServer) PagingRej( ctx context.Context, req *protos.PagingReject, ) (*orcprotos.Void, error)
PagingRej sends SGsAP-PAGING-REJECT to VLR to indicate that the delivery of a previous SGsAP-PAGING-REQUEST message has failed
func (*CsfbServer) SendResetAck ¶
func (srv *CsfbServer) SendResetAck() error
SendResetAck sends SGsAP-RESET-ACK to VLR Different from the MMEResetAck invoked by the gateway through GRPC, SendResetAck is invoked in the FeG as soon as the SGsAP-RESET-INDICATION is received and decoded.
func (*CsfbServer) ServiceReq ¶
func (srv *CsfbServer) ServiceReq( ctx context.Context, req *protos.ServiceRequest, ) (*orcprotos.Void, error)
ServiceReq sends SGsAP-SERVICE-REQUEST to VLR as a response to a previously received SGsAP-PAGING-REQUEST message to indicate the existence of a NAS signalling Connection between the UE and the MME or to indicate to the VLR that the NAS signalling Connection has been established after the paging procedure
func (*CsfbServer) TMSIReallocationComp ¶
func (srv *CsfbServer) TMSIReallocationComp( ctx context.Context, req *protos.TMSIReallocationComplete, ) (*orcprotos.Void, error)
TMSIReallocationComp sends SGsAP-TMSI-REALLOCATION-COMPLETE to VLR to indicate that TMSI reallocation on the UE has been successfully completed
func (*CsfbServer) UEActivityInd ¶
func (srv *CsfbServer) UEActivityInd( ctx context.Context, req *protos.UEActivityIndication, ) (*orcprotos.Void, error)
UEActivityInd sends SGsAP-UE-ACTIVITY-INDICATION to VLR to indicate that activity from a UE has been detected
func (*CsfbServer) UEUnreach ¶
func (srv *CsfbServer) UEUnreach( ctx context.Context, req *protos.UEUnreachable, ) (*orcprotos.Void, error)
UEUnreach sends SGsAP-UE-UNREACHABLE to VLR to indicate that, for example, paging could not be performed because the UE is marked as unreachable at the MME
func (*CsfbServer) Uplink ¶
func (srv *CsfbServer) Uplink( ctx context.Context, req *protos.UplinkUnitdata, ) (*orcprotos.Void, error)
Uplink sends SGsAP-UPLINK-UNITDATA to VLR to transparently convey a NAS message, from the UE, to the VLR
type PortNumber ¶
type PortNumber = int
type SCTPClientConnection ¶
type SCTPClientConnection struct {
// contains filtered or unexported fields
}
func CreateVlrSCTPconnection ¶
func CreateVlrSCTPconnection(config *mconfig.CsfbConfig) (*SCTPClientConnection, error)
func NewSCTPClientConnection ¶
func (*SCTPClientConnection) CloseConn ¶
func (conn *SCTPClientConnection) CloseConn() error
func (*SCTPClientConnection) EstablishConn ¶
func (conn *SCTPClientConnection) EstablishConn() error
func (*SCTPClientConnection) GetLocalIPandPort ¶
func (conn *SCTPClientConnection) GetLocalIPandPort() ([]string, int)
func (*SCTPClientConnection) GetVlrIPandPort ¶
func (conn *SCTPClientConnection) GetVlrIPandPort() ([]string, int)
func (*SCTPClientConnection) Receive ¶
func (conn *SCTPClientConnection) Receive() ([]byte, error)
func (*SCTPClientConnection) Send ¶
func (conn *SCTPClientConnection) Send(message []byte) error
type SCTPServerConnection ¶
type SCTPServerConnection struct {
// contains filtered or unexported fields
}
func NewSCTPServerConnection ¶
func NewSCTPServerConnection() (*SCTPServerConnection, error)
func (*SCTPServerConnection) AcceptConn ¶
func (conn *SCTPServerConnection) AcceptConn() error
func (*SCTPServerConnection) CloseConn ¶
func (conn *SCTPServerConnection) CloseConn() error
func (*SCTPServerConnection) CloseListener ¶
func (conn *SCTPServerConnection) CloseListener() error
func (*SCTPServerConnection) ConnectionEstablished ¶
func (conn *SCTPServerConnection) ConnectionEstablished() bool
func (*SCTPServerConnection) ReceiveThroughListener ¶
func (conn *SCTPServerConnection) ReceiveThroughListener() ([]byte, error)
func (*SCTPServerConnection) SendFromServer ¶
func (conn *SCTPServerConnection) SendFromServer(msg []byte) error
func (*SCTPServerConnection) StartListener ¶
func (conn *SCTPServerConnection) StartListener(ipAddr string, port PortNumber) (PortNumber, error)
type SafeBuffer ¶
SafeBuffer has a list used like a buffer with protection of mutex
func NewSafeBuffer ¶
func NewSafeBuffer() (*SafeBuffer, error)
NewSafeBuffer returns a SafeBuffer with writeSignal channel initialized
func (*SafeBuffer) GetNextMessage ¶
func (safeBuffer *SafeBuffer) GetNextMessage(timeOutInSec int) (decode.SGsMessageType, *any.Any, error)
GetNextMessage reads the next message in the buffer and decode the message
func (*SafeBuffer) WriteChunk ¶
func (safeBuffer *SafeBuffer) WriteChunk(chunk []byte) (int, error)
WriteChunk writes a chunk of bytes to the list
type ServerConnectionInterface ¶
type ServerConnectionInterface interface { // Start a SCTP listener from server side StartListener(ipAddr string, port PortNumber) (PortNumber, error) // Close the active SCTP listener from server side CloseListener() error // Check if any connection is established ConnectionEstablished() bool // Accept connection from client AcceptConn() error // Close connection from client CloseConn() error // Receive data through the active listener in server side ReceiveThroughListener() ([]byte, error) // Send data through the established connection from server side SendFromServer([]byte) error }