blob: 4ed84786b311ceb5b0d29b8b5627727e68d89b10 [file] [log] [blame]
henrike@webrtc.orgf0488722014-05-13 18:00:26 +00001/*
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 09:11:00 -080011#ifndef RTC_BASE_NET_HELPERS_H_
12#define RTC_BASE_NET_HELPERS_H_
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000013
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020014#if defined(WEBRTC_POSIX)
Yves Gerey988cc082018-10-23 12:03:01 +020015#include <sys/socket.h>
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020016#elif WEBRTC_WIN
17#include <winsock2.h> // NOLINT
Mirko Bonadei69241a92021-01-09 10:34:28 +010018
19#include "rtc_base/win32.h"
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020020#endif
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000021
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020022namespace rtc {
23
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020024// rtc namespaced wrappers for inet_ntop and inet_pton so we can avoid
25// the windows-native versions of these.
Yves Gerey665174f2018-06-19 15:03:05 +020026const char* inet_ntop(int af, const void* src, char* dst, socklen_t size);
27int inet_pton(int af, const char* src, void* dst);
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020028
29bool HasIPv4Enabled();
30bool HasIPv6Enabled();
Mirko Bonadei69241a92021-01-09 10:34:28 +010031
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020032} // namespace rtc
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000033
Steve Anton10542f22019-01-11 09:11:00 -080034#endif // RTC_BASE_NET_HELPERS_H_