Add GetTransportParametersOffer method for DatagramTransportInterface

This change adds missing GetTransportParametersOffer, which is required for datagram transport setup. We have exactly the same method in MediaTransportInterface. It's possible to add a separate interface, which will be used in both Media and Datagram transports, but I do not want to overcomplicate it now until we know more about future of media and datagram transports.


Bug: webrtc:9719
Change-Id: I8b6c9ebc9522acba75f74da2e18e4bb1eb0d1e4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137861
Commit-Queue: Anton Sukhanov <sukhanov@webrtc.org>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28011}
diff --git a/api/datagram_transport_interface.h b/api/datagram_transport_interface.h
index d64c0f3..271b951c8 100644
--- a/api/datagram_transport_interface.h
+++ b/api/datagram_transport_interface.h
@@ -16,6 +16,7 @@
 #include <string>
 #include <utility>
 
+#include "absl/types/optional.h"
 #include "api/array_view.h"
 #include "api/congestion_control_interface.h"
 #include "api/media_transport_interface.h"
@@ -93,6 +94,18 @@
   // SetDataTransportSink(nullptr) before the data transport is destroyed or
   // before new sink is set.
   virtual void SetDatagramSink(DatagramSinkInterface* sink) = 0;
+
+  // Retrieves callers config (i.e. media transport offer) that should be passed
+  // to the callee, before the call is connected. Such config is opaque to SDP
+  // (sdp just passes it through). The config is a binary blob, so SDP may
+  // choose to use base64 to serialize it (or any other approach that guarantees
+  // that the binary blob goes through). This should only be called for the
+  // caller's perspective.
+  //
+  // TODO(sukhanov): Make pure virtual.
+  virtual absl::optional<std::string> GetTransportParametersOffer() const {
+    return absl::nullopt;
+  }
 };
 
 }  // namespace webrtc