Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
c98c4ee9
Commit
c98c4ee9
authored
Jul 29, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline net_GetAddress
parent
61696fdb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
36 deletions
+33
-36
include/network.h
include/network.h
+33
-3
include/vlc_symbols.h
include/vlc_symbols.h
+0
-3
src/misc/net.c
src/misc/net.c
+0
-30
No files found.
include/network.h
View file @
c98c4ee9
...
...
@@ -356,9 +356,6 @@ VLC_EXPORT( int, net_Printf, ( vlc_object_t *p_this, int fd, v_socket_t *, const
#define net_vaPrintf(a,b,c,d,e) __net_vaPrintf(VLC_OBJECT(a),b,c,d,e)
VLC_EXPORT
(
int
,
__net_vaPrintf
,
(
vlc_object_t
*
p_this
,
int
fd
,
v_socket_t
*
,
const
char
*
psz_fmt
,
va_list
args
)
);
#define net_GetSockAddress(a,b,c,d) __net_GetAddress(VLC_OBJECT(a),VLC_FALSE,b,c,d)
#define net_GetPeerAddress(a,b,c,d) __net_GetAddress(VLC_OBJECT(a),VLC_TRUE,b,c,d)
VLC_EXPORT
(
int
,
__net_GetAddress
,
(
vlc_object_t
*
p_this
,
vlc_bool_t
peer
,
int
fd
,
char
*
address
,
int
*
port
)
);
#if !HAVE_INET_PTON
/* only in core, so no need for C++ extern "C" */
...
...
@@ -508,4 +505,37 @@ static inline vlc_bool_t net_AddressIsMulticast( vlc_object_t *p_object, char *p
return
b_multicast
;
}
#define net_GetSockAddress(a,b,c,d) __net_GetAddress(VLC_OBJECT(a),VLC_FALSE,b,c,d)
#define net_GetPeerAddress(a,b,c,d) __net_GetAddress(VLC_OBJECT(a),VLC_TRUE,b,c,d)
static
inline
int
__net_GetAddress
(
vlc_object_t
*
p_this
,
vlc_bool_t
peer
,
int
fd
,
char
*
address
,
int
*
port
)
{
struct
sockaddr_storage
addr
;
socklen_t
addrlen
=
sizeof
(
addr
);
int
val
;
val
=
peer
?
getpeername
(
fd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
)
:
getsockname
(
fd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
if
(
val
)
{
#if defined(WIN32) || defined (UNDER_CE)
msg_Err
(
p_this
,
"socket address error : %d"
,
WSAGetLastError
(
)
);
#else
msg_Err
(
p_this
,
"socket address error : %s"
,
strerror
(
errno
)
);
#endif
return
val
;
}
val
=
vlc_getnameinfo
(
(
struct
sockaddr
*
)
&
addr
,
addrlen
,
address
,
NI_MAXNUMERICHOST
,
port
,
NI_NUMERICHOST
);
if
(
val
)
{
msg_Err
(
p_this
,
"socket address error : %s"
,
vlc_gai_strerror
(
val
)
);
}
return
0
;
}
#endif
include/vlc_symbols.h
View file @
c98c4ee9
...
...
@@ -382,7 +382,6 @@ struct module_symbols_t
int
(
*
ACL_LoadFile_inner
)
(
vlc_acl_t
*
p_acl
,
const
char
*
path
);
int
(
*
ACL_AddNet_inner
)
(
vlc_acl_t
*
p_acl
,
const
char
*
psz_ip
,
int
i_len
,
vlc_bool_t
b_allow
);
void
(
*
ACL_Destroy_inner
)
(
vlc_acl_t
*
p_acl
);
int
(
*
__net_GetAddress_inner
)
(
vlc_object_t
*
p_this
,
vlc_bool_t
peer
,
int
fd
,
char
*
address
,
int
*
port
);
};
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
...
...
@@ -750,7 +749,6 @@ struct module_symbols_t
# define ACL_LoadFile (p_symbols)->ACL_LoadFile_inner
# define ACL_AddNet (p_symbols)->ACL_AddNet_inner
# define ACL_Destroy (p_symbols)->ACL_Destroy_inner
# define __net_GetAddress (p_symbols)->__net_GetAddress_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
...
...
@@ -1121,7 +1119,6 @@ struct module_symbols_t
((p_symbols)->ACL_LoadFile_inner) = ACL_LoadFile; \
((p_symbols)->ACL_AddNet_inner) = ACL_AddNet; \
((p_symbols)->ACL_Destroy_inner) = ACL_Destroy; \
((p_symbols)->__net_GetAddress_inner) = __net_GetAddress; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
# endif
/* __PLUGIN__ */
...
...
src/misc/net.c
View file @
c98c4ee9
...
...
@@ -1156,36 +1156,6 @@ static int SocksHandshakeTCP( vlc_object_t *p_obj,
return
VLC_SUCCESS
;
}
int
__net_GetAddress
(
vlc_object_t
*
p_this
,
vlc_bool_t
peer
,
int
fd
,
char
*
address
,
int
*
port
)
{
struct
sockaddr_storage
addr
;
socklen_t
addrlen
=
sizeof
(
addr
);
int
val
;
val
=
peer
?
getpeername
(
fd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
)
:
getsockname
(
fd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
if
(
val
)
{
#if defined(WIN32) || defined (UNDER_CE)
msg_Err
(
p_this
,
"socket address error : %d"
,
WSAGetLastError
(
)
);
#else
msg_Err
(
p_this
,
"socket address error : %s"
,
strerror
(
errno
)
);
#endif
return
val
;
}
val
=
vlc_getnameinfo
(
(
struct
sockaddr
*
)
&
addr
,
addrlen
,
address
,
NI_MAXNUMERICHOST
,
port
,
NI_NUMERICHOST
);
if
(
val
)
{
msg_Err
(
p_this
,
"socket address error : %s"
,
vlc_gai_strerror
(
val
)
);
}
return
0
;
}
/*****************************************************************************
* inet_pton replacement for obsolete and/or crap operating systems
*****************************************************************************/
...
...
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