mup

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2023 Louis Royer and the NextMN-SRv6 contributors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. SPDX-License-Identifier: MIT

Copyright 2023 Louis Royer and the NextMN-SRv6 contributors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. SPDX-License-Identifier: MIT

Copyright 2023 Louis Royer and the NextMN-SRv6 contributors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. SPDX-License-Identifier: MIT

Copyright 2023 Louis Royer and the NextMN-SRv6 contributors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. SPDX-License-Identifier: MIT

Copyright 2023 Louis Royer and the NextMN-SRv6 contributors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. SPDX-License-Identifier: MIT

Copyright 2023 Louis Royer and the NextMN-SRv6 contributors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. SPDX-License-Identifier: MIT

Index

Constants

View Source
const ARGS_MOB_SESSION_SIZE_BIT = ARGS_MOB_SESSION_SIZE_BYTE * 8
View Source
const ARGS_MOB_SESSION_SIZE_BYTE = 5
View Source
const IPV4_ADDR_SIZE_BIT = IPV4_ADDR_SIZE_BYTE * 8
View Source
const IPV4_ADDR_SIZE_BYTE = 4
View Source
const IPV6_ADDR_SIZE_BIT = IPV6_ADDR_SIZE_BYTE * 8
View Source
const IPV6_ADDR_SIZE_BYTE = 16
View Source
const IPV6_LEN_ENCODING_MASK = (0xFF >> (8 - IPV6_LEN_ENCODING_SIZE_BIT)) // mask (decoding: after shift to right; encoding before shift to left)
View Source
const IPV6_LEN_ENCODING_POS_BIT = 0 // position from right of the byte in bits
View Source
const IPV6_LEN_ENCODING_POS_BYTE = 15 // position from left in bytes
View Source
const IPV6_LEN_ENCODING_SIZE_BIT = 7
View Source
const QFI_MASK = (0xFF >> (8 - QFI_SIZE_BIT)) // mask (decoding: after shift to right; encoding before shift to left)
View Source
const QFI_POS_BIT = 2 // position from right of the byte in bits
View Source
const QFI_POS_BYTE = 0 // position from left in bytes
View Source
const QFI_SIZE_BIT = 6
View Source
const R_MASK = (0xFF >> (8 - R_SIZE_BIT)) // mask (decoding: after shift to right; encoding before shift to left)
View Source
const R_POS_BIT = 1 // position from right of the byte in bits
View Source
const R_POS_BYTE = 0 // position from left in bytes
View Source
const R_SIZE_BIT = 1
View Source
const TEID_POS_BYTE = 1
View Source
const TEID_SIZE_BIT = TEID_SIZE_BYTE * 8
View Source
const TEID_SIZE_BYTE = 4
View Source
const UDP_PORT_SIZE_BIT = UDP_PORT_SIZE_BYTE * 8
View Source
const UDP_PORT_SIZE_BYTE = 2
View Source
const U_MASK = (0xFF >> (8 - U_SIZE_BIT)) // mask (decoding: after shift to right; encoding before shift to left)
View Source
const U_POS_BIT = 0 // position from right of the byte in bits
View Source
const U_POS_BYTE = 0 // position from left in bytes
View Source
const U_SIZE_BIT = 1

Variables

View Source
var (
	ErrTooShortToMarshal = errors.New("too short to serialize")
	ErrTooShortToParse   = errors.New("too short to parse")
	ErrNotAnIPv6Address  = errors.New("not an IPv6 Address")
	ErrWrongValue        = errors.New("wrong value")
)

Functions

This section is empty.

Types

type ArgsMobSession

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

Args.Mob.Session as defined in draft-ietf-dmm-srv6-mobile-uplane-24, section 6.1

func NewArgsMobSession

func NewArgsMobSession(qfi uint8, r bool, u bool, pduSessionID uint32) *ArgsMobSession

NewArgsMobSession creates an ArgsMobSession.

func ParseArgsMobSession

func ParseArgsMobSession(b []byte) (*ArgsMobSession, error)

ParseArgsMobSession parses given byte sequence as an ArgsMobSession.

func (*ArgsMobSession) Marshal

func (a *ArgsMobSession) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from ArgsMobSession.

func (*ArgsMobSession) MarshalLen

func (a *ArgsMobSession) MarshalLen() int

MarshalLen returns the serial length of Args.Mob.Session.

func (*ArgsMobSession) MarshalTo

func (a *ArgsMobSession) MarshalTo(b []byte) error

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

func (*ArgsMobSession) PDUSessionID

func (a *ArgsMobSession) PDUSessionID() uint32

PDUSessionID returns the PDU Session Identifier for this ArgsMobSession. The GTP-U equivalent is TEID.

func (*ArgsMobSession) QFI

func (a *ArgsMobSession) QFI() uint8

QFI returns the Qos Flow Identifier for this ArgsMobSession.

func (*ArgsMobSession) R

func (a *ArgsMobSession) R() bool

R returns the Reflective QoS Indication for this ArgsMobSession.

func (*ArgsMobSession) U

func (a *ArgsMobSession) U() bool

U returns the U bit for this ArgsMobSession.

func (*ArgsMobSession) UnmarshalBinary

func (a *ArgsMobSession) UnmarshalBinary(b []byte) error

UnmarshalBinary sets the values retrieved from byte sequence in an ArgsMobSession.

type MGTP4IPv6DstFields

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

func NewMGTP4IPv6DstFields

func NewMGTP4IPv6DstFields(ipv6Addr []byte, prefixLength uint) (*MGTP4IPv6DstFields, error)

func NewMGTP4IPv6DstFieldsFromFields

func NewMGTP4IPv6DstFieldsFromFields(prefix netip.Prefix, ipv4 []byte, a *ArgsMobSession) (*MGTP4IPv6DstFields, error)

func (*MGTP4IPv6DstFields) ArgsMobSession

func (e *MGTP4IPv6DstFields) ArgsMobSession() *ArgsMobSession

func (*MGTP4IPv6DstFields) IPv4

func (e *MGTP4IPv6DstFields) IPv4() net.IP

func (*MGTP4IPv6DstFields) Marshal

func (a *MGTP4IPv6DstFields) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from MGTP4IPv6DstFields.

func (*MGTP4IPv6DstFields) MarshalLen

func (a *MGTP4IPv6DstFields) MarshalLen() int

func (*MGTP4IPv6DstFields) MarshalTo

func (a *MGTP4IPv6DstFields) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b. warning: no caching is done, this result will be recomputed at each call

func (*MGTP4IPv6DstFields) PDUSessionID

func (a *MGTP4IPv6DstFields) PDUSessionID() uint32

func (*MGTP4IPv6DstFields) Prefix

func (e *MGTP4IPv6DstFields) Prefix() netip.Prefix

func (*MGTP4IPv6DstFields) QFI

func (e *MGTP4IPv6DstFields) QFI() uint8

func (*MGTP4IPv6DstFields) R

func (e *MGTP4IPv6DstFields) R() bool

func (*MGTP4IPv6DstFields) U

func (e *MGTP4IPv6DstFields) U() bool

type MGTP4IPv6SrcFields

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

func NewMGTP4IPv6SrcFields

func NewMGTP4IPv6SrcFields(addr []byte) (*MGTP4IPv6SrcFields, error)

func NewMGTP4IPv6SrcFieldsFromFields

func NewMGTP4IPv6SrcFieldsFromFields(prefix netip.Prefix, ipv4 []byte, udp []byte) (*MGTP4IPv6SrcFields, error)

func (*MGTP4IPv6SrcFields) IPv4

func (e *MGTP4IPv6SrcFields) IPv4() net.IP

func (*MGTP4IPv6SrcFields) Marshal

func (a *MGTP4IPv6SrcFields) Marshal() ([]byte, error)

Marshal returns the byte sequence generated from MGTP4IPv6SrcFields.

func (*MGTP4IPv6SrcFields) MarshalLen

func (a *MGTP4IPv6SrcFields) MarshalLen() int

func (*MGTP4IPv6SrcFields) MarshalTo

func (a *MGTP4IPv6SrcFields) MarshalTo(b []byte) error

MarshalTo puts the byte sequence in the byte array given as b. warning: no caching is done, this result will be recomputed at each call

func (*MGTP4IPv6SrcFields) UDPPortNumber

func (e *MGTP4IPv6SrcFields) UDPPortNumber() layers.UDPPort

Jump to

Keyboard shortcuts

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