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
061b69e7
Commit
061b69e7
authored
Feb 15, 2007
by
Christophe Mutricy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32 replacement for inet_ntop()
parent
9979fb83
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
1 deletion
+66
-1
configure.ac
configure.ac
+5
-0
include/vlc_network.h
include/vlc_network.h
+8
-0
src/network/io.c
src/network/io.c
+53
-1
No files found.
configure.ac
View file @
061b69e7
...
...
@@ -2407,6 +2407,11 @@ AC_CHECK_FUNCS(inet_pton,[have_ipv6=yes],[
AS_IF([test "${have_ipv6}" = "yes"], [
AC_DEFINE(HAVE_INET_PTON, 1, [Define to 1 if you have inet_pton().])])
AC_CHECK_FUNCS(inet_ntop,[
AC_DEFINE(HAVE_INET_NTOP, 1, [Define to 1 if you have inet_ntop().])])
dnl
dnl ogg demux plugin
dnl
...
...
include/vlc_network.h
View file @
061b69e7
...
...
@@ -150,6 +150,14 @@ VLC_EXPORT( int, __net_vaPrintf, ( vlc_object_t *p_this, int fd, const v_socket_
VLC_EXPORT
(
int
,
inet_pton
,
(
int
af
,
const
char
*
src
,
void
*
dst
)
);
#endif
#ifndef HAVE_INET_NTOP
#ifdef WIN32
/* only in core, so no need for C++ extern "C" */
VLC_EXPORT
(
const
char
*
,
inet_ntop
,
(
int
af
,
const
void
*
src
,
char
*
dst
,
socklen_t
cnt
)
);
#endif
#endif
#ifndef HAVE_POLL
enum
{
...
...
src/network/io.c
View file @
061b69e7
/*****************************************************************************
* io.c: network I/O functions
*****************************************************************************
* Copyright (C) 2004-2005 the VideoLAN team
* Copyright (C) 2004-2005
, 2007
the VideoLAN team
* Copyright © 2005-2006 Rémi Denis-Courmont
* $Id$
*
* Authors: Laurent Aimar <fenrir@videolan.org>
* Rémi Denis-Courmont <rem # videolan.org>
* Christophe Mutricy <xtophe at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -649,3 +650,54 @@ int inet_pton(int af, const char *src, void *dst)
return
0
;
}
#endif
/* HAVE_INET_PTON */
#ifndef HAVE_INET_NTOP
#ifdef WIN32
const
char
*
inet_ntop
(
int
af
,
const
void
*
src
,
char
*
dst
,
socklen_t
cnt
)
{
switch
(
af
)
{
#ifdef AF_INET6
case
AF_INET6
:
{
struct
sockaddr_in6
addr
;
memset
(
&
addr
,
0
,
sizeof
(
addr
));
addr
.
sin6_family
=
AF_INET6
;
addr
.
sin6_addr
=
*
((
struct
in6_addr
*
)
src
);
if
(
0
==
WSAAddressToStringA
((
LPSOCKADDR
)
&
addr
,
sizeof
(
struct
sockaddr_in6
),
NULL
,
dst
,
&
cnt
)
)
{
dst
[
cnt
]
=
'\0'
;
return
dst
;
}
errno
=
WSAGetLastError
();
return
NULL
;
}
#endif
case
AF_INET
:
{
struct
sockaddr_in
addr
;
memset
(
&
addr
,
0
,
sizeof
(
addr
));
addr
.
sin_family
=
AF_INET
;
addr
.
sin_addr
=
*
((
struct
in_addr
*
)
src
);
if
(
0
==
WSAAddressToStringA
((
LPSOCKADDR
)
&
addr
,
sizeof
(
struct
sockaddr_in
),
NULL
,
dst
,
&
cnt
)
)
{
dst
[
cnt
]
=
'\0'
;
return
dst
;
}
errno
=
WSAGetLastError
();
return
NULL
;
}
}
errno
=
EAFNOSUPPORT
;
return
NULL
;
}
#endif
#endif
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