test_UDPv4TransportDescriptor.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef _FASTDDS_TEST_UDPV4_TRANSPORT_DESCRIPTOR_
  15. #define _FASTDDS_TEST_UDPV4_TRANSPORT_DESCRIPTOR_
  16. #include <fastdds/rtps/transport/SocketTransportDescriptor.h>
  17. #include <fastdds/rtps/common/SequenceNumber.h>
  18. #include <functional>
  19. namespace eprosima{
  20. namespace fastdds{
  21. namespace rtps{
  22. typedef struct test_UDPv4TransportDescriptor : public SocketTransportDescriptor{
  23. typedef std::function<bool(fastrtps::rtps::CDRMessage_t& msg)> filter;
  24. // Test shim parameters
  25. uint8_t dropDataMessagesPercentage;
  26. filter drop_data_messages_filter_;
  27. bool dropParticipantBuiltinTopicData;
  28. bool dropPublicationBuiltinTopicData;
  29. bool dropSubscriptionBuiltinTopicData;
  30. uint8_t dropDataFragMessagesPercentage;
  31. filter drop_data_frag_messages_filter_;
  32. uint8_t dropHeartbeatMessagesPercentage;
  33. filter drop_heartbeat_messages_filter_;
  34. uint8_t dropAckNackMessagesPercentage;
  35. filter drop_ack_nack_messages_filter_;
  36. uint8_t dropGapMessagesPercentage;
  37. filter drop_gap_messages_filter_;
  38. // General drop percentage (indescriminate)
  39. uint8_t percentageOfMessagesToDrop;
  40. filter messages_filter_;
  41. std::vector<fastrtps::rtps::SequenceNumber_t> sequenceNumberDataMessagesToDrop;
  42. uint32_t dropLogLength; // logs dropped packets.
  43. RTPS_DllAPI test_UDPv4TransportDescriptor();
  44. virtual ~test_UDPv4TransportDescriptor(){}
  45. virtual TransportInterface* create_transport() const override;
  46. } test_UDPv4TransportDescriptor;
  47. } // namespace rtps
  48. } // namespace fastdds
  49. } // namespace eprosima
  50. #endif // FASTDDS_TEST_UDPV4_TRANSPORT_DESCRIPTOR_