Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions encoding/m-gtp4-ipv6-dst_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
// found in the LICENSE file.
// SPDX-License-Identifier: MIT

package encoding
package encoding_test

import "net/netip"
import (
"net/netip"

"github.com/nextmn/rfc9433/encoding"
)

func ExampleMGTP4IPv6Dst() {
dst := NewMGTP4IPv6Dst(netip.MustParsePrefix("3fff::/20"), netip.MustParseAddr("203.0.113.1").As4(), NewArgsMobSession(0, false, false, 1))
dst := encoding.NewMGTP4IPv6Dst(netip.MustParsePrefix("3fff::/20"), netip.MustParseAddr("203.0.113.1").As4(), encoding.NewArgsMobSession(0, false, false, 1))
dst.Marshal()
}
10 changes: 6 additions & 4 deletions encoding/m-gtp4-ipv6-src_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
// found in the LICENSE file.
// SPDX-License-Identifier: MIT

package encoding
package encoding_test

import (
"fmt"
"net/netip"
"testing"

"github.com/nextmn/rfc9433/encoding"

"github.com/google/go-cmp/cmp"
)

func ExampleMGTP4IPv6Src() {
src := NewMGTP4IPv6Src(netip.MustParsePrefix("3fff::/20"), netip.MustParseAddr("203.0.113.1").As4(), 1337)
src := encoding.NewMGTP4IPv6Src(netip.MustParsePrefix("3fff::/20"), netip.MustParseAddr("203.0.113.1").As4(), 1337)
src.Marshal()
}

Expand All @@ -27,7 +29,7 @@ func TestMGTP4IPv6Src(t *testing.T) {
32,
}

e, err := ParseMGTP4IPv6SrcNextMN(ip_addr)
e, err := encoding.ParseMGTP4IPv6SrcNextMN(ip_addr)
if err != nil {
t.Fatal(err)
}
Expand All @@ -37,7 +39,7 @@ func TestMGTP4IPv6Src(t *testing.T) {
if e.UDPPortNumber() != 0x0123 {
t.Fatalf("Cannot extract udp port number correctly: %x", e.UDPPortNumber())
}
ip_addr2 := NewMGTP4IPv6Src(netip.MustParsePrefix("fd00:1:1::/48"), [4]byte{10, 0, 4, 1}, 0x1234)
ip_addr2 := encoding.NewMGTP4IPv6Src(netip.MustParsePrefix("fd00:1:1::/48"), [4]byte{10, 0, 4, 1}, 0x1234)
b, err := ip_addr2.Marshal()
if err != nil {
t.Fatal(err)
Expand Down
Loading