// NewPFCPSession allocates an session with ID.
NewPFCPSession allocates an session with ID.
// NewPFCPSession allocates an session with ID .
func (pConn *PFCPConn) NewPFCPSession(rseid uint64) uint64 {
	for i := 0; i < pConn.maxRetries; i++ {
		lseid := pConn.rng.Uint64()
		if _, ok := pConn.sessions[lseid]; ok {
			continue
		}
		s := PFCPSession{
			localSEID:  lseid,
			remoteSEID: rseid,
			PacketForwardingRules: PacketForwardingRules{
				pdrs: make([]pdr, 0, MaxItems),
				fars: make([]far, 0, MaxItems),
				qers: make([]qer, 0, MaxItems),
			},
		}
		pConn.sessions[lseid] = &s
		s.metrics = metrics.NewSession(pConn.nodeID.remote)
		pConn.SaveSessions(s.metrics)
		return lseid
	}
	return 0
}
func ( pConn * PFCPConn ) NewPFCPSession ( rseid uint64 ) uint64 { for i := 0 ; i < pConn . maxRetries ; i ++ { lseid := pConn . rng . Uint64 ( ) if _ , ok := pConn . sessions [ lseid ] ; ok { continue } s := PFCPSession { localSEID : lseid , remoteSEID : rseid , PacketForwardingRules : PacketForwardingRules { pdrs : make ( [ ] pdr , 0 , MaxItems ) , fars : make ( [ ] far , 0 , MaxItems ) , qers : make ( [ ] qer , 0 , MaxItems ) , } , } pConn . sessions [ lseid ] = & s s . metrics = metrics . NewSession ( pConn . nodeID . remote ) pConn . SaveSessions ( s . metrics ) return lseid } return 0 }
NewPFCPSession allocates an session with ID.
NewPFCPSession allocates an session with ID .
// Check if it already exists // Metrics update