signaling_route.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef TEST_PEER_SCENARIO_SIGNALING_ROUTE_H_
  11. #define TEST_PEER_SCENARIO_SIGNALING_ROUTE_H_
  12. #include <string>
  13. #include <utility>
  14. #include "test/network/network_emulation_manager.h"
  15. #include "test/peer_scenario/peer_scenario_client.h"
  16. namespace webrtc {
  17. namespace test {
  18. // Helper class to reduce the amount of boilerplate required for ICE signalling
  19. // ad SDP negotiation.
  20. class SignalingRoute {
  21. public:
  22. SignalingRoute(PeerScenarioClient* caller,
  23. PeerScenarioClient* callee,
  24. TrafficRoute* send_route,
  25. TrafficRoute* ret_route);
  26. void StartIceSignaling();
  27. // TODO(srte): Handle lossy links.
  28. void NegotiateSdp(
  29. std::function<void(SessionDescriptionInterface* offer)> modify_offer,
  30. std::function<void(const SessionDescriptionInterface& answer)>
  31. exchange_finished);
  32. void NegotiateSdp(
  33. std::function<void(const SessionDescriptionInterface& answer)>
  34. exchange_finished);
  35. SignalingRoute reverse() {
  36. return SignalingRoute(callee_, caller_, ret_route_, send_route_);
  37. }
  38. private:
  39. PeerScenarioClient* const caller_;
  40. PeerScenarioClient* const callee_;
  41. TrafficRoute* const send_route_;
  42. TrafficRoute* const ret_route_;
  43. };
  44. } // namespace test
  45. } // namespace webrtc
  46. #endif // TEST_PEER_SCENARIO_SIGNALING_ROUTE_H_