henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2008 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 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 11 | #ifndef RTC_BASE_NET_HELPERS_H_ |
| 12 | #define RTC_BASE_NET_HELPERS_H_ |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 13 | |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 14 | #if defined(WEBRTC_POSIX) |
Jeremy Leconte | 83d1f9a | 2024-09-10 07:47:49 | [diff] [blame] | 15 | #include <sys/socket.h> // IWYU pragma: export |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 16 | #elif WEBRTC_WIN |
| 17 | #include <winsock2.h> // NOLINT |
Mirko Bonadei | e5f4c6b | 2021-01-15 09:41:01 | [diff] [blame] | 18 | |
| 19 | #include "rtc_base/win32.h" |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 20 | #endif |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 21 | |
Ali Tofigh | 2ab914c | 2022-04-13 10:55:15 | [diff] [blame] | 22 | #include "absl/strings/string_view.h" |
Mirko Bonadei | 62ba379 | 2023-01-20 17:32:07 | [diff] [blame] | 23 | #include "rtc_base/system/rtc_export.h" |
Ali Tofigh | 2ab914c | 2022-04-13 10:55:15 | [diff] [blame] | 24 | |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 25 | namespace rtc { |
| 26 | |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 27 | // rtc namespaced wrappers for inet_ntop and inet_pton so we can avoid |
| 28 | // the windows-native versions of these. |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 29 | const char* inet_ntop(int af, const void* src, char* dst, socklen_t size); |
Ali Tofigh | 2ab914c | 2022-04-13 10:55:15 | [diff] [blame] | 30 | int inet_pton(int af, absl::string_view src, void* dst); |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 31 | |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 32 | } // namespace rtc |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 33 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 34 | #endif // RTC_BASE_NET_HELPERS_H_ |