xref: /aosp_15_r20/external/webrtc/rtc_base/net_helpers.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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 
11 #ifndef RTC_BASE_NET_HELPERS_H_
12 #define RTC_BASE_NET_HELPERS_H_
13 
14 #if defined(WEBRTC_POSIX)
15 #include <sys/socket.h>
16 #elif WEBRTC_WIN
17 #include <winsock2.h>  // NOLINT
18 
19 #include "rtc_base/win32.h"
20 #endif
21 
22 #include "absl/strings/string_view.h"
23 
24 namespace rtc {
25 
26 // rtc namespaced wrappers for inet_ntop and inet_pton so we can avoid
27 // the windows-native versions of these.
28 const char* inet_ntop(int af, const void* src, char* dst, socklen_t size);
29 int inet_pton(int af, absl::string_view src, void* dst);
30 
31 bool HasIPv4Enabled();
32 bool HasIPv6Enabled();
33 
34 }  // namespace rtc
35 
36 #endif  // RTC_BASE_NET_HELPERS_H_
37