Skip to content

Commit

Permalink
Add server.GetPFCPSessions
Browse files Browse the repository at this point in the history
  • Loading branch information
louisroyer committed Feb 3, 2022
1 parent 331e350 commit 092afe0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 11 additions & 0 deletions pfcp_server_entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,14 @@ func (e *PFCPServerEntity) Start() error {
}()
return nil
}

func (e *PFCPServerEntity) GetPFCPSessions() []*PFCPSession {
sessions := make([]*PFCPSession, 0)
for _, a := range e.associations {
as := a.GetSessions()
for _, s := range as {
sessions = append(sessions, s)
}
}
return sessions
}
4 changes: 1 addition & 3 deletions pfcp_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"github.com/wmnsk/go-pfcp/message"
)

const MAX_PDR = 1024

type PFCPSession struct {
fseid *ie.IE
rseid uint64
Expand All @@ -28,7 +26,7 @@ func NewPFCPSession(fseid *ie.IE, rseid uint64) PFCPSession {
rseid: rseid, // SEID present in FSEID ie send by remote peer
pdr: make(map[uint16]*pfcprule.PDR),
far: make(map[uint32]*pfcprule.FAR),
sortedPDR: make(pfcprule.PDRs, MAX_PDR),
sortedPDR: make(pfcprule.PDRs, 0),
mu: sync.Mutex{},
}
}
Expand Down

0 comments on commit 092afe0

Please sign in to comment.