Documentation
¶
Overview ¶
Package message provides encoding/decoding feature of GTPv1 protocol.
Index ¶
- Constants
- Variables
- func Marshal(g Message) ([]byte, error)
- func NewHeaderFlags(v, p, e, s, n int) uint8
- func Prettify(m Message) string
- func Serialize(m Message) ([]byte, error)deprecated
- type CreatePDPContextRequest
- func (c *CreatePDPContextRequest) DecodeFromBytes(b []byte) errordeprecated
- func (c *CreatePDPContextRequest) Len() intdeprecated
- func (c *CreatePDPContextRequest) Marshal() ([]byte, error)
- func (c *CreatePDPContextRequest) MarshalLen() int
- func (c *CreatePDPContextRequest) MarshalTo(b []byte) error
- func (c *CreatePDPContextRequest) MessageTypeName() string
- func (c *CreatePDPContextRequest) Serialize() ([]byte, error)deprecated
- func (c *CreatePDPContextRequest) SerializeTo(b []byte) errordeprecated
- func (c *CreatePDPContextRequest) SetLength()
- func (c *CreatePDPContextRequest) TEID() uint32
- func (c *CreatePDPContextRequest) UnmarshalBinary(b []byte) error
- type CreatePDPContextResponse
- func (c *CreatePDPContextResponse) DecodeFromBytes(b []byte) errordeprecated
- func (c *CreatePDPContextResponse) Len() intdeprecated
- func (c *CreatePDPContextResponse) Marshal() ([]byte, error)
- func (c *CreatePDPContextResponse) MarshalLen() int
- func (c *CreatePDPContextResponse) MarshalTo(b []byte) error
- func (c *CreatePDPContextResponse) MessageTypeName() string
- func (c *CreatePDPContextResponse) Serialize() ([]byte, error)deprecated
- func (c *CreatePDPContextResponse) SerializeTo(b []byte) errordeprecated
- func (c *CreatePDPContextResponse) SetLength()
- func (c *CreatePDPContextResponse) TEID() uint32
- func (c *CreatePDPContextResponse) UnmarshalBinary(b []byte) error
- type DeletePDPContextRequest
- func (d *DeletePDPContextRequest) DecodeFromBytes(b []byte) errordeprecated
- func (d *DeletePDPContextRequest) Len() intdeprecated
- func (d *DeletePDPContextRequest) Marshal() ([]byte, error)
- func (d *DeletePDPContextRequest) MarshalLen() int
- func (d *DeletePDPContextRequest) MarshalTo(b []byte) error
- func (d *DeletePDPContextRequest) MessageTypeName() string
- func (d *DeletePDPContextRequest) Serialize() ([]byte, error)deprecated
- func (d *DeletePDPContextRequest) SerializeTo(b []byte) errordeprecated
- func (d *DeletePDPContextRequest) SetLength()
- func (d *DeletePDPContextRequest) TEID() uint32
- func (d *DeletePDPContextRequest) UnmarshalBinary(b []byte) error
- type DeletePDPContextResponse
- func (d *DeletePDPContextResponse) DecodeFromBytes(b []byte) errordeprecated
- func (d *DeletePDPContextResponse) Len() intdeprecated
- func (d *DeletePDPContextResponse) Marshal() ([]byte, error)
- func (d *DeletePDPContextResponse) MarshalLen() int
- func (d *DeletePDPContextResponse) MarshalTo(b []byte) error
- func (d *DeletePDPContextResponse) MessageTypeName() string
- func (d *DeletePDPContextResponse) Serialize() ([]byte, error)deprecated
- func (d *DeletePDPContextResponse) SerializeTo(b []byte) errordeprecated
- func (d *DeletePDPContextResponse) SetLength()
- func (d *DeletePDPContextResponse) TEID() uint32
- func (d *DeletePDPContextResponse) UnmarshalBinary(b []byte) error
- type EchoRequest
- func (e *EchoRequest) DecodeFromBytes(b []byte) errordeprecated
- func (e *EchoRequest) Len() intdeprecated
- func (e *EchoRequest) Marshal() ([]byte, error)
- func (e *EchoRequest) MarshalLen() int
- func (e *EchoRequest) MarshalTo(b []byte) error
- func (e *EchoRequest) MessageTypeName() string
- func (e *EchoRequest) Serialize() ([]byte, error)deprecated
- func (e *EchoRequest) SerializeTo(b []byte) errordeprecated
- func (e *EchoRequest) SetLength()
- func (e *EchoRequest) TEID() uint32
- func (e *EchoRequest) UnmarshalBinary(b []byte) error
- type EchoResponse
- func (e *EchoResponse) DecodeFromBytes(b []byte) errordeprecated
- func (e *EchoResponse) Len() intdeprecated
- func (e *EchoResponse) Marshal() ([]byte, error)
- func (e *EchoResponse) MarshalLen() int
- func (e *EchoResponse) MarshalTo(b []byte) error
- func (e *EchoResponse) MessageTypeName() string
- func (e *EchoResponse) Serialize() ([]byte, error)deprecated
- func (e *EchoResponse) SerializeTo(b []byte) errordeprecated
- func (e *EchoResponse) SetLength()
- func (e *EchoResponse) TEID() uint32
- func (e *EchoResponse) UnmarshalBinary(b []byte) error
- type EndMarker
- type ErrorIndication
- func (e *ErrorIndication) DecodeFromBytes(b []byte) errordeprecated
- func (e *ErrorIndication) Len() intdeprecated
- func (e *ErrorIndication) Marshal() ([]byte, error)
- func (e *ErrorIndication) MarshalLen() int
- func (e *ErrorIndication) MarshalTo(b []byte) error
- func (e *ErrorIndication) MessageTypeName() string
- func (e *ErrorIndication) Serialize() ([]byte, error)deprecated
- func (e *ErrorIndication) SerializeTo(b []byte) errordeprecated
- func (e *ErrorIndication) SetLength()
- func (e *ErrorIndication) TEID() uint32
- func (e *ErrorIndication) UnmarshalBinary(b []byte) error
- type ExtensionHeader
- func (e *ExtensionHeader) IsComprehensionRequired() bool
- func (e *ExtensionHeader) Marshal() ([]byte, error)
- func (e *ExtensionHeader) MarshalLen() int
- func (e *ExtensionHeader) MarshalTo(b []byte) error
- func (e *ExtensionHeader) SetLength()
- func (e *ExtensionHeader) String() string
- func (e *ExtensionHeader) UnmarshalBinary(b []byte) error
- type Generic
- func (g *Generic) AddIE(ie ...*ie.IE)
- func (g *Generic) DecodeFromBytes(b []byte) errordeprecated
- func (g *Generic) Len() intdeprecated
- func (g *Generic) Marshal() ([]byte, error)
- func (g *Generic) MarshalLen() int
- func (g *Generic) MarshalTo(b []byte) error
- func (g *Generic) MessageTypeName() string
- func (g *Generic) Serialize() ([]byte, error)deprecated
- func (g *Generic) SerializeTo(b []byte) errordeprecated
- func (g *Generic) SetLength()
- func (g *Generic) TEID() uint32
- func (g *Generic) UnmarshalBinary(b []byte) error
- type Header
- func DecodeHeader(b []byte) (*Header, error)deprecated
- func NewHeader(flags, mtype uint8, teid uint32, seqnum uint16, payload []byte) *Header
- func NewHeaderWithExtensionHeaders(flags, mtype uint8, teid uint32, seqnum uint16, payload []byte, ...) *Header
- func NewHeaderWithNPDUNumber(flags, mtype uint8, teid uint32, seqnum uint16, npdu uint8, payload []byte) *Header
- func ParseHeader(b []byte) (*Header, error)
- func (h *Header) AddExtensionHeaders(extHdrs ...*ExtensionHeader) error
- func (h *Header) DecodeFromBytes(b []byte) errordeprecated
- func (h *Header) HasExtensionHeader() bool
- func (h *Header) HasNPDUNumber() bool
- func (h *Header) HasSequence() bool
- func (h *Header) Len() intdeprecated
- func (h *Header) Marshal() ([]byte, error)
- func (h *Header) MarshalLen() int
- func (h *Header) MarshalTo(b []byte) error
- func (h *Header) MessageType() uint8
- func (h *Header) Sequence() uint16
- func (h *Header) Serialize() ([]byte, error)deprecated
- func (h *Header) SerializeTo(b []byte) errordeprecated
- func (h *Header) SetLength()
- func (h *Header) SetNPDUNumber(npdu uint8)
- func (h *Header) SetNextExtensionHeaderType(exhType uint8)
- func (h *Header) SetSequenceNumber(seq uint16)
- func (h *Header) SetTEID(teid uint32)
- func (h *Header) String() string
- func (h *Header) UnmarshalBinary(b []byte) error
- func (h *Header) Version() int
- func (h *Header) WithExtensionHeaders(extHdrs ...*ExtensionHeader) *Header
- func (h *Header) WithNPDUNumber(npdu uint8) *Header
- func (h *Header) WithSequenceNumber(seq uint16) *Header
- type InvalidTypeError
- type Message
- type SupportedExtensionHeaderNotification
- func (e *SupportedExtensionHeaderNotification) Marshal() ([]byte, error)
- func (e *SupportedExtensionHeaderNotification) MarshalLen() int
- func (e *SupportedExtensionHeaderNotification) MarshalTo(b []byte) error
- func (e *SupportedExtensionHeaderNotification) MessageTypeName() string
- func (e *SupportedExtensionHeaderNotification) SetLength()
- func (e *SupportedExtensionHeaderNotification) TEID() uint32
- func (e *SupportedExtensionHeaderNotification) UnmarshalBinary(b []byte) error
- type TPDU
- func DecodeTPDU(b []byte) (*TPDU, error)deprecated
- func NewTPDU(teid uint32, payload []byte) *TPDU
- func NewTPDUWithExtentionHeader(teid uint32, payload []byte, extHdrs ...*ExtensionHeader) *TPDU
- func NewTPDUWithSequence(teid uint32, seq uint16, payload []byte) *TPDU
- func ParseTPDU(b []byte) (*TPDU, error)
- func (t *TPDU) Decapsulate() []byte
- func (t *TPDU) DecodeFromBytes(b []byte) errordeprecated
- func (t *TPDU) Len() intdeprecated
- func (t *TPDU) Marshal() ([]byte, error)
- func (t *TPDU) MarshalLen() int
- func (t *TPDU) MarshalTo(b []byte) error
- func (t *TPDU) MessageTypeName() string
- func (t *TPDU) Serialize() ([]byte, error)deprecated
- func (t *TPDU) SerializeTo(b []byte) errordeprecated
- func (t *TPDU) SetLength()
- func (t *TPDU) TEID() uint32
- func (t *TPDU) UnmarshalBinary(b []byte) error
- type UpdatePDPContextRequest
- func (u *UpdatePDPContextRequest) DecodeFromBytes(b []byte) errordeprecated
- func (u *UpdatePDPContextRequest) Len() intdeprecated
- func (u *UpdatePDPContextRequest) Marshal() ([]byte, error)
- func (u *UpdatePDPContextRequest) MarshalLen() int
- func (u *UpdatePDPContextRequest) MarshalTo(b []byte) error
- func (u *UpdatePDPContextRequest) MessageTypeName() string
- func (u *UpdatePDPContextRequest) Serialize() ([]byte, error)deprecated
- func (u *UpdatePDPContextRequest) SerializeTo(b []byte) errordeprecated
- func (u *UpdatePDPContextRequest) SetLength()
- func (u *UpdatePDPContextRequest) TEID() uint32
- func (u *UpdatePDPContextRequest) UnmarshalBinary(b []byte) error
- type UpdatePDPContextResponse
- func (u *UpdatePDPContextResponse) DecodeFromBytes(b []byte) errordeprecated
- func (u *UpdatePDPContextResponse) Len() intdeprecated
- func (u *UpdatePDPContextResponse) Marshal() ([]byte, error)
- func (u *UpdatePDPContextResponse) MarshalLen() int
- func (u *UpdatePDPContextResponse) MarshalTo(b []byte) error
- func (u *UpdatePDPContextResponse) MessageTypeName() string
- func (u *UpdatePDPContextResponse) Serialize() ([]byte, error)deprecated
- func (u *UpdatePDPContextResponse) SerializeTo(b []byte) errordeprecated
- func (u *UpdatePDPContextResponse) SetLength()
- func (u *UpdatePDPContextResponse) TEID() uint32
- func (u *UpdatePDPContextResponse) UnmarshalBinary(b []byte) error
- type VersionNotSupported
- func (v *VersionNotSupported) DecodeFromBytes(b []byte) errordeprecated
- func (v *VersionNotSupported) Len() intdeprecated
- func (v *VersionNotSupported) Marshal() ([]byte, error)
- func (v *VersionNotSupported) MarshalLen() int
- func (v *VersionNotSupported) MarshalTo(b []byte) error
- func (v *VersionNotSupported) MessageTypeName() string
- func (v *VersionNotSupported) Serialize() ([]byte, error)deprecated
- func (v *VersionNotSupported) SerializeTo(b []byte) errordeprecated
- func (v *VersionNotSupported) SetLength()
- func (v *VersionNotSupported) TEID() uint32
- func (v *VersionNotSupported) UnmarshalBinary(b []byte) error
Constants ¶
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.
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 ¶
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 ¶
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 ¶
NewHeaderFlags returns a Header Flag built by its components given as arguments.
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 ¶
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 ¶
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
EndMarker is a EndMarker Header and its IEs above.
func NewEndMarker ¶ added in v0.8.3
NewEndMarker creates a new GTP.
func ParseEndMarker ¶ added in v0.8.3
ParseEndMarker decodes a given byte sequence as a EndMarker.
func (*EndMarker) Marshal ¶ added in v0.8.3
Marshal returns the byte sequence generated from a EndMarker.
func (*EndMarker) MarshalLen ¶ added in v0.8.3
MarshalLen returns the serial length of Data.
func (*EndMarker) MarshalTo ¶ added in v0.8.3
MarshalTo puts the byte sequence in the byte array given as b.
func (*EndMarker) MessageTypeName ¶ added in v0.8.3
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) UnmarshalBinary ¶ added in v0.8.3
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 ¶
Generic is a Generic Header and its IEs above. This is for handling a non-implemented type of message.
func DecodeGeneric
deprecated
func NewGeneric ¶
NewGeneric creates a new GTPv1 Generic.
func ParseGeneric ¶
ParseGeneric decodes a given byte sequence as a Generic.
func (*Generic) DecodeFromBytes
deprecated
func (*Generic) MarshalLen ¶
MarshalLen returns the serial length of Data.
func (*Generic) MessageTypeName ¶
MessageTypeName returns the name of protocol.
func (*Generic) SerializeTo
deprecated
func (*Generic) SetLength ¶
func (g *Generic) SetLength()
SetLength sets the length in Length field.
func (*Generic) UnmarshalBinary ¶
UnmarshalBinary decodes a given byte sequence as a Generic.
type Header ¶
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 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 ¶
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 (*Header) HasExtensionHeader ¶ added in v0.7.27
HasExtensionHeader reports whether a Header has extension header by checking the flag.
func (*Header) HasNPDUNumber ¶ added in v0.7.28
HasNPDUNumber reports whether a Header has N-PDU Number by checking the flag.
func (*Header) HasSequence ¶
HasSequence reports whether a Header has SequenceNumber by checking the flag.
func (*Header) MarshalLen ¶
MarshalLen returns the serial length of Header.
func (*Header) MessageType ¶
MessageType returns the type of message.
func (*Header) SerializeTo
deprecated
func (*Header) SetNPDUNumber ¶ added in v0.7.28
SetNPDUNumber sets the NPDUNumber in Header.
func (*Header) SetNextExtensionHeaderType ¶ added in v0.7.27
SetNextExtensionHeaderType sets the ExtensionHeaderType in Header.
func (*Header) SetSequenceNumber ¶
SetSequenceNumber sets the SequenceNumber in Header.
func (*Header) UnmarshalBinary ¶
UnmarshalBinary sets the values retrieved from byte sequence in GTPv1 header.
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
WithNPDUNumber returns the Header with NPDUNumber added.
func (*Header) WithSequenceNumber ¶ added in v0.7.28
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.
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
func (e *SupportedExtensionHeaderNotification) Marshal() ([]byte, error)
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
func (e *SupportedExtensionHeaderNotification) MarshalTo(b []byte) error
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
func (e *SupportedExtensionHeaderNotification) TEID() uint32
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 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 ¶
NewTPDUWithSequence creates a new T-PDU message with the given Sequence Number.
func (*TPDU) Decapsulate ¶
Decapsulate returns payload as raw []byte.
func (*TPDU) DecodeFromBytes
deprecated
func (*TPDU) MarshalLen ¶
MarshalLen returns the serial length of Data.
func (*TPDU) MessageTypeName ¶
MessageTypeName returns the name of protocol.
func (*TPDU) SerializeTo
deprecated
func (*TPDU) UnmarshalBinary ¶
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 ¶
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.
Source Files
¶
- create-pdp-context-req.go
- create-pdp-context-req_deprecated.go
- create-pdp-context-res.go
- create-pdp-context-res_deprecated.go
- delete-pdp-context-req.go
- delete-pdp-context-req_deprecated.go
- delete-pdp-context-res.go
- delete-pdp-context-res_deprecated.go
- echo-req.go
- echo-req_deprecated.go
- echo-res.go
- echo-res_deprecated.go
- end-marker.go
- error-indication.go
- error-indication_deprecated.go
- errors.go
- extension-header.go
- generic.go
- generic_deprecated.go
- header.go
- header_deprecated.go
- message.go
- message_deprecated.go
- supported-extension-header-notification.go
- t-pdu.go
- t-pdu_deprecated.go
- update-pdp-context-req.go
- update-pdp-context-req_deprecated.go
- update-pdp-context-res.go
- update-pdp-context-res_deprecated.go
- version-not-supported.go
- version-not-supported_deprecated.go