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

PF_* -> AF_*

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