Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
6db8875a
Commit
6db8875a
authored
Jul 01, 2005
by
Rémi Denis-Courmont
Browse files
PF_* -> AF_*
parent
5f248960
Changes
5
Hide whitespace changes
Inline
Side-by-side
modules/control/rc.c
View file @
6db8875a
...
...
@@ -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
P
F_LOCAL
#ifdef
A
F_LOCAL
# include <sys/un.h>
#endif
...
...
@@ -189,7 +186,7 @@ static int Activate( vlc_object_t *p_this )
{
int
i_socket
;
#ifndef
P
F_LOCAL
#ifndef
A
F_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
(
P
F_LOCAL
,
SOCK_STREAM
,
0
)
)
<
0
)
if
(
(
i_socket
=
socket
(
A
F_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
P
F_LOCAL
#ifdef
A
F_LOCAL
unlink
(
p_intf
->
p_sys
->
psz_unix_path
);
#endif
free
(
p_intf
->
p_sys
->
psz_unix_path
);
...
...
modules/misc/network/ipv4.c
View file @
6db8875a
...
...
@@ -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
/*****************************************************************************
...
...
modules/misc/network/ipv6.c
View file @
6db8875a
...
...
@@ -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
=
P
F_INET6
;
hints
.
ai_family
=
A
F_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
==
P
F_INET6
)
if
(
ptr
->
ai_family
==
A
F_INET6
)
{
i_val
=
PROTECTION_LEVEL_UNRESTRICTED
;
setsockopt
(
fd
,
IPPROTO_IPV6
,
IPV6_PROTECTION_LEVEL
,
&
i_val
,
...
...
src/misc/getaddrinfo.c
View file @
6db8875a
...
...
@@ -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
(
P
F_INET
,
type
,
proto
,
return
makeaddrinfo
(
A
F_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
==
P
F_UNSPEC
)
if
(
hints
.
ai_family
==
A
F_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
=
P
F_INET
;
hints
.
ai_family
=
A
F_INET
;
#ifdef
P
F_INET6
#ifdef
A
F_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
=
P
F_INET6
;
hints
.
ai_family
=
A
F_INET6
;
#endif
}
...
...
src/misc/net.c
View file @
6db8875a
...
...
@@ -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
==
P
F_INET6
)
if
(
ptr
->
ai_family
==
A
F_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
==
P
F_INET6
)
if
(
ptr
->
ai_family
==
A
F_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
=
P
F_INET
;
hints
.
ai_family
=
A
F_INET
;
if
(
vlc_getaddrinfo
(
p_obj
,
psz_host
,
0
,
&
hints
,
&
p_res
)
)
return
VLC_EGENERIC
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment