gtp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package gtp provides simple and painless handling of GTP(GPRS Tunneling Protocol), implemented in the Go Programming Language.

Examples for specific node are available in examples directory, which can be as it is in the following way. As for the detailed usage as a package, see v0/v1/v2 directory for what you can do with the current implementation.

1. Open four terminals on the same machine and start capturing on loopback interface.

  1. Start P-GW on terminal #1 and #2 // on terminal #1 ./pgw

    // on terminal #2 ./pgw -s5c 127.0.0.53:2123 -s5u 127.0.0.5:2152

3. Start S-GW on terminal #3

// on terminal #3
./sgw

4. Start MME on terminal #4

// on terminal #4
./mme

5. You will see the nodes exchanging Create Session and Modify Bearer on C-Plane, and ICMP Echo on U-Plane afterwards.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidVersion      = errors.New("got invalid version")
	ErrInvalidLength       = errors.New("length value is invalid")
	ErrTooShortToDecode    = errors.New("too short to decode as GTP")
	ErrTooShortToSerialize = errors.New("too short to serialize")
)

Common error definitions.

Functions

func Serialize

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

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

Types

type Message

type Message interface {
	SerializeTo([]byte) error
	DecodeFromBytes(b []byte) error
	Len() int
	Version() int
	MessageType() uint8
	MessageTypeName() string
}

Message is an interface that defines all versions of GTP messages.

func Decode

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

Decode decodes given bytes as Message.

Directories

Path Synopsis
examples
mme
Command mme is a reference implementation of MME with go-gtp.
Command mme is a reference implementation of MME with go-gtp.
pgw
Command pgw is a dead simple implementation of P-GW only with GTP-related features.
Command pgw is a dead simple implementation of P-GW only with GTP-related features.
sgw
Command sgw is a dead simple implementation of S-GW only with GTP-related features.
Command sgw is a dead simple implementation of S-GW only with GTP-related features.
Package utils provides some utilities which might be useful specifically for GTP(or other telco protocols).
Package utils provides some utilities which might be useful specifically for GTP(or other telco protocols).
v0
Package v0 provides the simple and painless handling of GTPv1-C and GTPv1-U protocol in pure Golang.
Package v0 provides the simple and painless handling of GTPv1-C and GTPv1-U protocol in pure Golang.
ies
Package ies provides encoding/decoding feature of GTPv0 Information Elements.
Package ies provides encoding/decoding feature of GTPv0 Information Elements.
messages
Package messages provides encoding/decoding feature of GTPv0 protocol.
Package messages provides encoding/decoding feature of GTPv0 protocol.
testutils
Package testutils is an internal package to be used for unit tests.
Package testutils is an internal package to be used for unit tests.
v1
Package v1 provides the simple and painless handling of GTPv1-C and GTPv1-U protocol in pure Golang.
Package v1 provides the simple and painless handling of GTPv1-C and GTPv1-U protocol in pure Golang.
ies
Package ies provides encoding/decoding feature of GTPv1 Information Elements.
Package ies provides encoding/decoding feature of GTPv1 Information Elements.
messages
Package messages provides encoding/decoding feature of GTPv1 protocol.
Package messages provides encoding/decoding feature of GTPv1 protocol.
testutils
Package testutils is an internal package to be used for unit tests.
Package testutils is an internal package to be used for unit tests.
v2
Package v2 provides the simple and painless handling of GTPv2-C protocol in pure Golang.
Package v2 provides the simple and painless handling of GTPv2-C protocol in pure Golang.
ies
Package ies provides encoding/decoding feature of GTPv2 Information Elements.
Package ies provides encoding/decoding feature of GTPv2 Information Elements.
messages
Package messages provides encoding/decoding feature of GTPv2 protocol.
Package messages provides encoding/decoding feature of GTPv2 protocol.
testutils
Package testutils is an internal package to be used for unit tests.
Package testutils is an internal package to be used for unit tests.

Jump to

Keyboard shortcuts

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