Index: webrtc/base/ifaddrs_converter.h |
diff --git a/webrtc/base/ifaddrs_converter.h b/webrtc/base/ifaddrs_converter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b0e02916dfb4f59542e9ce9dda477a8543f8b230 |
--- /dev/null |
+++ b/webrtc/base/ifaddrs_converter.h |
@@ -0,0 +1,41 @@ |
+/* |
+ * Copyright 2015 The WebRTC Project Authors. All rights reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+#ifndef WEBRTC_BASE_IFADDRS_CONVERTER_H_ |
+#define WEBRTC_BASE_IFADDRS_CONVERTER_H_ |
+ |
+#if defined(WEBRTC_ANDROID) |
+#include "webrtc/base/ifaddrs-android.h" |
+#else |
+#include <ifaddrs.h> |
+#endif // WEBRTC_ANDROID |
+ |
+#include "webrtc/base/ipaddress.h" |
+ |
+namespace rtc { |
+ |
+class IfAddrsConverter { |
pthatcher1
2015/12/18 19:51:20
Can you please leave a comment explaining the purp
guoweis_webrtc
2015/12/21 20:26:33
Done.
|
+ public: |
+ IfAddrsConverter(); |
+ virtual ~IfAddrsConverter(); |
+ virtual bool Convert(const struct ifaddrs* interface, |
+ InterfaceAddress* ipaddress, |
+ IPAddress* mask); |
pthatcher1
2015/12/18 19:51:20
I like the name pattern ConvertXToY. Can you use
guoweis_webrtc
2015/12/21 20:26:33
Done.
|
+ |
+ protected: |
+ virtual bool ConvertNativeToIPAttributes(const struct ifaddrs* interface, |
+ int* ip_attributes); |
+}; |
+ |
+IfAddrsConverter* CreateIfAddrsConverter(); |
+ |
+} // namespace rtc |
+ |
+#endif // WEBRTC_BASE_IFADDRS_CONVERTER_H_ |