Commit 6db8875a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

PF_* -> AF_*

parent 5f248960
......@@ -49,14 +49,11 @@
#include "vlc_error.h"
#include "network.h"
#if defined(PF_UNIX) && !defined(PF_LOCAL)
# define PF_LOCAL PF_UNIX
#endif
#if defined(AF_UNIX) && !defined(AF_LOCAL)
# define AF_LOCAL AF_UNIX
#endif
#ifdef PF_LOCAL
#ifdef AF_LOCAL
# include <sys/un.h>
#endif
......@@ -189,7 +186,7 @@ static int Activate( vlc_object_t *p_this )
{
int i_socket;
#ifndef PF_LOCAL
#ifndef AF_LOCAL
msg_Warn( p_intf, "your OS doesn't support filesystem sockets" );
free( psz_unix_path );
return VLC_EGENERIC;
......@@ -201,7 +198,7 @@ static int Activate( vlc_object_t *p_this )
msg_Dbg( p_intf, "trying UNIX socket" );
if( (i_socket = socket( PF_LOCAL, SOCK_STREAM, 0 ) ) < 0 )
if( (i_socket = socket( AF_LOCAL, SOCK_STREAM, 0 ) ) < 0 )
{
msg_Warn( p_intf, "can't open socket: %s", strerror(errno) );
free( psz_unix_path );
......@@ -316,7 +313,7 @@ static void Deactivate( vlc_object_t *p_this )
net_Close( p_intf->p_sys->i_socket );
if( p_intf->p_sys->psz_unix_path != NULL )
{
#ifdef PF_LOCAL
#ifdef AF_LOCAL
unlink( p_intf->p_sys->psz_unix_path );
#endif
free( p_intf->p_sys->psz_unix_path );
......
......@@ -79,9 +79,6 @@
#ifndef IN_MULTICAST
# define IN_MULTICAST(a) IN_CLASSD(a)
#endif
#ifndef PF_INET
# define PF_INET AF_INET /* BeOS */
#endif
/*****************************************************************************
......
......@@ -94,7 +94,7 @@ static int BuildAddr( vlc_object_t *p_this, struct sockaddr_in6 *p_socket,
int i;
memset( &hints, 0, sizeof( hints ) );
hints.ai_family = PF_INET6;
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_PASSIVE;
......@@ -151,7 +151,7 @@ static int OpenUDP( vlc_object_t * p_this )
#ifdef WIN32
# ifdef IPV6_PROTECTION_LEVEL
if( ptr->ai_family == PF_INET6 )
if( ptr->ai_family == AF_INET6 )
{
i_val = PROTECTION_LEVEL_UNRESTRICTED;
setsockopt( fd, IPPROTO_IPV6, IPV6_PROTECTION_LEVEL, &i_val,
......
......@@ -59,10 +59,8 @@
#ifdef SYS_BEOS
# define NO_ADDRESS NO_DATA
# define PF_INET AF_INET
# define INADDR_NONE 0xFFFFFFFF
# define AF_UNSPEC 0
# define PF_UNSPEC AF_UNSPEC
#endif
#define _NI_MASK (NI_NUMERICHOST|NI_NUMERICSERV|NI_NOFQDN|NI_NAMEREQD|\
......@@ -330,7 +328,7 @@ makeipv4info (int type, int proto, u_long ip, u_short port, const char *name)
addr.sin_port = port;
addr.sin_addr.s_addr = ip;
return makeaddrinfo (PF_INET, type, proto,
return makeaddrinfo (AF_INET, type, proto,
(struct sockaddr*)&addr, sizeof (addr), name);
}
......@@ -596,20 +594,20 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
else
memcpy( &hints, p_hints, sizeof( hints ) );
if( hints.ai_family == PF_UNSPEC )
if( hints.ai_family == AF_UNSPEC )
{
vlc_value_t val;
var_Create( p_this, "ipv4", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Get( p_this, "ipv4", &val );
if( val.b_bool )
hints.ai_family = PF_INET;
hints.ai_family = AF_INET;
#ifdef PF_INET6
#ifdef AF_INET6
var_Create( p_this, "ipv6", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Get( p_this, "ipv6", &val );
if( val.b_bool )
hints.ai_family = PF_INET6;
hints.ai_family = AF_INET6;
#endif
}
......
......@@ -65,9 +65,6 @@
#ifndef INADDR_NONE
# define INADDR_NONE 0xFFFFFFFF
#endif
#ifndef PF_INET
# define PF_INET AF_INET
#endif
static int SocksNegociate( vlc_object_t *, int fd, int i_socks_version,
char *psz_socks_user, char *psz_socks_passwd );
......@@ -363,14 +360,14 @@ int *__net_ListenTCP( vlc_object_t *p_this, const char *psz_host, int i_port )
* it makes sure that IPv4 addresses will be printed as w.x.y.z rather
* than ::ffff:w.x.y.z
*/
if( ptr->ai_family == PF_INET6 )
if( ptr->ai_family == AF_INET6 )
setsockopt( fd, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&i_val,
sizeof( i_val ) );
#endif
#if defined( WIN32 ) || defined( UNDER_CE )
# ifdef IPV6_PROTECTION_LEVEL
if( ptr->ai_family == PF_INET6 )
if( ptr->ai_family == AF_INET6 )
{
i_val = PROTECTION_LEVEL_UNRESTRICTED;
setsockopt( fd, IPPROTO_IPV6, IPV6_PROTECTION_LEVEL, &i_val,
......@@ -1103,7 +1100,7 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
struct addrinfo hints = { 0 }, *p_res;
/* v4 only support ipv4 */
hints.ai_family = PF_INET;
hints.ai_family = AF_INET;
if( vlc_getaddrinfo( p_obj, psz_host, 0, &hints, &p_res ) )
return VLC_EGENERIC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment