Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
9242bbe1
Commit
9242bbe1
authored
Feb 07, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: remove leading underscores
parent
998ebb85
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
51 deletions
+52
-51
include/vlc_network.h
include/vlc_network.h
+19
-21
src/libvlccore.sym
src/libvlccore.sym
+7
-7
src/network/io.c
src/network/io.c
+13
-11
src/network/tcp.c
src/network/tcp.c
+4
-3
src/network/udp.c
src/network/udp.c
+9
-9
No files found.
include/vlc_network.h
View file @
9242bbe1
...
@@ -85,19 +85,18 @@ extern "C" {
...
@@ -85,19 +85,18 @@ extern "C" {
int
net_Socket
(
vlc_object_t
*
obj
,
int
family
,
int
socktype
,
int
proto
);
int
net_Socket
(
vlc_object_t
*
obj
,
int
family
,
int
socktype
,
int
proto
);
int
net_SetupSocket
(
int
fd
);
int
net_SetupSocket
(
int
fd
);
#define net_Connect(a, b, c, d, e) __net_Connect(VLC_OBJECT(a), b, c, d, e)
VLC_EXPORT
(
int
,
net_Connect
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
socktype
,
int
protocol
)
);
VLC_EXPORT
(
int
,
__net_Connect
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
socktype
,
int
protocol
)
);
#define net_Connect(a, b, c, d, e) net_Connect(VLC_OBJECT(a), b, c, d, e)
VLC_EXPORT
(
int
*
,
net_Listen
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
protocol
)
);
VLC_EXPORT
(
int
*
,
net_Listen
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
protocol
)
);
#define net_ListenTCP(a, b, c) net_Listen(VLC_OBJECT(a), b, c, IPPROTO_TCP)
#define net_ListenTCP(a, b, c) net_Listen(VLC_OBJECT(a), b, c, IPPROTO_TCP)
#define net_ConnectTCP(a, b, c) __net_ConnectTCP(VLC_OBJECT(a), b, c)
static
inline
int
__
net_ConnectTCP
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
static
inline
int
net_ConnectTCP
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
{
{
return
__
net_Connect
(
obj
,
host
,
port
,
SOCK_STREAM
,
IPPROTO_TCP
);
return
net_Connect
(
obj
,
host
,
port
,
SOCK_STREAM
,
IPPROTO_TCP
);
}
}
#define net_ConnectTCP(a, b, c) net_ConnectTCP(VLC_OBJECT(a), b, c)
VLC_EXPORT
(
int
,
net_AcceptSingle
,
(
vlc_object_t
*
obj
,
int
lfd
)
);
VLC_EXPORT
(
int
,
net_AcceptSingle
,
(
vlc_object_t
*
obj
,
int
lfd
)
);
...
@@ -105,16 +104,18 @@ VLC_EXPORT( int, net_Accept, ( vlc_object_t *, int * ) );
...
@@ -105,16 +104,18 @@ VLC_EXPORT( int, net_Accept, ( vlc_object_t *, int * ) );
#define net_Accept(a, b) \
#define net_Accept(a, b) \
net_Accept(VLC_OBJECT(a), b)
net_Accept(VLC_OBJECT(a), b)
#define net_ConnectDgram(a, b, c, d, e ) __net_ConnectDgram(VLC_OBJECT(a), b, c, d, e)
VLC_EXPORT
(
int
,
net_ConnectDgram
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
hlim
,
int
proto
)
);
VLC_EXPORT
(
int
,
__net_ConnectDgram
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
hlim
,
int
proto
)
);
#define net_ConnectDgram(a, b, c, d, e ) \
net_ConnectDgram(VLC_OBJECT(a), b, c, d, e)
static
inline
int
net_ConnectUDP
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
,
int
hlim
)
static
inline
int
net_ConnectUDP
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
,
int
hlim
)
{
{
return
net_ConnectDgram
(
obj
,
host
,
port
,
hlim
,
IPPROTO_UDP
);
return
net_ConnectDgram
(
obj
,
host
,
port
,
hlim
,
IPPROTO_UDP
);
}
}
#define net_OpenDgram( a, b, c, d, e, g, h ) __net_OpenDgram(VLC_OBJECT(a), b, c, d, e, g, h)
VLC_EXPORT
(
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_EXPORT
(
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
)
);
#define net_OpenDgram( a, b, c, d, e, g, h ) \
net_OpenDgram(VLC_OBJECT(a), b, c, d, e, g, h)
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
)
{
{
...
@@ -136,20 +137,17 @@ struct virtual_socket_t
...
@@ -136,20 +137,17 @@ struct virtual_socket_t
int
(
*
pf_send
)
(
void
*
,
const
void
*
,
int
);
int
(
*
pf_send
)
(
void
*
,
const
void
*
,
int
);
};
};
#define net_Read(a,b,c,d,e,f) __net_Read(VLC_OBJECT(a),b,c,d,e,f)
VLC_EXPORT
(
ssize_t
,
net_Read
,
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
,
void
*
p_data
,
size_t
i_data
,
bool
b_retry
)
);
VLC_EXPORT
(
ssize_t
,
__net_Read
,
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
,
void
*
p_data
,
size_t
i_data
,
bool
b_retry
)
);
#define net_Read(a,b,c,d,e,f) net_Read(VLC_OBJECT(a),b,c,d,e,f)
VLC_EXPORT
(
ssize_t
,
net_Write
,
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
,
const
void
*
p_data
,
size_t
i_data
)
);
#define net_Write(a,b,c,d,e) __net_Write(VLC_OBJECT(a),b,c,d,e)
#define net_Write(a,b,c,d,e) net_Write(VLC_OBJECT(a),b,c,d,e)
VLC_EXPORT
(
ssize_t
,
__net_Write
,
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
,
const
void
*
p_data
,
size_t
i_data
)
);
VLC_EXPORT
(
char
*
,
net_Gets
,
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
)
);
#define net_Gets(a,b,c) net_Gets(VLC_OBJECT(a),b,c)
#define net_Gets(a,b,c) __net_Gets(VLC_OBJECT(a),b,c)
VLC_EXPORT
(
char
*
,
__net_Gets
,
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
)
);
VLC_EXPORT
(
ssize_t
,
net_Printf
,
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
,
const
char
*
psz_fmt
,
...
)
LIBVLC_FORMAT
(
4
,
5
)
);
VLC_EXPORT
(
ssize_t
,
net_Printf
,
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
,
const
char
*
psz_fmt
,
...
)
LIBVLC_FORMAT
(
4
,
5
)
);
VLC_EXPORT
(
ssize_t
,
net_vaPrintf
,
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
,
const
char
*
psz_fmt
,
va_list
args
)
);
#define net_vaPrintf(a,b,c,d,e) __net_vaPrintf(VLC_OBJECT(a),b,c,d,e)
#define net_vaPrintf(a,b,c,d,e) net_vaPrintf(VLC_OBJECT(a),b,c,d,e)
VLC_EXPORT
(
ssize_t
,
__net_vaPrintf
,
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
,
const
char
*
psz_fmt
,
va_list
args
)
);
VLC_EXPORT
(
int
,
vlc_inet_pton
,
(
int
af
,
const
char
*
src
,
void
*
dst
)
);
VLC_EXPORT
(
int
,
vlc_inet_pton
,
(
int
af
,
const
char
*
src
,
void
*
dst
)
);
VLC_EXPORT
(
const
char
*
,
vlc_inet_ntop
,
(
int
af
,
const
void
*
src
,
VLC_EXPORT
(
const
char
*
,
vlc_inet_ntop
,
(
int
af
,
const
void
*
src
,
...
...
src/libvlccore.sym
View file @
9242bbe1
...
@@ -263,17 +263,17 @@ mstrtime
...
@@ -263,17 +263,17 @@ mstrtime
mwait
mwait
net_Accept
net_Accept
net_AcceptSingle
net_AcceptSingle
__
net_Connect
net_Connect
__
net_ConnectDgram
net_ConnectDgram
__
net_Gets
net_Gets
net_Listen
net_Listen
net_ListenClose
net_ListenClose
__
net_OpenDgram
net_OpenDgram
net_Printf
net_Printf
__
net_Read
net_Read
net_SetCSCov
net_SetCSCov
__
net_vaPrintf
net_vaPrintf
__
net_Write
net_Write
NTPtime64
NTPtime64
__osd_ButtonFind
__osd_ButtonFind
__osd_ButtonSelect
__osd_ButtonSelect
...
...
src/network/io.c
View file @
9242bbe1
...
@@ -271,9 +271,9 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
...
@@ -271,9 +271,9 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
return
sockv
;
return
sockv
;
}
}
#undef net_Read
/*****************************************************************************
/*****************************************************************************
*
__
net_Read:
* net_Read:
*****************************************************************************
*****************************************************************************
* Reads from a network socket. Cancellation point.
* Reads from a network socket. Cancellation point.
* If waitall is true, then we repeat until we have read the right amount of
* If waitall is true, then we repeat until we have read the right amount of
...
@@ -281,7 +281,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
...
@@ -281,7 +281,7 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
* object has been signaled.
* object has been signaled.
*****************************************************************************/
*****************************************************************************/
ssize_t
ssize_t
__
net_Read
(
vlc_object_t
*
restrict
p_this
,
int
fd
,
const
v_socket_t
*
vs
,
net_Read
(
vlc_object_t
*
restrict
p_this
,
int
fd
,
const
v_socket_t
*
vs
,
void
*
restrict
p_buf
,
size_t
i_buflen
,
bool
waitall
)
void
*
restrict
p_buf
,
size_t
i_buflen
,
bool
waitall
)
{
{
size_t
i_total
=
0
;
size_t
i_total
=
0
;
...
@@ -408,9 +408,9 @@ silent:
...
@@ -408,9 +408,9 @@ silent:
return
-
1
;
return
-
1
;
}
}
#undef net_Write
/* Write exact amount requested */
/* Write exact amount requested */
ssize_t
__
net_Write
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
p_vs
,
ssize_t
net_Write
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
p_vs
,
const
void
*
restrict
p_data
,
size_t
i_data
)
const
void
*
restrict
p_data
,
size_t
i_data
)
{
{
size_t
i_total
=
0
;
size_t
i_total
=
0
;
...
@@ -484,6 +484,7 @@ error:
...
@@ -484,6 +484,7 @@ error:
return
-
1
;
return
-
1
;
}
}
#undef net_Gets
/**
/**
* Reads a line from a file descriptor.
* Reads a line from a file descriptor.
* This function is not thread-safe; the same file descriptor cI/O annot be read
* This function is not thread-safe; the same file descriptor cI/O annot be read
...
@@ -491,7 +492,7 @@ error:
...
@@ -491,7 +492,7 @@ error:
*
*
* @return nul-terminated heap-allocated string, or NULL on I/O error.
* @return nul-terminated heap-allocated string, or NULL on I/O error.
*/
*/
char
*
__
net_Gets
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
p_vs
)
char
*
net_Gets
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
p_vs
)
{
{
char
*
psz_line
=
NULL
,
*
ptr
=
NULL
;
char
*
psz_line
=
NULL
,
*
ptr
=
NULL
;
size_t
i_line
=
0
,
i_max
=
0
;
size_t
i_line
=
0
,
i_max
=
0
;
...
@@ -543,7 +544,8 @@ ssize_t net_Printf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
...
@@ -543,7 +544,8 @@ ssize_t net_Printf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
return
i_ret
;
return
i_ret
;
}
}
ssize_t
__net_vaPrintf
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
p_vs
,
#undef net_vaPrintf
ssize_t
net_vaPrintf
(
vlc_object_t
*
p_this
,
int
fd
,
const
v_socket_t
*
p_vs
,
const
char
*
psz_fmt
,
va_list
args
)
const
char
*
psz_fmt
,
va_list
args
)
{
{
char
*
psz
;
char
*
psz
;
...
@@ -552,7 +554,7 @@ ssize_t __net_vaPrintf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
...
@@ -552,7 +554,7 @@ ssize_t __net_vaPrintf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
int
i_size
=
vasprintf
(
&
psz
,
psz_fmt
,
args
);
int
i_size
=
vasprintf
(
&
psz
,
psz_fmt
,
args
);
if
(
i_size
==
-
1
)
if
(
i_size
==
-
1
)
return
-
1
;
return
-
1
;
i_ret
=
__
net_Write
(
p_this
,
fd
,
p_vs
,
psz
,
i_size
)
<
i_size
i_ret
=
net_Write
(
p_this
,
fd
,
p_vs
,
psz
,
i_size
)
<
i_size
?
-
1
:
i_size
;
?
-
1
:
i_size
;
free
(
psz
);
free
(
psz
);
...
...
src/network/tcp.c
View file @
9242bbe1
...
@@ -65,13 +65,14 @@ static int SocksHandshakeTCP( vlc_object_t *,
...
@@ -65,13 +65,14 @@ static int SocksHandshakeTCP( vlc_object_t *,
extern
int
net_Socket
(
vlc_object_t
*
p_this
,
int
i_family
,
int
i_socktype
,
extern
int
net_Socket
(
vlc_object_t
*
p_this
,
int
i_family
,
int
i_socktype
,
int
i_protocol
);
int
i_protocol
);
#undef net_Connect
/*****************************************************************************
/*****************************************************************************
*
__
net_Connect:
* net_Connect:
*****************************************************************************
*****************************************************************************
* Open a network connection.
* Open a network connection.
* @return socket handler or -1 on error.
* @return socket handler or -1 on error.
*****************************************************************************/
*****************************************************************************/
int
__
net_Connect
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
net_Connect
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
type
,
int
proto
)
int
type
,
int
proto
)
{
{
struct
addrinfo
hints
,
*
res
,
*
ptr
;
struct
addrinfo
hints
,
*
res
,
*
ptr
;
...
...
src/network/udp.c
View file @
9242bbe1
...
@@ -642,14 +642,14 @@ static int net_SetDSCP( int fd, uint8_t dscp )
...
@@ -642,14 +642,14 @@ static int net_SetDSCP( int fd, uint8_t dscp )
return
setsockopt
(
fd
,
level
,
cmd
,
&
(
int
){
dscp
},
sizeof
(
int
));
return
setsockopt
(
fd
,
level
,
cmd
,
&
(
int
){
dscp
},
sizeof
(
int
));
}
}
#undef net_ConnectDgram
/*****************************************************************************
/*****************************************************************************
*
__
net_ConnectDgram:
* net_ConnectDgram:
*****************************************************************************
*****************************************************************************
* Open a datagram socket to send data to a defined destination, with an
* Open a datagram socket to send data to a defined destination, with an
* optional hop limit.
* optional hop limit.
*****************************************************************************/
*****************************************************************************/
int
__
net_ConnectDgram
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
net_ConnectDgram
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
i_hlim
,
int
proto
)
int
i_hlim
,
int
proto
)
{
{
struct
addrinfo
hints
,
*
res
,
*
ptr
;
struct
addrinfo
hints
,
*
res
,
*
ptr
;
...
@@ -744,13 +744,13 @@ int __net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port,
...
@@ -744,13 +744,13 @@ int __net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port,
return
i_handle
;
return
i_handle
;
}
}
#undef net_OpenDgram
/*****************************************************************************
/*****************************************************************************
*
__
net_OpenDgram:
* net_OpenDgram:
*****************************************************************************
*****************************************************************************
* 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
family
,
int
protocol
)
int
family
,
int
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