blob: 631c6348a707fdbc7fab9ccf26a015f4742c3b6d [file] [log] [blame]
henrike@webrtc.orgf0488722014-05-13 18:00:261/*
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 Anton10542f22019-01-11 17:11:0011#ifndef RTC_BASE_NET_HELPERS_H_
12#define RTC_BASE_NET_HELPERS_H_
henrike@webrtc.orgf0488722014-05-13 18:00:2613
Henrik Kjellanderec78f1c2017-06-29 05:52:5014#if defined(WEBRTC_POSIX)
Yves Gerey988cc082018-10-23 10:03:0115#include <sys/socket.h>
Henrik Kjellanderec78f1c2017-06-29 05:52:5016#elif WEBRTC_WIN
17#include <winsock2.h> // NOLINT
Mirko Bonadeie5f4c6b2021-01-15 09:41:0118
19#include "rtc_base/win32.h"
Henrik Kjellanderec78f1c2017-06-29 05:52:5020#endif
henrike@webrtc.orgf0488722014-05-13 18:00:2621
Ali Tofigh2ab914c2022-04-13 10:55:1522#include "absl/strings/string_view.h"
23
Henrik Kjellanderec78f1c2017-06-29 05:52:5024namespace rtc {
25
Henrik Kjellanderec78f1c2017-06-29 05:52:5026// rtc namespaced wrappers for inet_ntop and inet_pton so we can avoid
27// the windows-native versions of these.
Yves Gerey665174f2018-06-19 13:03:0528const char* inet_ntop(int af, const void* src, char* dst, socklen_t size);
Ali Tofigh2ab914c2022-04-13 10:55:1529int inet_pton(int af, absl::string_view src, void* dst);
Henrik Kjellanderec78f1c2017-06-29 05:52:5030
31bool HasIPv4Enabled();
32bool HasIPv6Enabled();
Mirko Bonadeie5f4c6b2021-01-15 09:41:0133
Henrik Kjellanderec78f1c2017-06-29 05:52:5034} // namespace rtc
henrike@webrtc.orgf0488722014-05-13 18:00:2635
Steve Anton10542f22019-01-11 17:11:0036#endif // RTC_BASE_NET_HELPERS_H_