File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -432,6 +432,30 @@ MacNodeId Binder::getSecondaryNode(MacNodeId masterEnbId)
432432 return NODEID_NONE ;
433433}
434434
435+ MacNodeId Binder::getUeNodeId (MacNodeId ue, bool isNr)
436+ {
437+ // TODO better impl! mapping via IP address is not ideal.
438+ if (!isValidNodeId (ue) || getNodeTypeById (ue) != UE )
439+ throw cRuntimeError (" Binder::getUeNodeId(): bad ueId %hu" , num (ue));
440+
441+ inet::Ipv4Address ueIpAddr = getIPv4Address (ue);
442+ if (ueIpAddr == inet::Ipv4Address::UNSPECIFIED_ADDRESS )
443+ throw cRuntimeError (" Binder::getUeNodeId(): no IP address for UE %hu" , num (ue));
444+
445+ if (isNr) {
446+ // Request for NR nodeId
447+ if (ipAddressToNrMacNodeId_.find (ueIpAddr) != ipAddressToNrMacNodeId_.end ())
448+ return ipAddressToNrMacNodeId_[ueIpAddr];
449+ }
450+ else {
451+ // Request for LTE nodeId
452+ if (ipAddressToMacNodeId_.find (ueIpAddr) != ipAddressToMacNodeId_.end ())
453+ return ipAddressToMacNodeId_[ueIpAddr];
454+ }
455+
456+ return NODEID_NONE ;
457+ }
458+
435459void Binder::registerMecHost (const inet::L3Address& mecHostAddress)
436460{
437461 mecHostAddress_.insert (mecHostAddress);
Original file line number Diff line number Diff line change @@ -351,6 +351,15 @@ class Binder : public cSimpleModule
351351 return ipAddressToNrMacNodeId_[address];
352352 }
353353
354+ /* *
355+ * Returns the selected nodeId (LTE/NR) for the given UE.
356+ *
357+ * @param ue The UE's current MacNodeId (can be either LTE or NR)
358+ * @param isNr If true, returns the NR nodeId; if false, returns the LTE nodeId
359+ * @return The requested nodeId, or NODEID_NONE if not found/available
360+ */
361+ MacNodeId getUeNodeId (MacNodeId ue, bool isNr);
362+
354363 /* *
355364 * author Alessandro Noferi
356365 *
You can’t perform that action at this time.
0 commit comments