Skip to content

Commit 092afe0

Browse files
committed
Add server.GetPFCPSessions
1 parent 331e350 commit 092afe0

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

pfcp_server_entity.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,14 @@ func (e *PFCPServerEntity) Start() error {
102102
}()
103103
return nil
104104
}
105+
106+
func (e *PFCPServerEntity) GetPFCPSessions() []*PFCPSession {
107+
sessions := make([]*PFCPSession, 0)
108+
for _, a := range e.associations {
109+
as := a.GetSessions()
110+
for _, s := range as {
111+
sessions = append(sessions, s)
112+
}
113+
}
114+
return sessions
115+
}

pfcp_session.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import (
1111
"github.com/wmnsk/go-pfcp/message"
1212
)
1313

14-
const MAX_PDR = 1024
15-
1614
type PFCPSession struct {
1715
fseid *ie.IE
1816
rseid uint64
@@ -28,7 +26,7 @@ func NewPFCPSession(fseid *ie.IE, rseid uint64) PFCPSession {
2826
rseid: rseid, // SEID present in FSEID ie send by remote peer
2927
pdr: make(map[uint16]*pfcprule.PDR),
3028
far: make(map[uint32]*pfcprule.FAR),
31-
sortedPDR: make(pfcprule.PDRs, MAX_PDR),
29+
sortedPDR: make(pfcprule.PDRs, 0),
3230
mu: sync.Mutex{},
3331
}
3432
}

0 commit comments

Comments
 (0)