Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
e2138e80
Commit
e2138e80
authored
Aug 22, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redumdant family parameter to net_OpenDgram()
parent
92854761
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
45 deletions
+13
-45
include/vlc_network.h
include/vlc_network.h
+4
-4
modules/access/rtp/rtp.c
modules/access/rtp/rtp.c
+2
-4
modules/access/udp.c
modules/access/udp.c
+1
-16
modules/stream_out/rtcp.c
modules/stream_out/rtcp.c
+1
-1
src/network/udp.c
src/network/udp.c
+5
-20
No files found.
include/vlc_network.h
View file @
e2138e80
...
@@ -126,13 +126,13 @@ static inline int net_ConnectUDP (vlc_object_t *obj, const char *host, int port,
...
@@ -126,13 +126,13 @@ static inline int net_ConnectUDP (vlc_object_t *obj, const char *host, int port,
return
net_ConnectDgram
(
obj
,
host
,
port
,
hlim
,
IPPROTO_UDP
);
return
net_ConnectDgram
(
obj
,
host
,
port
,
hlim
,
IPPROTO_UDP
);
}
}
VLC_API
int
net_OpenDgram
(
vlc_object_t
*
p_this
,
const
char
*
psz_bind
,
int
i_bind
,
const
char
*
psz_server
,
int
i_server
,
int
family
,
int
proto
);
VLC_API
int
net_OpenDgram
(
vlc_object_t
*
p_this
,
const
char
*
psz_bind
,
int
i_bind
,
const
char
*
psz_server
,
int
i_server
,
int
proto
);
#define net_OpenDgram( a, b, c, d, e, g
, h
) \
#define net_OpenDgram( a, b, c, d, e, g ) \
net_OpenDgram(VLC_OBJECT(a), b, c, d, e, g
, h
)
net_OpenDgram(VLC_OBJECT(a), b, c, d, e, g)
static
inline
int
net_ListenUDP1
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
static
inline
int
net_ListenUDP1
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
{
{
return
net_OpenDgram
(
obj
,
host
,
port
,
NULL
,
0
,
0
,
IPPROTO_UDP
);
return
net_OpenDgram
(
obj
,
host
,
port
,
NULL
,
0
,
IPPROTO_UDP
);
}
}
VLC_API
void
net_ListenClose
(
int
*
fd
);
VLC_API
void
net_ListenClose
(
int
*
fd
);
...
...
modules/access/rtp/rtp.c
View file @
e2138e80
...
@@ -216,13 +216,11 @@ static int Open (vlc_object_t *obj)
...
@@ -216,13 +216,11 @@ static int Open (vlc_object_t *obj)
{
{
case
IPPROTO_UDP
:
case
IPPROTO_UDP
:
case
IPPROTO_UDPLITE
:
case
IPPROTO_UDPLITE
:
fd
=
net_OpenDgram
(
obj
,
dhost
,
dport
,
fd
=
net_OpenDgram
(
obj
,
dhost
,
dport
,
shost
,
sport
,
tp
);
shost
,
sport
,
AF_UNSPEC
,
tp
);
if
(
fd
==
-
1
)
if
(
fd
==
-
1
)
break
;
break
;
if
(
rtcp_dport
>
0
)
/* XXX: source port is unknown */
if
(
rtcp_dport
>
0
)
/* XXX: source port is unknown */
rtcp_fd
=
net_OpenDgram
(
obj
,
dhost
,
rtcp_dport
,
shost
,
0
,
rtcp_fd
=
net_OpenDgram
(
obj
,
dhost
,
rtcp_dport
,
shost
,
0
,
tp
);
AF_UNSPEC
,
tp
);
break
;
break
;
case
IPPROTO_DCCP
:
case
IPPROTO_DCCP
:
...
...
modules/access/udp.c
View file @
e2138e80
...
@@ -88,27 +88,12 @@ static int Open( vlc_object_t *p_this )
...
@@ -88,27 +88,12 @@ static int Open( vlc_object_t *p_this )
char
*
psz_parser
;
char
*
psz_parser
;
const
char
*
psz_server_addr
,
*
psz_bind_addr
=
""
;
const
char
*
psz_server_addr
,
*
psz_bind_addr
=
""
;
int
i_bind_port
=
1234
,
i_server_port
=
0
;
int
i_bind_port
=
1234
,
i_server_port
=
0
;
int
fam
=
AF_UNSPEC
;
int
fd
;
int
fd
;
/* Set up p_access */
/* Set up p_access */
access_InitFields
(
p_access
);
access_InitFields
(
p_access
);
ACCESS_SET_CALLBACKS
(
NULL
,
BlockUDP
,
Control
,
NULL
);
ACCESS_SET_CALLBACKS
(
NULL
,
BlockUDP
,
Control
,
NULL
);
if
(
strlen
(
p_access
->
psz_access
)
>
0
)
{
switch
(
p_access
->
psz_access
[
strlen
(
p_access
->
psz_access
)
-
1
])
{
case
'4'
:
fam
=
AF_INET
;
break
;
case
'6'
:
fam
=
AF_INET6
;
break
;
}
}
/* Parse psz_name syntax :
/* Parse psz_name syntax :
* [serveraddr[:serverport]][@[bindaddr]:[bindport]] */
* [serveraddr[:serverport]][@[bindaddr]:[bindport]] */
psz_parser
=
strchr
(
psz_name
,
'@'
);
psz_parser
=
strchr
(
psz_name
,
'@'
);
...
@@ -152,7 +137,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -152,7 +137,7 @@ static int Open( vlc_object_t *p_this )
psz_server_addr
,
i_server_port
,
psz_bind_addr
,
i_bind_port
);
psz_server_addr
,
i_server_port
,
psz_bind_addr
,
i_bind_port
);
fd
=
net_OpenDgram
(
p_access
,
psz_bind_addr
,
i_bind_port
,
fd
=
net_OpenDgram
(
p_access
,
psz_bind_addr
,
i_bind_port
,
psz_server_addr
,
i_server_port
,
fam
,
IPPROTO_UDP
);
psz_server_addr
,
i_server_port
,
IPPROTO_UDP
);
free
(
psz_name
);
free
(
psz_name
);
if
(
fd
==
-
1
)
if
(
fd
==
-
1
)
{
{
...
...
modules/stream_out/rtcp.c
View file @
e2138e80
...
@@ -106,7 +106,7 @@ rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd, int proto,
...
@@ -106,7 +106,7 @@ rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd, int proto,
sport
++
;
sport
++
;
dport
++
;
dport
++
;
fd
=
net_OpenDgram
(
obj
,
src
,
sport
,
dst
,
dport
,
AF_UNSPEC
,
proto
);
fd
=
net_OpenDgram
(
obj
,
src
,
sport
,
dst
,
dport
,
proto
);
if
(
fd
!=
-
1
)
if
(
fd
!=
-
1
)
{
{
/* Copy the multicast IPv4 TTL value (useless for IPv6) */
/* Copy the multicast IPv4 TTL value (useless for IPv6) */
...
...
src/network/udp.c
View file @
e2138e80
...
@@ -134,12 +134,11 @@ static int net_SetupDgramSocket( vlc_object_t *p_obj, int fd, const struct addri
...
@@ -134,12 +134,11 @@ static int net_SetupDgramSocket( vlc_object_t *p_obj, int fd, const struct addri
/* */
/* */
static
int
net_ListenSingle
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
,
static
int
net_ListenSingle
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
,
int
family
,
int
protocol
)
int
protocol
)
{
{
struct
addrinfo
hints
,
*
res
;
struct
addrinfo
hints
,
*
res
;
memset
(
&
hints
,
0
,
sizeof
(
hints
));
memset
(
&
hints
,
0
,
sizeof
(
hints
));
hints
.
ai_family
=
family
;
hints
.
ai_socktype
=
SOCK_DGRAM
;
hints
.
ai_socktype
=
SOCK_DGRAM
;
hints
.
ai_protocol
=
protocol
;
hints
.
ai_protocol
=
protocol
;
hints
.
ai_flags
=
AI_PASSIVE
;
hints
.
ai_flags
=
AI_PASSIVE
;
...
@@ -171,22 +170,10 @@ static int net_ListenSingle (vlc_object_t *obj, const char *host, int port,
...
@@ -171,22 +170,10 @@ static int net_ListenSingle (vlc_object_t *obj, const char *host, int port,
}
}
#ifdef IPV6_V6ONLY
#ifdef IPV6_V6ONLY
/* If IPv6 was forced, set IPv6-only mode.
/* Try dual-mode IPv6 if available. */
* If IPv4 was forced, do nothing extraordinary.
* If nothing was forced, try dual-mode IPv6. */
if
(
ptr
->
ai_family
==
AF_INET6
)
if
(
ptr
->
ai_family
==
AF_INET6
)
{
setsockopt
(
fd
,
SOL_IPV6
,
IPV6_V6ONLY
,
&
(
int
){
0
},
sizeof
(
int
));
int
on
=
(
family
==
AF_INET6
);
setsockopt
(
fd
,
SOL_IPV6
,
IPV6_V6ONLY
,
&
on
,
sizeof
(
on
));
}
if
(
ptr
->
ai_family
==
AF_INET
)
#endif
#endif
if
(
family
==
AF_UNSPEC
&&
ptr
->
ai_next
!=
NULL
)
{
msg_Warn
(
obj
,
"ambiguous network protocol specification"
);
msg_Warn
(
obj
,
"please select IP version explicitly"
);
}
fd
=
net_SetupDgramSocket
(
obj
,
fd
,
ptr
);
fd
=
net_SetupDgramSocket
(
obj
,
fd
,
ptr
);
if
(
fd
==
-
1
)
if
(
fd
==
-
1
)
continue
;
continue
;
...
@@ -728,11 +715,10 @@ int net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port,
...
@@ -728,11 +715,10 @@ int net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port,
* OpenDgram a datagram socket and return a handle
* OpenDgram a datagram socket and return a handle
*****************************************************************************/
*****************************************************************************/
int
net_OpenDgram
(
vlc_object_t
*
obj
,
const
char
*
psz_bind
,
int
i_bind
,
int
net_OpenDgram
(
vlc_object_t
*
obj
,
const
char
*
psz_bind
,
int
i_bind
,
const
char
*
psz_server
,
int
i_server
,
const
char
*
psz_server
,
int
i_server
,
int
protocol
)
int
family
,
int
protocol
)
{
{
if
((
psz_server
==
NULL
)
||
(
psz_server
[
0
]
==
'\0'
))
if
((
psz_server
==
NULL
)
||
(
psz_server
[
0
]
==
'\0'
))
return
net_ListenSingle
(
obj
,
psz_bind
,
i_bind
,
family
,
protocol
);
return
net_ListenSingle
(
obj
,
psz_bind
,
i_bind
,
protocol
);
msg_Dbg
(
obj
,
"net: connecting to [%s]:%d from [%s]:%d"
,
msg_Dbg
(
obj
,
"net: connecting to [%s]:%d from [%s]:%d"
,
psz_server
,
i_server
,
psz_bind
,
i_bind
);
psz_server
,
i_server
,
psz_bind
,
i_bind
);
...
@@ -741,7 +727,6 @@ int net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind,
...
@@ -741,7 +727,6 @@ int net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind,
int
val
;
int
val
;
memset
(
&
hints
,
0
,
sizeof
(
hints
));
memset
(
&
hints
,
0
,
sizeof
(
hints
));
hints
.
ai_family
=
family
;
hints
.
ai_socktype
=
SOCK_DGRAM
;
hints
.
ai_socktype
=
SOCK_DGRAM
;
hints
.
ai_protocol
=
protocol
;
hints
.
ai_protocol
=
protocol
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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