message

package
v0.8.10 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 7 Imported by: 3

Documentation

Overview

Package message provides encoding/decoding feature of GTPv1 protocol.

Index

Constants

View Source
const (
	ExtHeaderTypeNoMoreExtensionHeaders                 uint8 = 0b00000000
	ExtHeaderTypeMBMSSupportIndication                  uint8 = 0b00000001
	ExtHeaderTypeMSInfoChangeReportingSupportIndication uint8 = 0b00000010
	ExtHeaderTypeLongPDCPPDUNumber                      uint8 = 0b00000011
	ExtHeaderTypeServiceClassIndicator                  uint8 = 0b00100000
	ExtHeaderTypeUDPPort                                uint8 = 0b01000000
	ExtHeaderTypeRANContainer                           uint8 = 0b10000001
	ExtHeaderTypeLongPDCPPDUNumberRequired              uint8 = 0b10000010
	ExtHeaderTypeXwRANContainer                         uint8 = 0b10000011
	ExtHeaderTypeNRRANContainer                         uint8 = 0b10000100
	ExtHeaderTypePDUSessionContainer                    uint8 = 0b10000101
	ExtHeaderTypePDCPPDUNumber                          uint8 = 0b11000000
	ExtHeaderTypeSuspendRequest                         uint8 = 0b11000001
	ExtHeaderTypeSuspendResponse                        uint8 = 0b11000010
)

ExtensionHeaderType definitions.

View Source
const (
	MsgTypeEchoRequest uint8
	MsgTypeEchoResponse
	MsgTypeVersionNotSupported
	MsgTypeNodeAliveRequest
	MsgTypeNodeAliveResponse
	MsgTypeRedirectionRequest
	MsgTypeRedirectionResponse

	MsgTypeCreatePDPContextRequest // 16
	MsgTypeCreatePDPContextResponse
	MsgTypeUpdatePDPContextRequest
	MsgTypeUpdatePDPContextResponse
	MsgTypeDeletePDPContextRequest
	MsgTypeDeletePDPContextResponse
	MsgTypeCreateAAPDPContextRequest
	MsgTypeCreateAAPDPContextResponse
	MsgTypeDeleteAAPDPContextRequest
	MsgTypeDeleteAAPDPContextResponse
	MsgTypeErrorIndication
	MsgTypePDUNotificationRequest
	MsgTypePDUNotificationResponse
	MsgTypePDUNotificationRejectRequest
	MsgTypePDUNotificationRejectResponse
	MsgTypeSupportedExtensionHeaderNotification
	MsgTypeSendRoutingInfoRequest
	MsgTypeSendRoutingInfoResponse
	MsgTypeFailureReportRequest
	MsgTypeFailureReportResponse
	MsgTypeNoteMSPresentRequest
	MsgTypeNoteMSPresentResponse

	MsgTypeIdentificationRequest // 48
	MsgTypeIdentificationResponse
	MsgTypeSGSNContextRequest
	MsgTypeSGSNContextResponse
	MsgTypeSGSNContextAcknowledge
	MsgTypeDataRecordTransferRequest  uint8 = 240
	MsgTypeDataRecordTransferResponse uint8 = 241
	MsgTypeEndMarker                  uint8 = 254
	MsgTypeTPDU                       uint8 = 255
)

Message Type definitions.

Variables

View Source
var (
	ErrInvalidLength      = errors.New("got invalid length ")
	ErrTooShortToMarshal  = errors.New("too short to serialize")
	ErrTooShortToParse    = errors.New("too short to decode as GTPv1")
	ErrInvalidMessageType = errors.New("got invalid message type")
)

Error definitions.

Functions

func Marshal

func Marshal(g Message) ([]byte, error)

Marshal returns the byte sequence generated from a Message instance. Better to use MarshalXxx instead if you know the name of message to be serialized.

func NewHeaderFlags

func NewHeaderFlags(v, p, e, s, n int) uint8

NewHeaderFlags returns a Header Flag built by its components given as arguments.

func Prettify added in v0.7.19

func Prettify(m Message) string

Prettify returns a Message in prettified representation in string.

Note that this relies much on reflect package, and thus the frequent use of this function may have a serious impact on the performance of your software.

func Serialize deprecated

func Serialize(m Message) ([]byte, error)

Serialize serializes Message into bytes.

Deprecated: use Marshal instead.

Types

type CreatePDPContextRequest

type CreatePDPContextRequest struct {
	*Header
	IMSI                               *ie.IE
	RAI                                *ie.IE
	Recovery                           *ie.IE
	SelectionMode                      *ie.IE
	TEIDDataI                          *ie.IE
	TEIDCPlane                         *ie.IE
	NSAPI                              *ie.IE
	LinkedNSAPI                        *ie.IE
	ChargingCharacteristics            *ie.IE
	TraceReference                     *ie.IE
	TraceType                          *ie.IE
	EndUserAddress                     *ie.IE
	APN                                *ie.IE
	PCO                                *ie.IE
	SGSNAddressForSignalling           *ie.IE
	SGSNAddressForUserTraffic          *ie.IE
	MSISDN                             *ie.IE
	QoSProfile                         *ie.IE
	TFT                                *ie.IE
	TriggerID                          *ie.IE
	OMCIdentity                        *ie.IE
	CommonFlags                        *ie.IE
	APNRestriction                     *ie.IE
	RATType                            *ie.IE
	UserLocationInformation            *ie.IE
	MSTimeZone                         *ie.IE
	IMEI                               *ie.IE
	CAMELChargingInformationContainer  *ie.IE
	AdditionalTraceInfo                *ie.IE
	CorrelationID                      *ie.IE
	EvolvedARPI                        *ie.IE
	ExtendedCommonFlags                *ie.IE
	UCI                                *ie.IE
	APNAMBR                            *ie.IE
	SignallingPriorityIndication       *ie.IE
	CNOperatorSelectionEntity          *ie.IE
	MappedUEUsageType                  *ie.IE
	UPFunctionSelectionIndicationFlags *ie.IE
	PrivateExtension                   *ie.IE
	AdditionalIEs                      []*ie.IE
}

CreatePDPContextRequest is a CreatePDPContextRequest Header and its IEs above.

func DecodeCreatePDPContextRequest deprecated

func DecodeCreatePDPContextRequest(b []byte) (*CreatePDPContextRequest, error)

DecodeCreatePDPContextRequest decodes bytes as CreatePDPContextRequest.

Deprecated: use ParseCreatePDPContextRequest instead.

func NewCreatePDPContextRequest

func NewCreatePDPContextRequest(teid uint32, seq uint16, ies ...*ie.IE) *CreatePDPContextRequest

NewCreatePDPContextRequest creates a new GTPv1 CreatePDPContextRequest.

func ParseCreatePDPContextRequest

func ParseCreatePDPContextRequest(b []byte) (*CreatePDPContextRequest, error)

ParseCreatePDPContextRequest decodes a given byte sequence as a CreatePDPContextRequest.

func (*CreatePDPContextRequest) DecodeFromBytes deprecated

func (c *CreatePDPContextRequest) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as CreatePDPContextRequest.

Deprecated: use CreatePDPContextRequest.UnmarshalBinary instead.

func (*CreatePDPContextRequest) Len deprecated

func (c *CreatePDPContextRequest) Len() int

Len returns the actual length of CreatePDPContextRequest.

Deprecated: use CreatePDPContextRequest.MarshalLen instead.

func (*CreatePDPContextRequest) Marshal

func (c *CreatePDPContextRequest) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a CreatePDPContextRequest.

func (*CreatePDPContextRequest) MarshalLen

func (c *CreatePDPContextRequest) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*CreatePDPContextRequest) MarshalTo

func (c *CreatePDPContextRequest) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*CreatePDPContextRequest) MessageTypeName

func (c *CreatePDPContextRequest) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*CreatePDPContextRequest) Serialize deprecated

func (c *CreatePDPContextRequest) Serialize() ([]byte, error)

Serialize serializes CreatePDPContextRequest into bytes.

Deprecated: use CreatePDPContextRequest.Marshal instead.

func (*CreatePDPContextRequest) SerializeTo deprecated

func (c *CreatePDPContextRequest) SerializeTo(b []byte) error

SerializeTo serializes CreatePDPContextRequest into bytes given as b.

Deprecated: use CreatePDPContextRequest.MarshalTo instead.

func (*CreatePDPContextRequest) SetLength

func (c *CreatePDPContextRequest) SetLength()

SetLength sets the length in Length field.

func (*CreatePDPContextRequest) TEID

func (c *CreatePDPContextRequest) TEID() uint32

TEID returns the TEID in human-readable string.

func (*CreatePDPContextRequest) UnmarshalBinary

func (c *CreatePDPContextRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a CreatePDPContextRequest.

type CreatePDPContextResponse

type CreatePDPContextResponse struct {
	*Header
	Cause                         *ie.IE
	ReorderingRequired            *ie.IE
	Recovery                      *ie.IE
	TEIDDataI                     *ie.IE
	TEIDCPlane                    *ie.IE
	NSAPI                         *ie.IE
	ChargingID                    *ie.IE
	EndUserAddress                *ie.IE
	PCO                           *ie.IE
	GGSNAddressForCPlane          *ie.IE
	GGSNAddressForUserTraffic     *ie.IE
	AltGGSNAddressForCPlane       *ie.IE
	AltGGSNAddressForUserTraffic  *ie.IE
	QoSProfile                    *ie.IE
	ChargingGatewayAddress        *ie.IE
	AltChargingGatewayAddress     *ie.IE
	CommonFlags                   *ie.IE
	APNRestriction                *ie.IE
	MSInfoChangeReportingAction   *ie.IE
	BearerControlMode             *ie.IE
	EvolvedARPI                   *ie.IE
	ExtendedCommonFlags           *ie.IE
	CSGInformationReportingAction *ie.IE
	APNAMBR                       *ie.IE
	GGSNBackOffTime               *ie.IE
	ExtendedCommonFlagsII         *ie.IE
	PrivateExtension              *ie.IE
	AdditionalIEs                 []*ie.IE
}

CreatePDPContextResponse is a CreatePDPContextResponse Header and its IEs above.

func DecodeCreatePDPContextResponse deprecated

func DecodeCreatePDPContextResponse(b []byte) (*CreatePDPContextResponse, error)

DecodeCreatePDPContextResponse decodes bytes as CreatePDPContextResponse.

Deprecated: use ParseCreatePDPContextResponse instead.

func NewCreatePDPContextResponse

func NewCreatePDPContextResponse(teid uint32, seq uint16, ies ...*ie.IE) *CreatePDPContextResponse

NewCreatePDPContextResponse creates a new GTPv1 CreatePDPContextResponse.

func ParseCreatePDPContextResponse

func ParseCreatePDPContextResponse(b []byte) (*CreatePDPContextResponse, error)

ParseCreatePDPContextResponse decodes a given byte sequence as a CreatePDPContextResponse.

func (*CreatePDPContextResponse) DecodeFromBytes deprecated

func (c *CreatePDPContextResponse) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as CreatePDPContextResponse.

Deprecated: use CreatePDPContextResponse.UnmarshalBinary instead.

func (*CreatePDPContextResponse) Len deprecated

func (c *CreatePDPContextResponse) Len() int

Len returns the actual length of CreatePDPContextResponse.

Deprecated: use CreatePDPContextResponse.MarshalLen instead.

func (*CreatePDPContextResponse) Marshal

func (c *CreatePDPContextResponse) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a CreatePDPContextResponse.

func (*CreatePDPContextResponse) MarshalLen

func (c *CreatePDPContextResponse) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*CreatePDPContextResponse) MarshalTo

func (c *CreatePDPContextResponse) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*CreatePDPContextResponse) MessageTypeName

func (c *CreatePDPContextResponse) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*CreatePDPContextResponse) Serialize deprecated

func (c *CreatePDPContextResponse) Serialize() ([]byte, error)

Serialize serializes CreatePDPContextResponse into bytes.

Deprecated: use CreatePDPContextResponse.Marshal instead.

func (*CreatePDPContextResponse) SerializeTo deprecated

func (c *CreatePDPContextResponse) SerializeTo(b []byte) error

SerializeTo serializes CreatePDPContextResponse into bytes given as b.

Deprecated: use CreatePDPContextResponse.MarshalTo instead.

func (*CreatePDPContextResponse) SetLength

func (c *CreatePDPContextResponse) SetLength()

SetLength sets the length in Length field.

func (*CreatePDPContextResponse) TEID

func (c *CreatePDPContextResponse) TEID() uint32

TEID returns the TEID in human-readable string.

func (*CreatePDPContextResponse) UnmarshalBinary

func (c *CreatePDPContextResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a CreatePDPContextResponse.

type DeletePDPContextRequest

type DeletePDPContextRequest struct {
	*Header
	Cause               *ie.IE
	TeardownInd         *ie.IE
	NSAPI               *ie.IE
	PCO                 *ie.IE
	ULI                 *ie.IE
	MSTimeZone          *ie.IE
	ExtendedCommonFlags *ie.IE
	ULITimestamp        *ie.IE
	PrivateExtension    *ie.IE
	AdditionalIEs       []*ie.IE
}

DeletePDPContextRequest is a DeletePDPContextRequest Header and its IEs above.

func DecodeDeletePDPContextRequest deprecated

func DecodeDeletePDPContextRequest(b []byte) (*DeletePDPContextRequest, error)

DecodeDeletePDPContextRequest decodes bytes as DeletePDPContextRequest.

Deprecated: use ParseDeletePDPContextRequest instead.

func NewDeletePDPContextRequest

func NewDeletePDPContextRequest(teid uint32, seq uint16, ies ...*ie.IE) *DeletePDPContextRequest

NewDeletePDPContextRequest creates a new GTPv1 DeletePDPContextRequest.

func ParseDeletePDPContextRequest

func ParseDeletePDPContextRequest(b []byte) (*DeletePDPContextRequest, error)

ParseDeletePDPContextRequest decodes a given byte sequence as a DeletePDPContextRequest.

func (*DeletePDPContextRequest) DecodeFromBytes deprecated

func (d *DeletePDPContextRequest) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as DeletePDPContextRequest.

Deprecated: use DeletePDPContextRequest.UnmarshalBinary instead.

func (*DeletePDPContextRequest) Len deprecated

func (d *DeletePDPContextRequest) Len() int

Len returns the actual length of DeletePDPContextRequest.

Deprecated: use DeletePDPContextRequest.MarshalLen instead.

func (*DeletePDPContextRequest) Marshal

func (d *DeletePDPContextRequest) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a DeletePDPContextRequest.

func (*DeletePDPContextRequest) MarshalLen

func (d *DeletePDPContextRequest) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*DeletePDPContextRequest) MarshalTo

func (d *DeletePDPContextRequest) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*DeletePDPContextRequest) MessageTypeName

func (d *DeletePDPContextRequest) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*DeletePDPContextRequest) Serialize deprecated

func (d *DeletePDPContextRequest) Serialize() ([]byte, error)

Serialize serializes DeletePDPContextRequest into bytes.

Deprecated: use DeletePDPContextRequest.Marshal instead.

func (*DeletePDPContextRequest) SerializeTo deprecated

func (d *DeletePDPContextRequest) SerializeTo(b []byte) error

SerializeTo serializes DeletePDPContextRequest into bytes given as b.

Deprecated: use DeletePDPContextRequest.MarshalTo instead.

func (*DeletePDPContextRequest) SetLength

func (d *DeletePDPContextRequest) SetLength()

SetLength sets the length in Length field.

func (*DeletePDPContextRequest) TEID

func (d *DeletePDPContextRequest) TEID() uint32

TEID returns the TEID in human-readable string.

func (*DeletePDPContextRequest) UnmarshalBinary

func (d *DeletePDPContextRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a DeletePDPContextRequest.

type DeletePDPContextResponse

type DeletePDPContextResponse struct {
	*Header
	Cause            *ie.IE
	PCO              *ie.IE
	ULI              *ie.IE
	MSTimeZone       *ie.IE
	ULITimestamp     *ie.IE
	PrivateExtension *ie.IE
	AdditionalIEs    []*ie.IE
}

DeletePDPContextResponse is a DeletePDPContextResponse Header and its IEs above.

func DecodeDeletePDPContextResponse deprecated

func DecodeDeletePDPContextResponse(b []byte) (*DeletePDPContextResponse, error)

DecodeDeletePDPContextResponse decodes bytes as DeletePDPContextResponse.

Deprecated: use ParseDeletePDPContextResponse instead.

func NewDeletePDPContextResponse

func NewDeletePDPContextResponse(teid uint32, seq uint16, ies ...*ie.IE) *DeletePDPContextResponse

NewDeletePDPContextResponse creates a new GTPv1 DeletePDPContextResponse.

func ParseDeletePDPContextResponse

func ParseDeletePDPContextResponse(b []byte) (*DeletePDPContextResponse, error)

ParseDeletePDPContextResponse decodes a given byte sequence as a DeletePDPContextResponse.

func (*DeletePDPContextResponse) DecodeFromBytes deprecated

func (d *DeletePDPContextResponse) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as DeletePDPContextResponse.

Deprecated: use DeletePDPContextResponse.UnmarshalBinary instead.

func (*DeletePDPContextResponse) Len deprecated

func (d *DeletePDPContextResponse) Len() int

Len returns the actual length of DeletePDPContextResponse.

Deprecated: use DeletePDPContextResponse.MarshalLen instead.

func (*DeletePDPContextResponse) Marshal

func (d *DeletePDPContextResponse) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a DeletePDPContextResponse.

func (*DeletePDPContextResponse) MarshalLen

func (d *DeletePDPContextResponse) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*DeletePDPContextResponse) MarshalTo

func (d *DeletePDPContextResponse) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*DeletePDPContextResponse) MessageTypeName

func (d *DeletePDPContextResponse) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*DeletePDPContextResponse) Serialize deprecated

func (d *DeletePDPContextResponse) Serialize() ([]byte, error)

Serialize serializes DeletePDPContextResponse into bytes.

Deprecated: use DeletePDPContextResponse.Marshal instead.

func (*DeletePDPContextResponse) SerializeTo deprecated

func (d *DeletePDPContextResponse) SerializeTo(b []byte) error

SerializeTo serializes DeletePDPContextResponse into bytes given as b.

Deprecated: use DeletePDPContextResponse.MarshalTo instead.

func (*DeletePDPContextResponse) SetLength

func (d *DeletePDPContextResponse) SetLength()

SetLength sets the length in Length field.

func (*DeletePDPContextResponse) TEID

func (d *DeletePDPContextResponse) TEID() uint32

TEID returns the TEID in human-readable string.

func (*DeletePDPContextResponse) UnmarshalBinary

func (d *DeletePDPContextResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a DeletePDPContextResponse.

type EchoRequest

type EchoRequest struct {
	*Header
	PrivateExtension *ie.IE
	AdditionalIEs    []*ie.IE
}

EchoRequest is a EchoRequest Header and its IEs above.

func DecodeEchoRequest deprecated

func DecodeEchoRequest(b []byte) (*EchoRequest, error)

DecodeEchoRequest decodes bytes as EchoRequest.

Deprecated: use ParseEchoRequest instead.

func NewEchoRequest

func NewEchoRequest(seq uint16, ies ...*ie.IE) *EchoRequest

NewEchoRequest creates a new GTP.

func ParseEchoRequest

func ParseEchoRequest(b []byte) (*EchoRequest, error)

ParseEchoRequest decodes a given byte sequence as a EchoRequest.

func (*EchoRequest) DecodeFromBytes deprecated

func (e *EchoRequest) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as EchoRequest.

Deprecated: use EchoRequest.UnmarshalBinary instead.

func (*EchoRequest) Len deprecated

func (e *EchoRequest) Len() int

Len returns the actual length of EchoRequest.

Deprecated: use EchoRequest.MarshalLen instead.

func (*EchoRequest) Marshal

func (e *EchoRequest) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a EchoRequest.

func (*EchoRequest) MarshalLen

func (e *EchoRequest) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*EchoRequest) MarshalTo

func (e *EchoRequest) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*EchoRequest) MessageTypeName

func (e *EchoRequest) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*EchoRequest) Serialize deprecated

func (e *EchoRequest) Serialize() ([]byte, error)

Serialize serializes EchoRequest into bytes.

Deprecated: use EchoRequest.Marshal instead.

func (*EchoRequest) SerializeTo deprecated

func (e *EchoRequest) SerializeTo(b []byte) error

SerializeTo serializes EchoRequest into bytes given as b.

Deprecated: use EchoRequest.MarshalTo instead.

func (*EchoRequest) SetLength

func (e *EchoRequest) SetLength()

SetLength sets the length in Length field.

func (*EchoRequest) TEID

func (e *EchoRequest) TEID() uint32

TEID returns the TEID in human-readable string.

func (*EchoRequest) UnmarshalBinary

func (e *EchoRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a EchoRequest.

type EchoResponse

type EchoResponse struct {
	*Header
	Recovery         *ie.IE
	PrivateExtension *ie.IE
	AdditionalIEs    []*ie.IE
}

EchoResponse is a EchoResponse Header and its IEs above.

func DecodeEchoResponse deprecated

func DecodeEchoResponse(b []byte) (*EchoResponse, error)

DecodeEchoResponse decodes bytes as EchoResponse.

Deprecated: use ParseEchoResponse instead.

func NewEchoResponse

func NewEchoResponse(seq uint16, ies ...*ie.IE) *EchoResponse

NewEchoResponse creates a new GTPv1 EchoResponse.

func ParseEchoResponse

func ParseEchoResponse(b []byte) (*EchoResponse, error)

ParseEchoResponse decodes a given byte sequence as a EchoResponse.

func (*EchoResponse) DecodeFromBytes deprecated

func (e *EchoResponse) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as EchoResponse.

Deprecated: use EchoResponse.UnmarshalBinary instead.

func (*EchoResponse) Len deprecated

func (e *EchoResponse) Len() int

Len returns the actual length of EchoResponse.

Deprecated: use EchoResponse.MarshalLen instead.

func (*EchoResponse) Marshal

func (e *EchoResponse) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a EchoResponse.

func (*EchoResponse) MarshalLen

func (e *EchoResponse) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*EchoResponse) MarshalTo

func (e *EchoResponse) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*EchoResponse) MessageTypeName

func (e *EchoResponse) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*EchoResponse) Serialize deprecated

func (e *EchoResponse) Serialize() ([]byte, error)

Serialize serializes EchoResponse into bytes.

Deprecated: use EchoResponse.Marshal instead.

func (*EchoResponse) SerializeTo deprecated

func (e *EchoResponse) SerializeTo(b []byte) error

SerializeTo serializes EchoResponse into bytes given as b.

Deprecated: use EchoResponse.MarshalTo instead.

func (*EchoResponse) SetLength

func (e *EchoResponse) SetLength()

SetLength sets the length in Length field.

func (*EchoResponse) TEID

func (e *EchoResponse) TEID() uint32

TEID returns the TEID in human-readable string.

func (*EchoResponse) UnmarshalBinary

func (e *EchoResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a EchoResponse.

type EndMarker added in v0.8.3

type EndMarker struct {
	*Header
	PrivateExtension *ie.IE
	AdditionalIEs    []*ie.IE
}

EndMarker is a EndMarker Header and its IEs above.

func NewEndMarker added in v0.8.3

func NewEndMarker(ies ...*ie.IE) *EndMarker

NewEndMarker creates a new GTP.

func ParseEndMarker added in v0.8.3

func ParseEndMarker(b []byte) (*EndMarker, error)

ParseEndMarker decodes a given byte sequence as a EndMarker.

func (*EndMarker) Marshal added in v0.8.3

func (e *EndMarker) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a EndMarker.

func (*EndMarker) MarshalLen added in v0.8.3

func (e *EndMarker) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*EndMarker) MarshalTo added in v0.8.3

func (e *EndMarker) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*EndMarker) MessageTypeName added in v0.8.3

func (e *EndMarker) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*EndMarker) SetLength added in v0.8.3

func (e *EndMarker) SetLength()

SetLength sets the length in Length field.

func (*EndMarker) TEID added in v0.8.3

func (e *EndMarker) TEID() uint32

TEID returns the TEID in human-readable string.

func (*EndMarker) UnmarshalBinary added in v0.8.3

func (e *EndMarker) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a EndMarker.

type ErrorIndication

type ErrorIndication struct {
	*Header
	TEIDDataI        *ie.IE
	GTPUPeerAddress  *ie.IE
	PrivateExtension *ie.IE
	AdditionalIEs    []*ie.IE
}

ErrorIndication is a ErrorIndication Header and its IEs above.

func DecodeErrorIndication deprecated

func DecodeErrorIndication(b []byte) (*ErrorIndication, error)

DecodeErrorIndication decodes bytes as ErrorIndication.

Deprecated: use ParseErrorIndication instead.

func NewErrorIndication

func NewErrorIndication(teid uint32, seq uint16, ies ...*ie.IE) *ErrorIndication

NewErrorIndication creates a new GTPv1 ErrorIndication.

func ParseErrorIndication

func ParseErrorIndication(b []byte) (*ErrorIndication, error)

ParseErrorIndication decodes a given byte sequence as a ErrorIndication.

func (*ErrorIndication) DecodeFromBytes deprecated

func (e *ErrorIndication) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as ErrorIndication.

Deprecated: use ErrorIndication.UnmarshalBinary instead.

func (*ErrorIndication) Len deprecated

func (e *ErrorIndication) Len() int

Len returns the actual length of ErrorIndication.

Deprecated: use ErrorIndication.MarshalLen instead.

func (*ErrorIndication) Marshal

func (e *ErrorIndication) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a ErrorIndication.

func (*ErrorIndication) MarshalLen

func (e *ErrorIndication) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*ErrorIndication) MarshalTo

func (e *ErrorIndication) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*ErrorIndication) MessageTypeName

func (e *ErrorIndication) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*ErrorIndication) Serialize deprecated

func (e *ErrorIndication) Serialize() ([]byte, error)

Serialize serializes ErrorIndication into bytes.

Deprecated: use ErrorIndication.Marshal instead.

func (*ErrorIndication) SerializeTo deprecated

func (e *ErrorIndication) SerializeTo(b []byte) error

SerializeTo serializes ErrorIndication into bytes given as b.

Deprecated: use ErrorIndication.MarshalTo instead.

func (*ErrorIndication) SetLength

func (e *ErrorIndication) SetLength()

SetLength sets the length in Length field.

func (*ErrorIndication) TEID

func (e *ErrorIndication) TEID() uint32

TEID returns the TEID in human-readable string.

func (*ErrorIndication) UnmarshalBinary

func (e *ErrorIndication) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a ErrorIndication.

type ExtensionHeader added in v0.7.28

type ExtensionHeader struct {
	Type     uint8 // this doesn't exist in the spec, but it's apparently helpful to have
	Length   uint8
	Content  []byte
	NextType uint8
}

ExtensionHeader represents an Extension Header defined in §5.2, TS 29.281 and §6.1 TS 29.060.

func NewExtensionHeader added in v0.7.28

func NewExtensionHeader(typ uint8, content []byte, nextType uint8) *ExtensionHeader

NewExtensionHeader creates a new ExtensionHeader.

ExtensionHeader struct has its own type while it does not actually exist in the packet. Be sure to set an appropriate one - putting a wrong type may cause unexpected errors while using method depends on ExtensionHeader struct.

func ParseExtensionHeader added in v0.7.28

func ParseExtensionHeader(b []byte) (*ExtensionHeader, error)

ParseExtensionHeader decodes given byte sequence as a ExtensionHeader.

func ParseMultiExtensionHeaders added in v0.7.28

func ParseMultiExtensionHeaders(b []byte) ([]*ExtensionHeader, error)

ParseMultiExtensionHeaders parses given bytes sequence as multiple ExtensionHeaders.

func (*ExtensionHeader) IsComprehensionRequired added in v0.7.28

func (e *ExtensionHeader) IsComprehensionRequired() bool

IsComprehensionRequired reports whether the comprehension of the ExtensionHeader is required or not.

func (*ExtensionHeader) Marshal added in v0.7.28

func (e *ExtensionHeader) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from an ExtensionHeader.

func (*ExtensionHeader) MarshalLen added in v0.7.28

func (e *ExtensionHeader) MarshalLen() int

MarshalLen returns the serial length of ExtensionHeader.

func (*ExtensionHeader) MarshalTo added in v0.7.28

func (e *ExtensionHeader) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*ExtensionHeader) SetLength added in v0.7.28

func (e *ExtensionHeader) SetLength()

SetLength sets the length calculated from the length of contents to Length field.

func (*ExtensionHeader) String added in v0.7.28

func (e *ExtensionHeader) String() string

String returns an ExtensionHeader fields in human readable format.

func (*ExtensionHeader) UnmarshalBinary added in v0.7.28

func (e *ExtensionHeader) UnmarshalBinary(b []byte) error

UnmarshalBinary sets the values retrieved from byte sequence in ExtensionHeader.

type Generic

type Generic struct {
	*Header
	IEs []*ie.IE
}

Generic is a Generic Header and its IEs above. This is for handling a non-implemented type of message.

func DecodeGeneric deprecated

func DecodeGeneric(b []byte) (*Generic, error)

DecodeGeneric decodes bytes as Generic.

Deprecated: use ParseGeneric instead.

func NewGeneric

func NewGeneric(msgType uint8, teid uint32, seq uint16, ie ...*ie.IE) *Generic

NewGeneric creates a new GTPv1 Generic.

func ParseGeneric

func ParseGeneric(b []byte) (*Generic, error)

ParseGeneric decodes a given byte sequence as a Generic.

func (*Generic) AddIE

func (g *Generic) AddIE(ie ...*ie.IE)

AddIE add IEs to Generic type of GTPv2 message and update Length field.

func (*Generic) DecodeFromBytes deprecated

func (g *Generic) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as Generic.

Deprecated: use Generic.UnmarshalBinary instead.

func (*Generic) Len deprecated

func (g *Generic) Len() int

Len returns the actual length of Generic.

Deprecated: use Generic.MarshalLen instead.

func (*Generic) Marshal

func (g *Generic) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a Generic.

func (*Generic) MarshalLen

func (g *Generic) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*Generic) MarshalTo

func (g *Generic) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*Generic) MessageTypeName

func (g *Generic) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*Generic) Serialize deprecated

func (g *Generic) Serialize() ([]byte, error)

Serialize serializes Generic into bytes.

Deprecated: use Generic.Marshal instead.

func (*Generic) SerializeTo deprecated

func (g *Generic) SerializeTo(b []byte) error

SerializeTo serializes Generic into bytes given as b.

Deprecated: use Generic.MarshalTo instead.

func (*Generic) SetLength

func (g *Generic) SetLength()

SetLength sets the length in Length field.

func (*Generic) TEID

func (g *Generic) TEID() uint32

TEID returns the TEID in human-readable string.

func (*Generic) UnmarshalBinary

func (g *Generic) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a Generic.

type Header struct {
	Flags                   uint8
	Type                    uint8
	Length                  uint16
	TEID                    uint32
	SequenceNumber          uint16
	NPDUNumber              uint8
	NextExtensionHeaderType uint8
	ExtensionHeaders        []*ExtensionHeader
	Payload                 []byte
}

Header is a GTPv1 common header.

func DecodeHeader deprecated

func DecodeHeader(b []byte) (*Header, error)

DecodeHeader decodes bytes as Header.

Deprecated: use ParseHeader instead.

func NewHeader

func NewHeader(flags, mtype uint8, teid uint32, seqnum uint16, payload []byte) *Header

NewHeader creates a new Header.

func NewHeaderWithExtensionHeaders added in v0.7.28

func NewHeaderWithExtensionHeaders(flags, mtype uint8, teid uint32, seqnum uint16, payload []byte, extHdrs ...*ExtensionHeader) *Header

NewHeaderWithExtensionHeaders creates a new Header with ExtensionHeaders.

func NewHeaderWithNPDUNumber added in v0.7.28

func NewHeaderWithNPDUNumber(flags, mtype uint8, teid uint32, seqnum uint16, npdu uint8, payload []byte) *Header

NewHeaderWithNPDUNumber creates a new Header with NPDUNumber.

func ParseHeader

func ParseHeader(b []byte) (*Header, error)

ParseHeader decodes given byte sequence as a GTPv1 header.

func (*Header) AddExtensionHeaders added in v0.7.28

func (h *Header) AddExtensionHeaders(extHdrs ...*ExtensionHeader) error

AddExtensionHeaders adds ExtensionHeader(s) to Header.

This function validates if the next extension header type matches the actual one for safety. To create arbitrary(possibly malformed) Header, access ExtensionHeaders field on your own.

func (*Header) DecodeFromBytes deprecated

func (h *Header) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as Header.

Deprecated: use Header.UnmarshalBinary instead.

func (*Header) HasExtensionHeader added in v0.7.27

func (h *Header) HasExtensionHeader() bool

HasExtensionHeader reports whether a Header has extension header by checking the flag.

func (*Header) HasNPDUNumber added in v0.7.28

func (h *Header) HasNPDUNumber() bool

HasNPDUNumber reports whether a Header has N-PDU Number by checking the flag.

func (*Header) HasSequence

func (h *Header) HasSequence() bool

HasSequence reports whether a Header has SequenceNumber by checking the flag.

func (*Header) Len deprecated

func (h *Header) Len() int

Len returns the actual length of Header.

Deprecated: use Header.MarshalLen instead.

func (*Header) Marshal

func (h *Header) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a Header.

func (*Header) MarshalLen

func (h *Header) MarshalLen() int

MarshalLen returns the serial length of Header.

func (*Header) MarshalTo

func (h *Header) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*Header) MessageType

func (h *Header) MessageType() uint8

MessageType returns the type of message.

func (*Header) Sequence

func (h *Header) Sequence() uint16

Sequence returns SequenceNumber in uint16.

func (*Header) Serialize deprecated

func (h *Header) Serialize() ([]byte, error)

Serialize serializes Header into bytes.

Deprecated: use Header.Marshal instead.

func (*Header) SerializeTo deprecated

func (h *Header) SerializeTo(b []byte) error

SerializeTo serializes Header into bytes given as b.

Deprecated: use Header.MarshalTo instead.

func (*Header) SetLength

func (h *Header) SetLength()

SetLength sets the length in Length field.

func (*Header) SetNPDUNumber added in v0.7.28

func (h *Header) SetNPDUNumber(npdu uint8)

SetNPDUNumber sets the NPDUNumber in Header.

func (*Header) SetNextExtensionHeaderType added in v0.7.27

func (h *Header) SetNextExtensionHeaderType(exhType uint8)

SetNextExtensionHeaderType sets the ExtensionHeaderType in Header.

func (*Header) SetSequenceNumber

func (h *Header) SetSequenceNumber(seq uint16)

SetSequenceNumber sets the SequenceNumber in Header.

func (*Header) SetTEID

func (h *Header) SetTEID(teid uint32)

SetTEID sets the TEIDFlag to 1 and puts the TEID given into TEID field.

func (*Header) String

func (h *Header) String() string

String returns the GTPv1 header values in human readable format.

func (*Header) UnmarshalBinary

func (h *Header) UnmarshalBinary(b []byte) error

UnmarshalBinary sets the values retrieved from byte sequence in GTPv1 header.

func (*Header) Version

func (h *Header) Version() int

Version returns GTP version in int.

func (*Header) WithExtensionHeaders added in v0.7.28

func (h *Header) WithExtensionHeaders(extHdrs ...*ExtensionHeader) *Header

WithExtensionHeaders returns the Header with ExtensionHeaders added.

func (*Header) WithNPDUNumber added in v0.7.28

func (h *Header) WithNPDUNumber(npdu uint8) *Header

WithNPDUNumber returns the Header with NPDUNumber added.

func (*Header) WithSequenceNumber added in v0.7.28

func (h *Header) WithSequenceNumber(seq uint16) *Header

WithSequenceNumber returns the Header with SequenceNumber added.

type InvalidTypeError added in v0.7.28

type InvalidTypeError struct {
	Type uint8
}

InvalidTypeError indicates the type of an ExtensionHeader is invalid.

func (*InvalidTypeError) Error added in v0.7.28

func (e *InvalidTypeError) Error() string

Error returns message with the invalid type given.

type Message

type Message interface {
	MarshalTo([]byte) error
	UnmarshalBinary(b []byte) error
	MarshalLen() int
	Version() int
	MessageType() uint8
	MessageTypeName() string
	TEID() uint32
	SetTEID(uint32)
	Sequence() uint16
	SetSequenceNumber(uint16)

	// deprecated
	SerializeTo([]byte) error
	DecodeFromBytes(b []byte) error
}

Message is an interface that defines Message message.

func Decode deprecated

func Decode(b []byte) (Message, error)

Decode decodes bytes as Message.

Deprecated: use Parse instead.

func Parse

func Parse(b []byte) (Message, error)

Parse parses the given bytes as a Message.

type SupportedExtensionHeaderNotification added in v0.7.28

type SupportedExtensionHeaderNotification struct {
	*Header
	ExtensionHeaderTypeList *ie.IE
	AdditionalIEs           []*ie.IE
}

SupportedExtensionHeaderNotification is a SupportedExtensionHeaderNotification Header and its IEs above.

func NewSupportedExtensionHeaderNotification added in v0.7.28

func NewSupportedExtensionHeaderNotification(teid uint32, seq uint16, ies ...*ie.IE) *SupportedExtensionHeaderNotification

NewSupportedExtensionHeaderNotification creates a new GTPv1 SupportedExtensionHeaderNotification.

func ParseSupportedExtensionHeaderNotification added in v0.7.28

func ParseSupportedExtensionHeaderNotification(b []byte) (*SupportedExtensionHeaderNotification, error)

ParseSupportedExtensionHeaderNotification decodes a given byte sequence as a SupportedExtensionHeaderNotification.

func (*SupportedExtensionHeaderNotification) Marshal added in v0.7.28

Marshal returns the byte sequence generated from a SupportedExtensionHeaderNotification.

func (*SupportedExtensionHeaderNotification) MarshalLen added in v0.7.28

func (e *SupportedExtensionHeaderNotification) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*SupportedExtensionHeaderNotification) MarshalTo added in v0.7.28

MarshalTo puts the byte sequence in the byte array given as b.

func (*SupportedExtensionHeaderNotification) MessageTypeName added in v0.7.28

func (e *SupportedExtensionHeaderNotification) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*SupportedExtensionHeaderNotification) SetLength added in v0.7.28

func (e *SupportedExtensionHeaderNotification) SetLength()

SetLength sets the length in Length field.

func (*SupportedExtensionHeaderNotification) TEID added in v0.7.28

TEID returns the TEID in human-readable string.

func (*SupportedExtensionHeaderNotification) UnmarshalBinary added in v0.7.28

func (e *SupportedExtensionHeaderNotification) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a SupportedExtensionHeaderNotification.

type TPDU

type TPDU struct {
	*Header
}

TPDU is a TPDU.

func DecodeTPDU deprecated

func DecodeTPDU(b []byte) (*TPDU, error)

DecodeTPDU decodes bytes as TPDU.

Deprecated: use ParseTPDU instead.

func NewTPDU

func NewTPDU(teid uint32, payload []byte) *TPDU

NewTPDU creates a new T-PDU message.

func NewTPDUWithExtentionHeader added in v0.8.8

func NewTPDUWithExtentionHeader(teid uint32, payload []byte, extHdrs ...*ExtensionHeader) *TPDU

NewTPDUWithExtentionHeader creates a new T-PDU message with the given Extension Headers.

func NewTPDUWithSequence

func NewTPDUWithSequence(teid uint32, seq uint16, payload []byte) *TPDU

NewTPDUWithSequence creates a new T-PDU message with the given Sequence Number.

func ParseTPDU

func ParseTPDU(b []byte) (*TPDU, error)

ParseTPDU decodes a given byte sequence as a TPDU.

func (*TPDU) Decapsulate

func (t *TPDU) Decapsulate() []byte

Decapsulate returns payload as raw []byte.

func (*TPDU) DecodeFromBytes deprecated

func (t *TPDU) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as TPDU.

Deprecated: use TPDU.UnmarshalBinary instead.

func (*TPDU) Len deprecated

func (t *TPDU) Len() int

Len returns the actual length of TPDU.

Deprecated: use TPDU.MarshalLen instead.

func (*TPDU) Marshal

func (t *TPDU) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a TPDU.

func (*TPDU) MarshalLen

func (t *TPDU) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*TPDU) MarshalTo

func (t *TPDU) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*TPDU) MessageTypeName

func (t *TPDU) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*TPDU) Serialize deprecated

func (t *TPDU) Serialize() ([]byte, error)

Serialize serializes TPDU into bytes.

Deprecated: use TPDU.Marshal instead.

func (*TPDU) SerializeTo deprecated

func (t *TPDU) SerializeTo(b []byte) error

SerializeTo serializes TPDU into bytes given as b.

Deprecated: use TPDU.MarshalTo instead.

func (*TPDU) SetLength

func (t *TPDU) SetLength()

SetLength sets the length in Length field.

func (*TPDU) TEID

func (t *TPDU) TEID() uint32

TEID returns the TEID in human-readable string.

func (*TPDU) UnmarshalBinary

func (t *TPDU) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a TPDU.

type UpdatePDPContextRequest

type UpdatePDPContextRequest struct {
	*Header
	IMSI                                 *ie.IE
	RAI                                  *ie.IE
	Recovery                             *ie.IE
	TEIDDataI                            *ie.IE
	TEIDCPlane                           *ie.IE
	NSAPI                                *ie.IE
	TraceReference                       *ie.IE
	TraceType                            *ie.IE
	PCO                                  *ie.IE
	SGSNAddressForCPlane                 *ie.IE
	SGSNAddressForUserTraffic            *ie.IE
	AlternativeSGSNAddressForCPlane      *ie.IE
	AlternativeSGSNAddressForUserTraffic *ie.IE
	QoSProfile                           *ie.IE
	TFT                                  *ie.IE
	TriggerID                            *ie.IE
	OMCIdentity                          *ie.IE
	CommonFlags                          *ie.IE
	RATType                              *ie.IE
	ULI                                  *ie.IE
	MSTimeZone                           *ie.IE
	AdditionalTraceInfo                  *ie.IE
	DirectTunnelFlags                    *ie.IE
	EvolvedARPI                          *ie.IE
	ExtendedCommonFlags                  *ie.IE
	UCI                                  *ie.IE
	APNAMBR                              *ie.IE
	SignallingPriorityIndication         *ie.IE
	CNOperatorSelectionEntity            *ie.IE
	IMEI                                 *ie.IE
	PrivateExtension                     *ie.IE
	AdditionalIEs                        []*ie.IE
}

UpdatePDPContextRequest is a UpdatePDPContextRequest Header and its IEs above.

func DecodeUpdatePDPContextRequest deprecated

func DecodeUpdatePDPContextRequest(b []byte) (*UpdatePDPContextRequest, error)

DecodeUpdatePDPContextRequest decodes bytes as UpdatePDPContextRequest.

Deprecated: use ParseUpdatePDPContextRequest instead.

func NewUpdatePDPContextRequest

func NewUpdatePDPContextRequest(teid uint32, seq uint16, ies ...*ie.IE) *UpdatePDPContextRequest

NewUpdatePDPContextRequest creates a new GTPv1 UpdatePDPContextRequest.

func ParseUpdatePDPContextRequest

func ParseUpdatePDPContextRequest(b []byte) (*UpdatePDPContextRequest, error)

ParseUpdatePDPContextRequest decodes a given byte sequence as a UpdatePDPContextRequest.

func (*UpdatePDPContextRequest) DecodeFromBytes deprecated

func (u *UpdatePDPContextRequest) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as UpdatePDPContextRequest.

Deprecated: use UpdatePDPContextRequest.UnmarshalBinary instead.

func (*UpdatePDPContextRequest) Len deprecated

func (u *UpdatePDPContextRequest) Len() int

Len returns the actual length of UpdatePDPContextRequest.

Deprecated: use UpdatePDPContextRequest.MarshalLen instead.

func (*UpdatePDPContextRequest) Marshal

func (u *UpdatePDPContextRequest) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a UpdatePDPContextRequest.

func (*UpdatePDPContextRequest) MarshalLen

func (u *UpdatePDPContextRequest) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*UpdatePDPContextRequest) MarshalTo

func (u *UpdatePDPContextRequest) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*UpdatePDPContextRequest) MessageTypeName

func (u *UpdatePDPContextRequest) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*UpdatePDPContextRequest) Serialize deprecated

func (u *UpdatePDPContextRequest) Serialize() ([]byte, error)

Serialize serializes UpdatePDPContextRequest into bytes.

Deprecated: use UpdatePDPContextRequest.Marshal instead.

func (*UpdatePDPContextRequest) SerializeTo deprecated

func (u *UpdatePDPContextRequest) SerializeTo(b []byte) error

SerializeTo serializes UpdatePDPContextRequest into bytes given as b.

Deprecated: use UpdatePDPContextRequest.MarshalTo instead.

func (*UpdatePDPContextRequest) SetLength

func (u *UpdatePDPContextRequest) SetLength()

SetLength sets the length in Length field.

func (*UpdatePDPContextRequest) TEID

func (u *UpdatePDPContextRequest) TEID() uint32

TEID returns the TEID in human-readable string.

func (*UpdatePDPContextRequest) UnmarshalBinary

func (u *UpdatePDPContextRequest) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a UpdatePDPContextRequest.

type UpdatePDPContextResponse

type UpdatePDPContextResponse struct {
	*Header
	Cause                         *ie.IE
	Recovery                      *ie.IE
	TEIDDataI                     *ie.IE
	TEIDCPlane                    *ie.IE
	ChargingID                    *ie.IE
	PCO                           *ie.IE
	GGSNAddressForCPlane          *ie.IE
	GGSNAddressForUserTraffic     *ie.IE
	AltGGSNAddressForCPlane       *ie.IE
	AltGGSNAddressForUserTraffic  *ie.IE
	QoSProfile                    *ie.IE
	ChargingGatewayAddress        *ie.IE
	AltChargingGatewayAddress     *ie.IE
	CommonFlags                   *ie.IE
	APNRestriction                *ie.IE
	BearerControlMode             *ie.IE
	MSInfoChangeReportingAction   *ie.IE
	EvolvedARPI                   *ie.IE
	CSGInformationReportingAction *ie.IE
	APNAMBR                       *ie.IE
	PrivateExtension              *ie.IE
	AdditionalIEs                 []*ie.IE
}

UpdatePDPContextResponse is a UpdatePDPContextResponse Header and its IEs above.

func DecodeUpdatePDPContextResponse deprecated

func DecodeUpdatePDPContextResponse(b []byte) (*UpdatePDPContextResponse, error)

DecodeUpdatePDPContextResponse decodes bytes as UpdatePDPContextResponse.

Deprecated: use ParseUpdatePDPContextResponse instead.

func NewUpdatePDPContextResponse

func NewUpdatePDPContextResponse(teid uint32, seq uint16, ies ...*ie.IE) *UpdatePDPContextResponse

NewUpdatePDPContextResponse creates a new GTPv1 UpdatePDPContextResponse.

func ParseUpdatePDPContextResponse

func ParseUpdatePDPContextResponse(b []byte) (*UpdatePDPContextResponse, error)

ParseUpdatePDPContextResponse decodes a given byte sequence as a UpdatePDPContextResponse.

func (*UpdatePDPContextResponse) DecodeFromBytes deprecated

func (u *UpdatePDPContextResponse) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as UpdatePDPContextResponse.

Deprecated: use UpdatePDPContextResponse.UnmarshalBinary instead.

func (*UpdatePDPContextResponse) Len deprecated

func (u *UpdatePDPContextResponse) Len() int

Len returns the actual length of UpdatePDPContextResponse.

Deprecated: use UpdatePDPContextResponse.MarshalLen instead.

func (*UpdatePDPContextResponse) Marshal

func (u *UpdatePDPContextResponse) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a UpdatePDPContextResponse.

func (*UpdatePDPContextResponse) MarshalLen

func (u *UpdatePDPContextResponse) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*UpdatePDPContextResponse) MarshalTo

func (u *UpdatePDPContextResponse) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*UpdatePDPContextResponse) MessageTypeName

func (u *UpdatePDPContextResponse) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*UpdatePDPContextResponse) Serialize deprecated

func (u *UpdatePDPContextResponse) Serialize() ([]byte, error)

Serialize serializes UpdatePDPContextResponse into bytes.

Deprecated: use UpdatePDPContextResponse.Marshal instead.

func (*UpdatePDPContextResponse) SerializeTo deprecated

func (u *UpdatePDPContextResponse) SerializeTo(b []byte) error

SerializeTo serializes UpdatePDPContextResponse into bytes given as b.

Deprecated: use UpdatePDPContextResponse.MarshalTo instead.

func (*UpdatePDPContextResponse) SetLength

func (u *UpdatePDPContextResponse) SetLength()

SetLength sets the length in Length field.

func (*UpdatePDPContextResponse) TEID

func (u *UpdatePDPContextResponse) TEID() uint32

TEID returns the TEID in human-readable string.

func (*UpdatePDPContextResponse) UnmarshalBinary

func (u *UpdatePDPContextResponse) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a UpdatePDPContextResponse.

type VersionNotSupported

type VersionNotSupported struct {
	*Header
	AdditionalIEs []*ie.IE
}

VersionNotSupported is a VersionNotSupported Header and its IEs above.

func DecodeVersionNotSupported deprecated

func DecodeVersionNotSupported(b []byte) (*VersionNotSupported, error)

DecodeVersionNotSupported decodes bytes as VersionNotSupported.

Deprecated: use ParseVersionNotSupported instead.

func NewVersionNotSupported

func NewVersionNotSupported(teid uint32, seq uint16, ie ...*ie.IE) *VersionNotSupported

NewVersionNotSupported creates a new GTPv1 VersionNotSupported.

func ParseVersionNotSupported

func ParseVersionNotSupported(b []byte) (*VersionNotSupported, error)

ParseVersionNotSupported decodes a given byte sequence as a VersionNotSupported.

func (*VersionNotSupported) DecodeFromBytes deprecated

func (v *VersionNotSupported) DecodeFromBytes(b []byte) error

DecodeFromBytes decodes bytes as VersionNotSupported.

Deprecated: use VersionNotSupported.UnmarshalBinary instead.

func (*VersionNotSupported) Len deprecated

func (v *VersionNotSupported) Len() int

Len returns the actual length of VersionNotSupported.

Deprecated: use VersionNotSupported.MarshalLen instead.

func (*VersionNotSupported) Marshal

func (v *VersionNotSupported) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from a VersionNotSupported.

func (*VersionNotSupported) MarshalLen

func (v *VersionNotSupported) MarshalLen() int

MarshalLen returns the serial length of Data.

func (*VersionNotSupported) MarshalTo

func (v *VersionNotSupported) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b.

func (*VersionNotSupported) MessageTypeName

func (v *VersionNotSupported) MessageTypeName() string

MessageTypeName returns the name of protocol.

func (*VersionNotSupported) Serialize deprecated

func (v *VersionNotSupported) Serialize() ([]byte, error)

Serialize serializes VersionNotSupported into bytes.

Deprecated: use VersionNotSupported.Marshal instead.

func (*VersionNotSupported) SerializeTo deprecated

func (v *VersionNotSupported) SerializeTo(b []byte) error

SerializeTo serializes VersionNotSupported into bytes given as b.

Deprecated: use VersionNotSupported.MarshalTo instead.

func (*VersionNotSupported) SetLength

func (v *VersionNotSupported) SetLength()

SetLength sets the length in Length field.

func (*VersionNotSupported) TEID

func (v *VersionNotSupported) TEID() uint32

TEID returns the TEID in human-readable string.

func (*VersionNotSupported) UnmarshalBinary

func (v *VersionNotSupported) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes a given byte sequence as a VersionNotSupported.

Jump to

Keyboard shortcuts

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