24 #include <unordered_map> 56 class TranslationThread;
57 class CommunicationThread;
60 typedef std::shared_ptr<RemoteNode> RemoteNodeSPtr;
63 typedef std::shared_ptr<LocalNode> LocalNodeSPtr;
66 typedef ReqOut *ReqOutPtr;
67 typedef std::unordered_map<ULong,ReqOutPtr> ReqOutUMap;
70 typedef RspOut *RspOutPtr;
75 #define SEND_TO_APPLICATION(a,b) \ 76 (PFCP::Configuration::threadApplication()._sendThreadMessage(EThreadMessage( \ 77 static_cast<UInt>(PFCP::ApplicationEvents::a),static_cast<pVoid>(b)))) 78 #define SEND_TO_TRANSLATION(a,b) \ 79 (PFCP::TranslationThread::Instance().sendMessage(EThreadMessage( \ 80 static_cast<UInt>(PFCP::TranslationThread::Events::a),static_cast<pVoid>(b)))) 81 #define SEND_TO_COMMUNICATION(a,b) \ 82 (PFCP::CommunicationThread::Instance().sendMessage(EThreadMessage( \ 83 static_cast<UInt>(PFCP::CommunicationThread::Events::a),static_cast<pVoid>(b)))) 88 typedef ULongLong Seid;
89 typedef UChar MsgType;
102 using MessageId = UInt;
106 #define MAX_ATTEMPS 8 116 using SentArray = std::array<UInt, MAX_ATTEMPS + 1>;
121 MessageStats(MessageId
id, cpStr name);
126 MessageStats(MessageId
id,
const EString &name);
130 MessageStats(
const MessageStats &m);
137 MessageId getId()
const {
return id_; }
141 const EString &getName()
const {
return name_; }
146 UInt getReceived()
const {
return received_; }
152 const SentArray &getSent()
const {
return sent_; }
157 UInt getTimeout()
const {
return timeout_; }
161 UInt incReceived() {
return ++received_; }
167 UInt incSent(UInt attempt = 0);
171 UInt incTimeout() {
return ++timeout_; }
178 std::atomic<UInt> received_;
180 std::atomic<UInt> timeout_;
183 using MessageStatsMap = std::unordered_map<MessageId, MessageStats>;
210 static ETime lastReset();
214 static ETime lastreset_;
223 static void*
operator new(
size_t sz);
224 static void operator delete(
void* m);
243 friend TranslationThread;
244 friend CommunicationThread;
246 static UShort
port() {
return port_; }
247 static UShort
setPort(UShort port) {
return port_ = port; }
252 static LongLong
t1() {
return t1_; }
253 static LongLong
setT1(LongLong t1) {
return t1_ = t1; }
258 static Int
n1() {
return n1_; }
259 static Int
setN1(Int n1) {
return n1_ = n1; }
264 static Long
maxRspWait() {
return static_cast<Long
>(std::max(t1_,hbt1_) * std::max(n1_,hbn1_)); }
272 static ELogger &
logger() {
if (logger_ ==
nullptr)
throw Configuration_LoggerNotDefined();
return *logger_; }
281 static Translator &
translator() {
if (xlator_ ==
nullptr)
throw Configuration_TranslatorNotDefined();
return *xlator_; }
296 template<
class TWorker>
315 static _EThreadEventNotification &
threadApplication() {
if (app_ ==
nullptr)
throw Configuration_ApplicationNotDefined();
return *app_; }
322 static LongLong hbt1_;
335 static _EThreadEventNotification *app_;
337 static MessageStatsMap msgstats_template_;
355 while ((sn = next_++) > SEQUENCE_MAX)
356 next_.compare_exchange_strong(++sn, SEQUENCE_MIN);
365 static const ULong SEQUENCE_MIN = 0;
366 static const ULong SEQUENCE_MAX = 0x00ffffffff;
367 std::atomic_ulong next_;
386 while ((seid = next_++) < SEID_MINIMUM);
395 static const Seid SEID_MINIMUM = 1;
396 std::atomic_ullong next_;
416 : addr_(fqseid.addr_),
425 addr_ = fqseid.addr_;
426 seid_ = fqseid.seid_;
439 const Seid
seid()
const {
return seid_; }
473 ULong seqNbr()
const {
return sn_; }
474 RcvdReq &setSeqNbr(ULong seqNbr) { sn_ = seqNbr;
return *
this; }
476 Int rspWnd()
const {
return rw_; }
477 RcvdReq &setRspWnd(Int rw) { rw_ = rw;
return *
this; }
483 typedef std::unordered_map<ULong,RcvdReq> RcvdReqUMap;
580 SessionBase &setSeid(SessionBaseSPtr &s, Seid ls, Seid rs, Bool notify =
True);
592 virtual Void destroy(SessionBaseSPtr &s);
597 static void*
operator new(
size_t sz)
599 if (pool_.allocSize() == 0)
603 pool_.setSize(sz, 0, 5);
609 bs += bs %
sizeof(pVoid);
613 pool_.setSize(sz, 0, 5);
618 pool_.setSize(sz, ns);
622 if (sz > pool_.allocSize())
626 ex.
setText(
"session allocation size is larger than memory pool block size");
629 return pool_.allocate();
631 static void operator delete(
void* m)
640 static ULongLong created_;
641 static ULongLong deleted_;
699 auto it = sessions_.find(seid);
700 if (it == sessions_.end())
710 Node &_addSession(Seid seid, SessionBaseSPtr &session)
712 auto it = sessions_.find(seid);
713 if (it == sessions_.end())
714 sessions_[seid] = session;
717 Node &_delSession(Seid seid)
720 sessions_.erase(seid);
723 SessionBaseSPtr getFirstSession()
725 if (sessions_.empty())
727 return sessions_.begin()->second;
732 static ULongLong created_;
733 static ULongLong deleted_;
738 SessionBaseSPtrUMap sessions_;
747 DECLARE_ERROR(RemoteNodeException_UnableToAssignTeidRangeValue);
754 friend CommunicationThread;
756 enum class State { Initialized, Started, Stopping, Stopped, Failed, Restarted };
782 RemoteNode &deleteAllSesssions(RemoteNodeSPtr &rn);
802 ETime getLastActivity();
806 Void setLastActivity();
818 UInt incReceived(MessageId msgid);
828 UInt incSent(MessageId msgid, UInt attempt = 0);
836 UInt incTimeout(MessageId msgid);
840 MessageStatsMap msgstats_;
870 Bool addRcvdReq(ULong sn);
871 Bool delRcvdReq(ULong sn) {
return rrumap_.erase(sn) == 1; }
872 Bool setRcvdReqRspWnd(ULong sn, Int wnd);
873 Bool setRcvdReqRspWnd(ULong sn);
874 Void removeRcvdRqstEntries(Int wnd);
875 Bool rcvdReqExists(ULong sn)
const {
return rrumap_.find(sn) != rrumap_.end(); }
877 Void nextActivityWnd(Int wnd);
878 Bool checkActivity();
879 Void incrementActivity() { awnds_[aw_]++; }
881 Void removeOldReqs(Int rw);
892 std::vector<ULong> awnds_;
951 DECLARE_ERROR(LocalNodeException_RemoteNodeUMapInsertFailed);
958 friend CommunicationThread;
960 enum class State { Initialized, Started, Stopping, Stopped };
976 Void freeSeid(Seid seid);
982 Void freeSeqNbr(ULong sn);
986 Void setNbrActivityWnds(
size_t nbr);
994 return createRemoteNode(ipaddr, port);
1000 RemoteNodeSPtr createRemoteNode(
EIpAddress &address, UShort port);
1026 SessionBaseSPtr createSession(LocalNodeSPtr &ln, RemoteNodeSPtr &rn);
1040 Bool rqstOutExists(ULong seqnbr)
const;
1041 Bool addRqstOut(ReqOut *ro);
1042 Bool setRqstOutRespWnd(ULong seqnbr, Int wnd);
1043 Void removeRqstOutEntries(Int wnd);
1044 Void clearRqstOutEntries();
1046 Void nextActivityWnd(Int wnd);
1047 Void checkActivity(LocalNodeSPtr &ln);
1050 Bool onReqOutTimeout(ReqOutPtr ro);
1051 Void removeOldReqs(Int rw);
1053 Void sndInitialReq(ReqOutPtr ro);
1054 Bool sndReq(ReqOutPtr ro);
1055 Void sndRsp(RspOutPtr ro);
1057 LocalNode &addSession(SessionBaseSPtr &s)
1059 if (s && s->localSeid() != 0)
1060 _addSession(s->localSeid(), s);
1063 LocalNode &delSession(SessionBaseSPtr &s)
1065 if (s && s->localSeid() != 0)
1066 _delSession(s->localSeid());
1069 SessionBaseSPtr createSession(LocalNodeSPtr &ln, Seid rs, RemoteNodeSPtr &rn);
1078 RemoteNodeUMap rns_;
1138 static EString cn_ = ::__CLASS_NAME__;
1143 virtual Void postDecode() {}
1150 mc_(MsgClass::Unknown),
1203 AppMsgReq(LocalNodeSPtr &ln, RemoteNodeSPtr &rn, Bool allocSeqNbr)
1209 setSeqNbr(ln->allocSeqNbr());
1229 setMsgClass(PFCP::MsgClass::Node);
1237 setMsgClass(PFCP::MsgClass::Node);
1257 setMsgClass(PFCP::MsgClass::Session);
1263 :
AppMsgReq(ses->localNode(), ses->remoteNode(), allocSeqNbr),
1266 setMsgClass(PFCP::MsgClass::Session);
1278 SessionBaseSPtr ses_;
1313 AppMsgReqPtr
req() {
return amrq_; }
1327 setSeqNbr(amrq_->seqNbr());
1347 setMsgClass(PFCP::MsgClass::Node);
1356 setMsgClass(PFCP::MsgClass::Node);
1386 setMsgClass(PFCP::MsgClass::Session);
1394 setMsgClass(PFCP::MsgClass::Session);
1416 class SndHeartbeatReqData
1419 SndHeartbeatReqData()
1422 SndHeartbeatReqData(LocalNodeSPtr &ln, RemoteNodeSPtr &rn)
1427 SndHeartbeatReqData(
const SndHeartbeatReqData &hb)
1433 LocalNodeSPtr &localNode() {
return ln_; }
1434 RemoteNodeSPtr &remoteNode() {
return rn_; }
1436 SndHeartbeatReqData &setLocalNode(LocalNodeSPtr &ln) { ln_ = ln;
return *
this; }
1437 SndHeartbeatReqData &setRemoteNode(RemoteNodeSPtr &rn) { rn_ = rn;
return *
this; }
1443 typedef SndHeartbeatReqData *SndHeartbeatReqDataPtr;
1450 class RcvdHeartbeatReqData
1453 RcvdHeartbeatReqData()
1457 RcvdHeartbeatReqData(
const RcvdHeartbeatReqData &hb)
1460 started_ = hb.started_;
1463 AppMsgNodeReqPtr req()
const {
return am_; }
1464 const ETime &startTime()
const {
return started_; }
1466 RcvdHeartbeatReqData &setReq(AppMsgNodeReqPtr am) { am_ = am;
return *
this;}
1467 RcvdHeartbeatReqData &setStartTime(
const ETime &started) { started_ = started;
return *
this; }
1470 AppMsgNodeReqPtr am_;
1473 typedef RcvdHeartbeatReqData *RcvdHeartbeatReqDataPtr;
1480 class SndHeartbeatRspData
1483 SndHeartbeatRspData()
1487 SndHeartbeatRspData(AppMsgNodeReqPtr am)
1494 SndHeartbeatRspData &setReq(AppMsgNodeReqPtr am) { am_ = am;
return *
this; }
1497 AppMsgNodeReqPtr am_;
1499 typedef SndHeartbeatRspData *SndHeartbeatRspDataPtr;
1506 class RcvdHeartbeatRspData
1509 RcvdHeartbeatRspData()
1513 RcvdHeartbeatRspData(AppMsgNodeReqPtr am)
1517 ~RcvdHeartbeatRspData()
1527 const ETime &startTime()
const {
return started_; }
1529 RcvdHeartbeatRspData &setReq(AppMsgNodeReqPtr am) { am_ = am;
return *
this; }
1530 RcvdHeartbeatRspData &setStartTime(
const ETime &started) { started_ = started;
return *
this; }
1533 AppMsgNodeReqPtr am_;
1536 typedef RcvdHeartbeatRspData *RcvdHeartbeatRspDataPtr;
1545 class TranslatorMsgInfo;
1553 mc_(MsgClass::Unknown),
1559 InternalMsg(
const InternalMsg &im)
1570 assign(im.data_, im.len_);
1572 InternalMsg(
const LocalNodeSPtr &ln,
const RemoteNodeSPtr &rn,
const TranslatorMsgInfo &tmi, cpUChar data, UShort len);
1573 virtual ~InternalMsg()
1575 if (data_ !=
nullptr)
1579 InternalMsg &operator=(
const InternalMsg &im)
1588 assign(im.data_, im.len_);
1592 LocalNodeSPtr &localNode() {
return ln_; }
1593 RemoteNodeSPtr &remoteNode() {
return rn_; }
1594 SessionBaseSPtr &session() {
return ses_; }
1595 ULong seqNbr()
const {
return seq_; }
1596 MsgType msgType()
const {
return mt_; }
1597 MsgClass msgClass()
const {
return mc_; }
1598 Bool isReq()
const {
return rqst_; }
1599 UChar version()
const {
return ver_; }
1600 cpUChar data()
const {
return data_; }
1601 UShort len()
const {
return len_; }
1603 InternalMsg &setLocalNode(
const LocalNodeSPtr &ln) { ln_ = ln;
return *
this; }
1604 InternalMsg &setRemoteNode(
const RemoteNodeSPtr &rn) { rn_ = rn;
return *
this; }
1605 InternalMsg &setSession(
const SessionBaseSPtr &ses) { ses_ = ses;
return *
this; }
1606 InternalMsg &setSeqNbr(
const ULong sn) { seq_ = sn;
return *
this; }
1607 InternalMsg &setMsgType(
const MsgType mt) { mt_ = mt;
return *
this; }
1608 InternalMsg &setMsgClass(
const MsgClass mc) { mc_ = mc;
return *
this; }
1609 InternalMsg &setIsReq(
const Bool rqst) { rqst_ = rqst;
return *
this; }
1610 InternalMsg &setVersion(
const UChar ver) { ver_ = ver;
return *
this; }
1612 InternalMsg &assign(cpUChar data, UShort len)
1617 if (data_ !=
nullptr)
1622 data_ =
new UChar[len_];
1624 catch(
const std::bad_alloc& e)
1626 throw InternalMsg_OutOfMemory();
1630 std::memcpy(data_, data, len);
1634 static void*
operator new(
size_t sz);
1635 static void operator delete(
void* m);
1641 SessionBaseSPtr ses_;
1651 typedef InternalMsg *InternalMsgPtr;
1658 class RspOut :
public InternalMsg
1665 RspOut(
const RspOut &sr)
1675 RspOut &operator=(
const RspOut &ro)
1677 InternalMsg::operator=(ro);
1682 AppMsgRspPtr appMsg() {
return am_; }
1683 RspOut &setAppMsg(AppMsgRspPtr am)
1697 typedef RspOut *RspOutPtr;
1704 class RspIn :
public InternalMsg
1712 RspIn(
const RspIn &ri)
1718 RspIn(
const LocalNodeSPtr &ln,
const RemoteNodeSPtr &rn,
const TranslatorMsgInfo &tmi, cpUChar data, UShort len, AppMsgReqPtr am)
1719 : InternalMsg(ln, rn, tmi, data, len),
1727 RspIn &operator=(
const RspIn &ri)
1729 InternalMsg::operator=(ri);
1734 AppMsgReqPtr req()
const {
return am_; }
1735 RspIn &setReq(AppMsgReqPtr am) { am_ = am;
return *
this; }
1737 Seid remoteSeid()
const {
return rs_; }
1738 RspIn &remoteSeid(Seid rs) { rs_ = rs;
return *
this; }
1740 const ETime &remoteStartTime() {
return rst_; }
1741 RspIn &remoteStartTime(
const ETime &rst) { rst_ = rst;
return *
this; }
1747 typedef RspIn *RspInPtr;
1754 class ReqOut :
public InternalMsg
1766 ReqOut(
const ReqOut &ro)
1784 ReqOut &operator=(
const ReqOut &ro)
1786 InternalMsg::operator=(ro);
1795 AppMsgReqPtr appMsg() {
return am_; }
1796 ReqOut &setAppMsg(AppMsgReqPtr am)
1807 Bool okToSnd() {
if (n1_ < 1)
return False; n1_--;
return True; }
1809 Int n1()
const {
return n1_; }
1810 ReqOut &setN1(Int n1) { n1_ = n1;
return *
this; }
1812 LongLong t1()
const {
return t1_; }
1813 ReqOut &setT1(LongLong t1) { t1_ = t1;
return *
this; }
1815 Int rspWnd()
const {
return rw_; }
1816 ReqOut &setRspWnd(Int rw) { rw_ = rw;
return *
this; }
1841 class ReqIn :
public InternalMsg
1848 ReqIn(
const ReqIn &ri)
1853 ReqIn(
const LocalNodeSPtr &ln,
const RemoteNodeSPtr &rn,
const TranslatorMsgInfo &tmi, cpUChar data, UShort len)
1854 : InternalMsg(ln, rn, tmi, data, len)
1861 Seid remoteSeid() {
return rs_; }
1862 ReqIn &remoteSeid(Seid rs) { rs_ = rs;
return *
this; }
1864 const ETime &remoteStartTime() {
return rst_; }
1865 ReqIn &remoteStartTime(
const ETime &rst) { rst_ = rst;
return *
this; }
1870 typedef ReqIn *ReqInPtr;
1884 application structure allocated by EncoderDecoder based on msg type
1908 Snding a Req (ReqOut)
1909 add ReqOut
object local
Node retransmission list (seqnbr is key)
1911 perform
"retransmission timer expiration" procedure
1912 start retransmission timer
1914 retransmission timer expiration
1916 send ReqMsgPtr to application layer indicating rsp timeout
1917 remove SentReq from retransmission list
1921 start expiration timer
1924 Lookup seqNbr in ReqIn list of remote
Node 1929 create
RcvdReq with seqNbr, rspWnd=0
1931 send EncodedMsg to EcDc layer to decoding
1934 Lookup sequence in ReqIn list of the remote node
1936 update rspWnd in ReqIn to the current wnd
1942 lookup ReqOut in local
Node retransmission list (seqNbr)
1944 set ReqOut rspWnd to current wnd
1945 create RspIn and send to EcDc layer to decode
1952 perform partial header parsing (seqNbr, isReq)
1954 go to Receiving a Req
1956 go to Receiving a Reponse
1965 inline TeidRangeManager_InvalidRangeBits::TeidRangeManager_InvalidRangeBits() {
1966 setText(
"The number of range bits must be between 0 and 7");
1969 class TeidRangeManager
1972 TeidRangeManager(Int rangeBits=0);
1973 ~TeidRangeManager();
1975 Bool assign(RemoteNodeSPtr &n);
1976 Void release(RemoteNodeSPtr &n);
1980 std::list<Int> free_;
1981 std::unordered_map<Int,RemoteNodeSPtr> used_;
1989 class TranslatorMsgInfo
2001 Seid seid()
const {
return seid_; }
2002 MsgType msgType()
const {
return mt_; }
2003 MsgClass msgClass()
const {
return mc_; }
2004 ULong seqNbr()
const {
return sn_; }
2005 UChar version()
const {
return ver_; }
2006 Bool isReq()
const {
return rqst_; }
2007 Bool createSession()
const {
return create_; }
2009 TranslatorMsgInfo &setSeid(
const Seid seid) { seid_ = seid;
return *
this; }
2010 TranslatorMsgInfo &setMsgType(
const MsgType mt) { mt_ = mt;
return *
this; }
2011 TranslatorMsgInfo &setMsgClass(
const MsgClass mc) { mc_ = mc;
return *
this; }
2012 TranslatorMsgInfo &setSeqNbr(
const ULong sn) { sn_ = sn;
return *
this; }
2013 TranslatorMsgInfo &setVersion(UChar ver) { ver_ = ver;
return *
this; }
2014 TranslatorMsgInfo &setReq(Bool rqst) { rqst_ = rqst;
return *
this; }
2015 TranslatorMsgInfo &setCreateSession(Bool create) { create_ = create;
return *
this; }
2045 virtual ReqOutPtr encodeHeartbeatReq(SndHeartbeatReqData &hb) = 0;
2049 virtual RspOutPtr encodeHeartbeatRsp(SndHeartbeatRspData &hb) = 0;
2053 virtual RspOutPtr encodeVersionNotSupportedRsp(ReqInPtr msg) = 0;
2059 virtual ReqOutPtr encodeReq(AppMsgReqPtr msg) = 0;
2064 virtual RspOutPtr encodeRsp(AppMsgRspPtr msg) = 0;
2069 virtual AppMsgReqPtr decodeReq(ReqInPtr msg) = 0;
2073 virtual AppMsgRspPtr decodeRsp(RspInPtr msg) = 0;
2078 virtual RcvdHeartbeatReqDataPtr decodeHeartbeatReq(ReqInPtr msg) = 0;
2082 virtual RcvdHeartbeatRspDataPtr decodeHeartbeatRsp(RspInPtr msg) = 0;
2088 virtual Void getMsgInfo(TranslatorMsgInfo &info, cpUChar msg, Int len) = 0;
2091 virtual Bool isVersionSupported(UChar ver) = 0;
2094 virtual MsgClass messageClass(MsgType mt) = 0;
2098 virtual MsgType pfcpHeartbeatReq() = 0;
2101 virtual MsgType pfcpHeartbeatRsp() = 0;
2104 virtual MsgType pfcpSessionEstablishmentReq() = 0;
2107 virtual MsgType pfcpSessionEstablishmentRsp() = 0;
2110 virtual MsgType pfcpAssociationSetupReq() = 0;
2113 virtual MsgType pfcpAssociationSetupRsp() = 0;
2117 pUChar data() {
return data_; }
2121 UChar data_[ESocket::UPD_MAX_MSG_LENGTH];
2129 struct SndReqExceptionData
2132 SndReqException err;
2134 typedef SndReqExceptionData *SndReqExceptionDataPtr;
2137 struct SndRspExceptionData
2140 SndRspException err;
2142 typedef SndRspExceptionData *SndRspExceptionDataPtr;
2145 struct SndHeartbeatReqExceptionData
2147 SndHeartbeatReqDataPtr req;
2148 SndHeartbeatReqException err;
2150 typedef SndHeartbeatReqExceptionData *SndHeartbeatReqExceptionDataPtr;
2153 struct SndHeartbeatRspExceptionData
2155 SndHeartbeatRspDataPtr rsp;
2156 SndHeartbeatRspException err;
2158 typedef SndHeartbeatRspExceptionData *SndHeartbeatRspExceptionDataPtr;
2161 struct RcvdReqExceptionData
2164 RcvdReqException err;
2166 typedef RcvdReqExceptionData *RcvdReqExceptionDataPtr;
2169 struct RcvdRspExceptionData
2172 RcvdRspException err;
2174 typedef RcvdRspExceptionData *RcvdRspExceptionDataPtr;
2177 struct EncodeReqExceptionData
2180 EncodeReqException err;
2182 typedef EncodeReqExceptionData *EncodeReqExceptionDataPtr;
2185 struct EncodeRspExceptionData
2188 EncodeRspException err;
2190 typedef EncodeRspExceptionData *EncodeRspExceptionDataPtr;
2197 #define APPLICATION_BASE_EVENT (EM_USER + 10000) 2204 RcvdReq = (APPLICATION_BASE_EVENT + 1),
2206 RcvdRsp = (APPLICATION_BASE_EVENT + 2),
2233 DECLARE_ERROR(ApplicationWorkGroup_UnrecognizedAddressFamily);
2239 friend CommunicationThread;
2243 virtual LocalNodeSPtr _createLocalNode() = 0;
2247 virtual RemoteNodeSPtr _createRemoteNode() = 0;
2251 virtual SessionBaseSPtr _createSession(LocalNodeSPtr &ln, RemoteNodeSPtr &rn) = 0;
2256 template <
class TWorker>
2259 friend CommunicationThread;
2269 return createLocalNode(addr, start);
2280 throw ApplicationWorkGroup_UnrecognizedAddressFamily();
2283 return createLocalNode(addr, start);
2294 Void startLocalNode(LocalNodeSPtr &ln);
2297 Void stopLocalNode(LocalNodeSPtr &ln);
2313 virtual Void onInit();
2317 virtual Void onQuit();
2321 virtual Void onRcvdReq(AppMsgReqPtr req);
2324 virtual Void onRcvdRsp(AppMsgRspPtr rsp);
2329 virtual Void onReqTimeout(AppMsgReqPtr req);
2342 virtual Void onRemoteNodeRestart(RemoteNodeSPtr &rn,
const ETime &restartTime);
2346 virtual Void onSndReqError(AppMsgReqPtr req, SndReqException &err);
2351 virtual Void onSndRspError(AppMsgRspPtr rsp, SndRspException &err);
2356 virtual Void onEncodeReqError(AppMsgReqPtr req, EncodeReqException &err);
2361 virtual Void onEncodeRspError(AppMsgRspPtr rsp, EncodeRspException &err);
2399 #define TRANSLATION_BASE_EVENT (EM_USER + 20000) 2407 enum class Events : UInt
2409 SndMsg = (TRANSLATION_BASE_EVENT + 1),
2410 RcvdReq = (TRANSLATION_BASE_EVENT + 2),
2411 RcvdRsp = (TRANSLATION_BASE_EVENT + 3),
2412 SndHeartbeatReq = (TRANSLATION_BASE_EVENT + 4),
2413 SndHeartbeatRsp = (TRANSLATION_BASE_EVENT + 5)
2416 ~TranslationThread();
2418 static TranslationThread &Instance()
2420 if (this_ ==
nullptr)
2421 this_ =
new TranslationThread();
2449 static Void cleanup()
2456 static TranslationThread *this_;
2457 TranslationThread();
2466 #define COMMUNICATION_BASE_EVENT (EM_USER + 30000) 2471 friend TranslationThread;
2473 enum class Events : UInt
2475 SndReq = (COMMUNICATION_BASE_EVENT + 1),
2476 SndRsp = (COMMUNICATION_BASE_EVENT + 2),
2477 HeartbeatReq = (COMMUNICATION_BASE_EVENT + 3),
2478 HeartbeatRsp = (COMMUNICATION_BASE_EVENT + 4),
2479 SndHeartbeatReqError = (COMMUNICATION_BASE_EVENT + 5),
2480 SndHeartbeatRspError = (COMMUNICATION_BASE_EVENT + 6),
2481 RcvdReqError = (COMMUNICATION_BASE_EVENT + 7),
2482 RcvdRspError = (COMMUNICATION_BASE_EVENT + 8),
2484 AddSession = (COMMUNICATION_BASE_EVENT + 10),
2485 DelSession = (COMMUNICATION_BASE_EVENT + 11),
2486 DelNxtRmtSession = (COMMUNICATION_BASE_EVENT + 12)
2489 ~CommunicationThread();
2491 static CommunicationThread &Instance()
2493 if (this_ ==
nullptr)
2494 this_ =
new CommunicationThread();
2505 CommunicationThread &setAddress(
const ESocket::Address &address) { address_ = address;
return *
this; }
2508 Bool addLocalNode(LocalNodeSPtr &ln)
2511 return lns_.insert(std::make_pair(ln->ipAddress(), ln)).second;
2514 Bool assignTeidRangeValue(RemoteNodeSPtr &rn)
2516 return trm_.assign(rn);
2519 Void releaseTeidRangeValue(RemoteNodeSPtr &rn)
2524 Void startLocalNode(LocalNodeSPtr &ln);
2525 Void stopLocalNode(LocalNodeSPtr &ln);
2529 LocalNodeUMap &localNodes() {
return lns_; }
2530 ERWLock &localNodesLock() {
return lnslck_; }
2532 Void setNbrActivityWnds(
size_t nbr);
2533 Void nextActivityWnd();
2534 size_t currentActivityWnd()
const {
return caw_; }
2536 Int currentRspWnd()
const {
return crw_; }
2541 Void releaseLocalNodes();
2556 Void onHeartbeatReqTimtout(AppMsgReqPtr am);
2558 static Void cleanup()
2565 static const Int rwOne_ = 1;
2566 static const Int rwTwo_ = 2;
2567 static const Int rwToggle_ = (rwOne_ ^ rwTwo_);
2568 static CommunicationThread *this_;
2570 CommunicationThread();
2571 Void addSession(SessionBaseSPtr &s);
2572 Void delSession(SessionBaseSPtr &s);
2575 TeidRangeManager trm_;
2591 static EString __method__ = __METHOD_NAME__;
2604 throw SessionBase_LocalSeidAlreadySet();
2610 throw SessionBase_RemoteSeidAlreadySet();
2616 SEND_TO_COMMUNICATION(AddSession, s2);
2624 SEND_TO_COMMUNICATION(DelSession, s2);
2627 inline InternalMsg::InternalMsg(
const LocalNodeSPtr &ln,
const RemoteNodeSPtr &rn,
const TranslatorMsgInfo &tmi, cpUChar data, UShort len)
2632 mc_(tmi.msgClass()),
2634 ver_(tmi.version()),
2641 inline Void ReqOut::startT1()
2645 static_cast<UInt>(CommunicationThread::Events::ReqTimeout),
2646 static_cast<pVoid>(
this));
2650 inline Bool RemoteNode::setRcvdReqRspWnd(ULong sn)
2652 return setRcvdReqRspWnd(sn, PFCP::CommunicationThread::Instance().currentRspWnd());
2655 template<
class TWorker>
2658 return CommunicationThread::Instance().createLocalNode(addr, start);
2661 template<
class TWorker>
2664 CommunicationThread::Instance().startLocalNode(ln);
2667 template<
class TWorker>
2670 CommunicationThread::Instance().stopLocalNode(ln);
2673 inline void* InternalMsg::operator
new(
size_t sz)
2675 if (pool_.allocSize() == 0)
2678 if (
sizeof(RspOut) > as) as =
sizeof(RspOut);
2679 if (
sizeof(RspIn) > as) as =
sizeof(RspIn);
2680 if (
sizeof(ReqOut) > as) as =
sizeof(ReqOut);
2681 if (
sizeof(ReqIn) > as) as =
sizeof(ReqIn);
2685 bs += bs %
sizeof(pVoid);
2686 size_t bc = ns / bs;
2688 pool_.setSize(as, ns);
2690 if (sz > pool_.allocSize())
2694 ex.
setText(
"internal message allocation size is larger than memory pool block size");
2697 return pool_.allocate();
2700 inline void InternalMsg::operator
delete(
void* m)
2702 pool_.deallocate(m);
2711 struct hash<PFCP::RemoteNodeSPtr>
2713 std::size_t operator()(
const PFCP::RemoteNodeSPtr &rn)
const noexcept
2722 #endif // #ifndef __EPFCP_H LocalNodeStateChange - CommunicationThread –> ApplicationWorkGroup - *LocalNodeStateChangeEvent.
LocalNode::State oldState() const
Definition: epfcp.h:1097
static LongLong setT1(LongLong t1)
Definition: epfcp.h:253
AppMsgSessionRsp()
Default construtor.
Definition: epfcp.h:1383
static Int setMaxApplicationWorkers(Int w)
Definition: epfcp.h:288
const EIpAddress & address() const
Retrieves the IP address object associated with the FqSeid.
Definition: epfcp.h:432
std::unordered_map< EIpAddress, LocalNodeSPtr > LocalNodeUMap
Definition: epfcp.h:1082
const struct sockaddr_storage & getSockAddrStorage() const
Retrieves a sockaddr pointer to the socket address.
Definition: esocket.h:214
LocalNodeSPtr & localNode()
Returns a reference to the local node object for this message.
Definition: epfcp.h:1316
RemoteNode::State oldState() const
Definition: epfcp.h:911
Node & setAddress(const ESocket::Address &addr)
Assigns the ESocket::Address object representing the IP address for this node.
Definition: epfcp.h:679
static Int setHeartbeatN1(Int hbn1)
Definition: epfcp.h:262
virtual ~AppMsgNodeReq()
Class destructor.
Definition: epfcp.h:1240
#define True
True.
Definition: ebase.h:25
static Long setLenActivityWnd(Long law)
Definition: epfcp.h:270
AppMsgNodeRsp * AppMsgNodeRspPtr
Definition: epfcp.h:1373
static LongLong t1()
Definition: epfcp.h:252
AppMsgRsp()
Default construtor.
Definition: epfcp.h:1291
Void stopLocalNode(LocalNodeSPtr &ln)
Stops the local node.
DecodeReqError - TranslationThread –> ApplicationWorkGroup - DecodeReqExceptionDataPtr.
ApplicationEvents
The events that will be received by the application work group.
Definition: epfcp.h:2201
Stats & stats()
Returns the stats object for this remote node.
Definition: epfcp.h:846
Work group template definition. The work group contains the event queue that all of the associated wo...
Definition: etevent.h:1704
RemoteNodeSPtr & remoteNode()
Returns a reference to the remote node object for this message.
Definition: epfcp.h:1192
static ETime Now()
Retrieves the current time.
Definition: etime.cpp:1147
EncodeRspError - TranslationThread –> ApplicationWorkGroup - EncodeRspExceptionDataPtr.
SndRspError - CommunicationThread –> ApplicationWorkGroup - SndRspExceptionDataPtr.
State
Definition: epfcp.h:756
SessionBase(LocalNodeSPtr &ln, RemoteNodeSPtr &rn)
Class constructor.
Definition: epfcp.h:542
static Int teidRangeBits()
Definition: epfcp.h:278
The PFCP Translator is used to encode and decode PFCP messages. This is a pure virtual base class tha...
Definition: epfcp.h:2034
std::pair< EIpAddress, LocalNodeSPtr > LocalNodeUMapEIpAddressPair
Definition: epfcp.h:1083
std::shared_ptr< Node > NodeSPtr
Definition: epfcp.h:741
base class for EThreadPrivate and EThreadPublic
Definition: etevent.h:1062
const ETime & startTime() const
Returns the Node start time.
Definition: epfcp.h:688
RemoteNodeRestartEvent(RemoteNodeSPtr &rn, RemoteNode::State oldst, RemoteNode::State newst, const ETime &restartTime)
Definition: epfcp.h:924
static Long lenActivityWnd()
Definition: epfcp.h:269
static ULongLong nodesCreated()
Definition: epfcp.h:705
LocalNode::State newState() const
Definition: epfcp.h:1098
PFCP stack namespace.
Definition: epfcp.h:36
virtual ~AppMsgRsp()
Class destructor.
Definition: epfcp.h:1305
static Void setApplication(ApplicationWorkGroup< TWorker > &app)
Definition: epfcp.h:297
static ApplicationWorkGroupBase & baseApplication()
Definition: epfcp.h:316
LocalNodeSPtr createLocalNode(const EIpAddress &ipaddr, UShort port=PFCP::Configuration::port(), Bool start=True)
Definition: epfcp.h:2271
AppMsgSessionRsp * AppMsgSessionRspPtr
Definition: epfcp.h:1410
AppMsgReq(LocalNodeSPtr &ln, RemoteNodeSPtr &rn, Bool allocSeqNbr)
Class constructor.
Definition: epfcp.h:1203
Void setSevere()
Sets the severity level of this error object to "Error".
Definition: eerror.h:237
EncodeReqError - TranslationThread –> ApplicationWorkGroup - EncodeReqExceptionDataPtr.
MessageStatsMap & messageStats()
Returns the message stats map for this remote node. Access to this reference must be protected with t...
Definition: epfcp.h:797
AppMsgNodeRsp & setReq(AppMsgNodeReqPtr req)
Sets the request message that this response is associated with.
Definition: epfcp.h:1370
MsgClass msgClass() const
Returns the message class for this message (Node or Session).
Definition: epfcp.h:1126
const ETime & restartTime() const
Definition: epfcp.h:936
static Int minApplicationWorkers()
Definition: epfcp.h:284
Void setText(cpStr pszText)
Sets the text associated with this error.
Definition: eerror.h:208
Request a write lock for the specified read-write lock object.
Definition: esynch.h:574
ULong alloc()
Assigns the next available sequence number. This operation is thread safe.
Definition: epfcp.h:352
static size_t setNnbrActivityWnds(size_t naw)
Definition: epfcp.h:267
static Int setTeidRangeBits(Int trb)
Definition: epfcp.h:279
static Long maxRspWait()
Definition: epfcp.h:264
static MsgType pfcpHeartbeatReq
Definition: epfcp.h:307
AppMsgRsp(AppMsgReqPtr amrq)
Class constructor.
Definition: epfcp.h:1299
LocalNodeSPtr createLocalNode(cpStr ipaddr, UShort port=PFCP::Configuration::port(), Bool start=True)
Creates a local node.
Definition: epfcp.h:2266
static Bool assignTeidRange()
Definition: epfcp.h:275
AppMsgReqPtr req()
Returns a shared pointer to the request application message.
Definition: epfcp.h:1313
Contains the base functionality for all aplication messages.
Definition: epfcp.h:1110
static Int setMinApplicationWorkers(Int w)
Definition: epfcp.h:285
ERWLock & getLock()
Returns the read/write lock protecting the message stats map and access to last activity.
Definition: epfcp.h:791
State state()
Gets the state of the local node.
Definition: epfcp.h:969
EIpAddress & setAddress()
Returns a modifiable reference to the IP address.
Definition: epfcp.h:435
AppMsg & setMsgClass(const MsgClass mc)
Definition: epfcp.h:1163
SessionBaseSPtr getSession(Seid seid)
Returns the session object for the specified SEID.
Definition: epfcp.h:697
RemoteNodeUMap & remoteNodes()
Returns the map of current remote nodes. Access to this map must be protected with the read/write loc...
Definition: epfcp.h:1006
RemoteNodeStateChangeEvent(RemoteNodeSPtr &rn, RemoteNode::State oldst, RemoteNode::State newst)
Definition: epfcp.h:903
static Int setMinTranslatorWorkers(Int w)
Definition: epfcp.h:291
const Seid seid() const
Returns the SEID.
Definition: epfcp.h:439
static ULongLong sessionsDeleted()
Definition: epfcp.h:595
Seid alloc()
Assigns the next available SEID. This operation is thread safe.
Definition: epfcp.h:381
LocalNodeStateChangeEvent(LocalNodeSPtr &ln, LocalNode::State oldst, LocalNode::State newst)
Definition: epfcp.h:1089
RcvdReq - TranslationThread –> ApplicationWorkGroup - AppMsgReqPtr.
static _EThreadEventNotification & threadApplication()
Definition: epfcp.h:315
RemoteNode::State oldState() const
Definition: epfcp.h:934
AppMsg(const AppMsg &dm)
Definition: epfcp.h:1154
static Int socketBufferSize()
Definition: epfcp.h:249
virtual const EString & className()
Returns the class name for this object.
Definition: epfcp.h:1136
Int teidRangeValue() const
Returns the currently configured TEID range value.
Definition: epfcp.h:767
SessionBase & setLocalSeid(SessionBaseSPtr &s, Seid ls)
Sets the local SEID for this session.
Definition: epfcp.h:585
Encapsulates the UDP Socket functionality used to communicate with a PFCP peer.
Definition: epfcp.h:491
SeidManager()
Default constructor.
Definition: epfcp.h:379
Contains the basic Node functionality common to both a LocalNode and a RemoteNode.
Definition: epfcp.h:654
The application worker thread class. The various virtual methods should be overridden to implement ap...
Definition: epfcp.h:2307
static ETimerPool & Instance()
Retrieves the single instance of the ETimerPool object.
Definition: etimerpool.h:70
Represents a request application message.
Definition: epfcp.h:1179
static ELogger & setLogger(ELogger &log)
Definition: epfcp.h:273
Represents a response application message.
Definition: epfcp.h:1379
#define False
False.
Definition: ebase.h:27
RemoteNodeSPtr & remoteNode()
Returns a reference to the remote node object for this message.
Definition: epfcp.h:1319
Void free(ULong sn)
Releases a previously allocated sequence number.
Definition: epfcp.h:360
Class for manipulating date and time of day values.
Definition: etime.h:199
Node & setIpAddress(const EIpAddress &ipaddr)
Assigns the IP address for this node.
Definition: epfcp.h:668
RcvdRsp - TranslationThread –> ApplicationWorkGroup - AppMsgRspPtr.
static ULongLong sessionsCreated()
Definition: epfcp.h:594
FqSeid()
Default constructor.
Definition: epfcp.h:408
RemoteNodeStateChange - CommunicationThread –> ApplicationWorkGroup - *RemoteNodeStateChangeEvent.
AppMsgSessionReq * AppMsgSessionReqPtr
Definition: epfcp.h:1281
static Int maxApplicationWorkers()
Definition: epfcp.h:287
SequenceManager()
Default constructor.
Definition: epfcp.h:349
Allocates and deallocates SEID's (PFCP session ID's). Each "slice" should have it's own instance of t...
Definition: epfcp.h:375
Represents a worker thread that is part of a work group.
Definition: etevent.h:1444
AppMsgRsp * AppMsgRspPtr
Definition: epfcp.h:1334
AppMsgReq()
Default constructor.
Definition: epfcp.h:1196
static Translator & setTranslator(Translator &xlator)
Definition: epfcp.h:282
static Int heartbeatN1()
Definition: epfcp.h:261
std::pair< EIpAddress, RemoteNodeSPtr > RemoteNodeUMapPair
Definition: epfcp.h:898
The PFCP application work group template. This template contains the common event queue for the appli...
Definition: epfcp.h:2257
Defines the EIpAddress and EIpFilterRule classes.
AppMsgNodeReq()
Default constructor.
Definition: epfcp.h:1227
virtual ~AppMsgReq()
Class destructor.
Definition: epfcp.h:1183
static UShort setPort(UShort port)
Definition: epfcp.h:247
static MsgType pfcpAssociationSetupRsp
Definition: epfcp.h:312
AppMsgNodeRsp(AppMsgNodeReqPtr &amrq)
Class constructor.
Definition: epfcp.h:1353
virtual ~Node()
Class destructor.
Definition: epfcp.h:660
static Int minTranslatorWorkers()
Definition: epfcp.h:290
ULong seqNbr() const
Returns the sequence number associated wtih this message.
Definition: epfcp.h:1120
Thread timer class.
Definition: etevent.h:828
ERWLock & remoteNodesLock()
Returns a lock protected access to the remote nodes map.
Definition: epfcp.h:1010
SndReqError - CommunicationThread –> ApplicationWorkGroup - SndReqExceptionDataPtr.
virtual ~AppMsgSessionReq()
Class destructor.
Definition: epfcp.h:1269
AppMsgNodeRsp()
Default construtor.
Definition: epfcp.h:1344
AppMsg()
Definition: epfcp.h:1147
AppMsg * AppMsgPtr
Definition: epfcp.h:1173
AppMsgRsp & setReq(AppMsgReq *req)
Sets the request message that this response is associated with.
Definition: epfcp.h:1323
std::shared_ptr< SessionBase > SessionBaseSPtr
Definition: epfcp.h:530
std::unordered_map< Seid, SessionBaseSPtr > SessionBaseSPtrUMap
Definition: epfcp.h:647
A UDP socket class capabile of sending and receiving data.
Definition: esocket.h:1222
Void Uninitialize()
Uninitializes/stops the PFCP stack.
Definition: epfcp.cpp:331
static LongLong heartbeatT1()
Definition: epfcp.h:255
An event message that is to be sent to a thread.
Definition: etevent.h:264
The socket thread base class. An event based thread class capable of surfacing socket events...
Definition: esocket.h:1674
FqSeid & setSeid(Seid seid)
Assigns the SEID value.
Definition: epfcp.h:443
Represents the local PFCP node.
Definition: epfcp.h:955
AppMsg & setSeqNbr(const ULong sn)
Assigns the sequence number for this message.
Definition: epfcp.h:1132
#define END_MESSAGE_MAP2()
Ends the message map declaration.
Definition: etevent.h:1433
AppMsgNodeReq * AppMsgNodeReqPtr
Definition: epfcp.h:1245
static Translator & translator()
Definition: epfcp.h:281
LocalNodeSPtr & localNode()
Definition: epfcp.h:1096
Void startLocalNode(LocalNodeSPtr &ln)
Startes an externally constructed local node.
AppMsg & setMsgType(const MsgType mt)
Definition: epfcp.h:1162
DecodeRspError - TranslationThread –> ApplicationWorkGroup - EncodeRspExceptionDataPtr.
EIpAddress & ipAddress()
Returns the IP address associated with this node.
Definition: epfcp.h:664
LocalNodeSPtr & localNode()
Returns a reference to the local node object for this message.
Definition: epfcp.h:1189
Bool isReq() const
Returns True if this message is a request message, otherwise False.
Definition: epfcp.h:1128
AppMsgSessionReq()
Default constructor.
Definition: epfcp.h:1255
The base class for exceptions derived from std::exception.
Definition: eerror.h:94
static MsgType pfcpAssociationSetupReq
Definition: epfcp.h:311
Represents an IP address with mask.
Definition: eip.h:40
static MsgType pfcpHeartbeatRsp
Definition: epfcp.h:308
std::pair< ULong, LocalNodeSPtr > LocalNodeUMapULongPair
Definition: epfcp.h:1084
A class used to build JSON strings. It maintains a stack of JSON objects which allows you to build a ...
Definition: ejsonbuilder.h:30
State state() const
Returns the current state of the local node.
Definition: epfcp.h:864
RemoteNodeSPtr createRemoteNode(cpStr addr, UShort port)
Creates a remote Node that this local node will "talk" to.
Definition: epfcp.h:991
MsgType msgType() const
Returns the message type for this message.
Definition: epfcp.h:1123
Represents a remote or peer PFCP node or host.
Definition: epfcp.h:751
std::unordered_map< EIpAddress, RemoteNodeSPtr > RemoteNodeUMap
Definition: epfcp.h:897
Represents a PFCP session. It is expected that a developer utilizing this library will derive their o...
Definition: epfcp.h:536
Represents a response application message.
Definition: epfcp.h:1340
static Bool setAssignTeidRange(Bool atr)
Definition: epfcp.h:276
const in_addr & ipv4Address() const
Returns a reference to the in_addr structure that represents an IPv4 address.
Definition: eip.h:225
RemoteNodeSPtr & remoteNode()
Returns the RemoteNode object associated with this session.
Definition: epfcp.h:568
virtual ~AppMsgSessionRsp()
Class destructor.
Definition: epfcp.h:1397
const sa_family_t family() const
Returns the address family associated with this address object.
Definition: eip.h:231
static LongLong setHeartbeatT1(LongLong hbt1)
Definition: epfcp.h:256
AppMsgReq * AppMsgReqPtr
Definition: epfcp.h:1216
virtual ~SessionBase()
Class destructor.
virtual Void destroy(SessionBaseSPtr &s)
Starts the destruction process for the session.
static Int setN1(Int n1)
Definition: epfcp.h:259
LocalNodeSPtr & localNode()
Returns the LocalNode object associated with this session.
Definition: epfcp.h:565
ETimerPool & unregisterTimer(ULong timerid)
Unregisters an expiration timer.
Definition: etimerpool.cpp:143
static size_t nbrActivityWnds()
Definition: epfcp.h:266
AppMsgSessionReq(SessionBaseSPtr &ses, Bool allocSeqNbr)
Class constructor.
Definition: epfcp.h:1262
ULong registerTimer(LongLong ms, _EThreadEventMessageBase *msg, _EThreadEventNotification ¬ify)
Registers an expiration timer.
Definition: etimerpool.cpp:68
DECLARE_ERROR(SessionBase_LocalSeidAlreadySet)
#define DECLARE_MESSAGE_MAP()
Inserts message map declarations into the thread class.
Definition: etevent.h:1015
static ULongLong nodesDeleted()
Definition: epfcp.h:706
Represents a Fully Qualified SEID. This combines an IP address with a SEID.
Definition: epfcp.h:404
virtual ~AppMsgNodeRsp()
Class destructor.
Definition: epfcp.h:1360
The base socket class.
Definition: esocket.h:447
FqSeid(const FqSeid &fqseid)
Copy constructor.
Definition: epfcp.h:415
static ELogger & logger()
Definition: epfcp.h:272
SessionBase & setRemoteSeid(SessionBaseSPtr &s, Seid rs)
Sets the remote SEID for this session.
Definition: epfcp.h:590
AppMsgNodeReqPtr req()
Returns a shared pointer to the request application message.
Definition: epfcp.h:1366
Represents a request application node message (not associated with a session).
Definition: epfcp.h:1223
AppMsg & setIsReq(const Bool rqst)
Definition: epfcp.h:1164
Defines a logger.
Definition: elogger.h:76
Allocates and deallocates sequence numbers used in PFCP request messages. Each "slice" should have it...
Definition: epfcp.h:345
static UShort port()
Definition: epfcp.h:246
Contains all of the configuration values used in the PFCP stack.
Definition: epfcp.h:239
State
Definition: epfcp.h:960
NodeSocket & socket()
Returns a reference to the underlying socket object for this local host.
Definition: epfcp.h:1030
State state() const
Returns the current state of the local node.
Definition: epfcp.h:1034
static MessageStatsMap & messageStatsTemplate()
Returns a reference to the message stats template map. Derived applications should populate this with...
Definition: epfcp.h:305
RemoteNodeRestart - CommunicationThread –> ApplicationWorkGroup - *RemoteNodeRestartEvent.
RemoteNode & setTeidRangeValue(Int trv)
Sets the TEID range value.
Definition: epfcp.h:771
Definition: esocket.h:2223
const Seid remoteSeid() const
Returns the remote SEID associated with this session.
Definition: epfcp.h:574
NodeSocket & clearLocalNode()
Clears the assigned LocalNode.
Definition: epfcp.h:506
Contains the class definitions to support the pool based memory allocation.
#define ON_MESSAGE2(id, memberFxn)
Defines an invidual event handler.
Definition: etevent.h:1429
RemoteNode::State newState() const
Definition: epfcp.h:912
RemoteNode::State newState() const
Definition: epfcp.h:935
AppMsgSessionReqPtr req()
Returns a shared pointer to the request application message.
Definition: epfcp.h:1403
const Seid localSeid() const
Returns the SEID associated with this session.
Definition: epfcp.h:571
AppMsgSessionRsp(AppMsgSessionReqPtr &amrq)
Class constructor.
Definition: epfcp.h:1391
virtual ~AppMsg()
Class destructor.
Definition: epfcp.h:1114
SessionBase & setSeid(SessionBaseSPtr &s, Seid ls, Seid rs, Bool notify=True)
Sets the local and remote SEID for this session.
Node()
Default constructor.
Definition: epfcp.h:658
ESocket::Address & address()
Returns the ESocket::Address object representing the IP address for this node.
Definition: epfcp.h:674
RemoteNodeSPtr & remoteNode()
Definition: epfcp.h:910
ReqTimeout - CommunicationThread –> ApplicationWorkGroup - AppMsgReqPtr.
#define DECLARE_ERROR_ADVANCED(__e__)
Declares exception class derived from EError with no constructor parameters and developer defined con...
Definition: eerror.h:61
static Int setMaxTranslatorWorkers(Int w)
Definition: epfcp.h:294
NodeSocket & setLocalNode(LocalNodeSPtr &ln)
Assigns the LocalNode that this socket is associated with.
Definition: epfcp.h:503
const in6_addr & ipv6Address() const
Returns a reference to the in6_addr structure that represents an IPv6 address.
Definition: eip.h:228
SessionBase(const SessionBase &s)
Copy constructor.
Definition: epfcp.h:552
A class to hold message statistics for the remote node.
Definition: epfcp.h:785
#define BEGIN_MESSAGE_MAP2(theClass, baseClass)
Definition: etevent.h:1415
String class.
Definition: estring.h:31
Encapsulates a sockaddr_storage structure that represents a socket address.
Definition: esocket.h:148
Encapsulates a read-write lock object.
Definition: esynch.h:507
Node & setStartTime(const ETime &st=ETime::Now())
Assigns the Node start time.
Definition: epfcp.h:692
SessionBaseSPtr & session()
Returs a reference to the session shaerd pointer.
Definition: epfcp.h:1275
Void Initialize()
Initializes/starts the PFCP stack. This should be called after setting the initial configuration valu...
Definition: epfcp.cpp:306
static Int n1()
Definition: epfcp.h:258
Represents a response application message.
Definition: epfcp.h:1287
RemoteNodeSPtr & remoteNode()
Definition: epfcp.h:933
static MsgType pfcpSessionEstablishmentReq
Definition: epfcp.h:309
Represents a request application session message.
Definition: epfcp.h:1251
AppMsgSessionRsp & setReq(AppMsgSessionReqPtr req)
Sets the request message that this response is associated with.
Definition: epfcp.h:1407
FqSeid & operator=(const FqSeid &fqseid)
Assignment operator.
Definition: epfcp.h:423
Address & setAddress(cpStr addr, UShort port)
Assigns the socket address.
Definition: esocket.h:307
static Int setSocketBufferSize(Int sz)
Definition: epfcp.h:250
static Int maxTranslatorWorkers()
Definition: epfcp.h:293
static MsgType pfcpSessionEstablishmentRsp
Definition: epfcp.h:310
AppMsgNodeReq(LocalNodeSPtr &ln, RemoteNodeSPtr &rn, Bool allocSeqNbr)
Class constructor.
Definition: epfcp.h:1234
Void free(Seid seid)
Releases a previously allocated SEID.
Definition: epfcp.h:390