#ifndef TAS_H #define TAS_H #include "ns3/object.h" #include "ns3/nstime.h" #include "ns3/data-rate.h" #include "ns3/tsn-net-device.h" #include "ns3/transmission-gate.h" #include "ns3/tsn-transmission-selection-algo.h" namespace ns3 { class TsnNetDevice; class TsnTransmissionSelectionAlgo; class Tas: public Object { public: /** * \brief Get the TypeId * * \return The TypeId for this class */ static TypeId GetTypeId(); /** * \brief Create a Tas */ Tas(); /** * Destroy a Tas * * This is the destructor for the Tas. */ ~Tas(); // Delete copy constructor and assignment operator to avoid misuse Tas& operator=(const Tas&) = delete; Tas(const Tas&) = delete; void SetTsnNetDevice(Ptr net); bool IsEnable(); bool IsSendable(Ptr p, DataRate d, uint8_t preambleAndSFDGap, uint8_t interframeGap, uint32_t mtu); void AddTsa(Ptr tsa); void AddTransmissionGate(); void Start(); void ClockUpdate(); bool IsGateOpen(int i); void AddGclEntry(Time duration, uint8_t states); enum GuardBandModes { NONE, MTU, PKTSIZE, }; Time GetHardwareLatency(); protected: private: void UpdateGates(bool clockUpdate); int GetCurrentGclEntry(); Time GetLastOpeningTime(Time currentTime); /** * The TransmissionGates which this TsnNetDevice uses */ std::vector> m_transmissionGates; Ptr m_net; Callback GateUpdateCallback; /** * \ingroup tsn * Structure holding a gcl entry */ struct GclEntry { Time duration; uint8_t states; }; std::vector> m_transmissionSelectionAlgos; /** * The GateControlList which this TsnNetDevice uses */ std::vector m_GateControlList; int m_CurrentGclEntry = 0; Time m_cycleDuration; Time m_startTime; Time m_lastGateOpeningTime; bool m_start = false; EventId m_NextGatesUpdate; bool m_MultidropMode; GuardBandModes m_GuardBandMode; TracedCallback m_gatesUpdate; uint16_t m_maxGclEntryNumber; Time m_maxGclTimeInterval; Time m_maxGclCycleDuration; Time m_minLatencyOverhead; Time m_maxLatencyOverhead; }; } #endif /* TAS_H */