ConnectionControlEnbD2D.h Source File

Simu5G: ConnectionControlEnbD2D.h Source File
Simu5G
ConnectionControlEnbD2D.h
1//
2// Simu5G
3//
4// Authors: Andras Varga (OpenSim Ltd)
5//
6// This file is part of a software released under the license included in file
7// "license.pdf". Please read LICENSE and README files before using it.
8// The above files and the present reference are part of the software itself,
9// and cannot be removed from it.
10//
11
12#ifndef _SIMU5G_CONNECTIONCONTROLENBD2D_H_
13#define _SIMU5G_CONNECTIONCONTROLENBD2D_H_
14
15#include <map>
16
17#include "simu5g/stack/rrc/ConnectionControlEnb.h"
18
19namespace simu5g {
20
21class D2dBinder;
22class D2dModeSelectionBase;
23
29{
30 protected:
31 // the node's D2D mode selection, if it has one
32 inet::ModuleRefByPar<D2dModeSelectionBase> d2dModeSelection_;
33
34 // the network-wide sidelink state
35 inet::ModuleRefByPar<D2dBinder> d2dBinder_;
36
37 // the post-handover D2D mode re-selections pending, by the leg they are for
38 std::map<omnetpp::cMessage *, MacNodeId> modeSwitchTimers_;
39
40 protected:
41 void initialize(int stage) override;
42 void handleMessage(omnetpp::cMessage *msg) override;
43
44 // Ask the node's D2D mode selection to switch the leg's D2D flows: to
45 // infrastructure mode before a handover, or (back) to direct mode after one
46 virtual void requestModeSwitch(MacNodeId legId, bool handoverCompleted);
47
48 // A D2D-capable leg: its D2D flows go back to infrastructure mode before the
49 // source commands its handover; its D2D direction is attached at this node's AMC
50 // when it arrives, followed by a D2D mode re-selection at the end of the instant;
51 // and detached when it leaves
52 void beforeHandoverCommand(MacNodeId legId, const UeContext& ctx) override;
53 void legArrived(MacNodeId legId, const UeContext& ctx) override;
54 void legLeft(MacNodeId legId, const UeContext& ctx) override;
55
56 std::set<DrbId>& foreignPairPool(const std::pair<MacNodeId, MacNodeId>& pair) override;
57 DrbId establishD2dBearer(const FlowId& flow, const FlowBindingKey& key) override;
58 void createMulticastConnection(const FlowId& flow, const BearerRequest& req, bool withPdcp) override;
59
60 public:
61 ~ConnectionControlEnbD2D() override;
62
63 // A node has joined a multicast group. If a sender has already established that
64 // group's bearer, the node missed the RX-leg provisioning createMulticastConnection()
65 // did over the membership as it stood then; give it one now, or its MAC will
66 // receive PDUs for a connection it has no descriptor for and assert in
67 // macPduUnmake(). Nodes that join before the bearer exists are covered by
68 // createMulticastConnection() itself; createIncomingConnection() de-duplicates,
69 // so a node reached by both paths is harmless.
70 void multicastGroupJoined(MacNodeId nodeId, MacNodeId groupId) override;
71};
72
73} //namespace
74
75#endif
Definition ConnectionControlEnbD2D.h:29
Definition ConnectionControlEnb.h:78
Definition D2dBinder.h:45
Definition AlertReceiver.h:24