Skip to content

Commit

Permalink
Add PFCPEntity.Stop()
Browse files Browse the repository at this point in the history
close #28
  • Loading branch information
louisroyer committed Sep 4, 2024
1 parent 1e3e40d commit 0e5f627
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
```golang
upNode := NewPFCPEntityUP(UPF_NODE_ID, UPF_IP_ADDR) // node id can be an IP Address or a FQDN
upNode.Start()
defer upNode.Close()
// Access list of associations
associations := upNode.GetPFCPAssociations()
// Access list of sessions
Expand All @@ -23,6 +24,7 @@ sessions := upNode.GetPFCPSessions()
```golang
cpNode := NewPFCPEntityCP(SMF_NODE_ID, SMF_IP_ADDR) // node id can be an IP Address or a FQDN
cpNode.Start()
defer cpNode.Close()
association, _ := cpNode.NewEstablishedPFCPAssociation(ie.NewNodeIDHeuristic(UPFADDR))
session, _ := a.CreateSession(pdrs, fars)

Expand Down
4 changes: 4 additions & 0 deletions pfcp/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ func (e *PFCPEntity) Start() error {
return nil
}

func (e *PFCPEntity) Stop() error {
return e.conn.Close()
}

func (e *PFCPEntity) IsUserPlane() bool {
return e.kind == "UP"
}
Expand Down

0 comments on commit 0e5f627

Please sign in to comment.