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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
```golang
ctx := context.TODO()
upNode := NewPFCPEntityUP(UPF_NODE_ID, UPF_IP_ADDR) // node id can be an IP Address or a FQDN
go upNode.ListenAndServeContext(ctx)
go upNode.ListenAndServe(ctx)
upnode.WaitReady(ctx)
// Access list of associations
associations := upNode.GetPFCPAssociations()
Expand All @@ -25,7 +25,7 @@ sessions := upNode.GetPFCPSessions()
```golang
ctx := context.TODO()
cpNode := NewPFCPEntityCP(SMF_NODE_ID, SMF_IP_ADDR) // node id can be an IP Address or a FQDN
go cpNode.ListenAndServeContext(ctx)
go cpNode.ListenAndServe(ctx)
cpNode.WaitReady(ctx)
association, _ := cpNode.NewEstablishedPFCPAssociation(ctx, ie.NewNodeIDHeuristic(UPFADDR))
session, _ := a.CreateSession(pdrs, fars)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/nextmn/go-pfcp-networking

go 1.25.5
go 1.26.1

require (
github.com/sirupsen/logrus v1.9.4
github.com/wmnsk/go-pfcp v0.0.24
)

require golang.org/x/sys v0.24.0 // indirect
require golang.org/x/sys v0.42.0 // indirect
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/wmnsk/go-pfcp v0.0.24 h1:sv4F3U/IphsPUMXMkTJW877CRvXZ1sF5onWHGBvxx/A=
github.com/wmnsk/go-pfcp v0.0.24/go.mod h1:8EUVvOzlz25wkUs9D8STNAs5zGyIo5xEUpHQOUZ/iSg=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
9 changes: 6 additions & 3 deletions pfcp/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,16 @@ func (e *PFCPEntity) NewEstablishedPFCPAssociation(ctx context.Context, nodeID *

// Listen PFCP and run the entity with the provided context.
// Always return a non-nil error.
func (e *PFCPEntity) ListenAndServe() error {
return e.ListenAndServeContext(context.Background())
// Deprecated: use [ListenAndServe]
//
//go:fix inline
func (e *PFCPEntity) ListenAndServeContext(ctx context.Context) error {
return e.ListenAndServeContext(ctx)
}

// Listen PFCP and run the entity with the provided context.
// Always return a non-nil error.
func (e *PFCPEntity) ListenAndServeContext(ctx context.Context) error {
func (e *PFCPEntity) ListenAndServe(ctx context.Context) error {
// TODO: listen on both ipv4 and ipv6
if conn, err := ListenPFCP("udp", e.listenAddr); err != nil {
return err
Expand Down
Loading