Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
209a00c6
Commit
209a00c6
authored
Nov 06, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
0dc1ef3e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
40 deletions
+32
-40
include/network.h
include/network.h
+8
-3
include/vlc_symbols.h
include/vlc_symbols.h
+0
-3
src/network/io.c
src/network/io.c
+24
-2
src/network/udp.c
src/network/udp.c
+0
-32
No files found.
include/network.h
View file @
209a00c6
...
@@ -89,8 +89,10 @@ int net_Socket (vlc_object_t *obj, int family, int socktype, int proto);
...
@@ -89,8 +89,10 @@ int net_Socket (vlc_object_t *obj, int family, int socktype, int proto);
#define net_OpenTCP(a, b, c) __net_ConnectTCP(VLC_OBJECT(a), b, c)
#define net_OpenTCP(a, b, c) __net_ConnectTCP(VLC_OBJECT(a), b, c)
VLC_EXPORT
(
int
,
__net_ConnectTCP
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
)
);
VLC_EXPORT
(
int
,
__net_ConnectTCP
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
)
);
int
*
net_Listen
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
/*int *net_Listen, (vlc_object_t *p_this, const char *psz_host, int i_port,
int
family
,
int
socktype
,
int
protocol
);
int family, int socktype, int protocol);*/
VLC_EXPORT
(
int
,
net_ListenSingle
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
family
,
int
socktype
,
int
protocol
)
);
#define net_ListenTCP(a, b, c) __net_ListenTCP(VLC_OBJECT(a), b, c)
#define net_ListenTCP(a, b, c) __net_ListenTCP(VLC_OBJECT(a), b, c)
VLC_EXPORT
(
int
*
,
__net_ListenTCP
,
(
vlc_object_t
*
,
const
char
*
,
int
)
);
VLC_EXPORT
(
int
*
,
__net_ListenTCP
,
(
vlc_object_t
*
,
const
char
*
,
int
)
);
...
@@ -101,7 +103,10 @@ VLC_EXPORT( int, __net_Accept, ( vlc_object_t *, int *, mtime_t ) );
...
@@ -101,7 +103,10 @@ VLC_EXPORT( int, __net_Accept, ( vlc_object_t *, int *, mtime_t ) );
#define net_ConnectUDP(a, b, c, d ) __net_ConnectUDP(VLC_OBJECT(a), b, c, d)
#define net_ConnectUDP(a, b, c, d ) __net_ConnectUDP(VLC_OBJECT(a), b, c, d)
VLC_EXPORT
(
int
,
__net_ConnectUDP
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
hlim
)
);
VLC_EXPORT
(
int
,
__net_ConnectUDP
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_port
,
int
hlim
)
);
VLC_EXPORT
(
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_ListenSingle
(
obj
,
host
,
port
,
AF_UNSPEC
,
SOCK_DGRAM
,
IPPROTO_UDP
);
}
#define net_OpenUDP(a, b, c, d, e ) __net_OpenUDP(VLC_OBJECT(a), b, c, d, e)
#define net_OpenUDP(a, b, c, d, e ) __net_OpenUDP(VLC_OBJECT(a), b, c, d, e)
VLC_EXPORT
(
int
,
__net_OpenUDP
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_bind
,
int
i_bind
,
const
char
*
psz_server
,
int
i_server
)
);
VLC_EXPORT
(
int
,
__net_OpenUDP
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_bind
,
int
i_bind
,
const
char
*
psz_server
,
int
i_server
)
);
...
...
include/vlc_symbols.h
View file @
209a00c6
...
@@ -554,7 +554,6 @@ struct module_symbols_t
...
@@ -554,7 +554,6 @@ struct module_symbols_t
void
(
*
config_ChainDestroy_inner
)
(
config_chain_t
*
);
void
(
*
config_ChainDestroy_inner
)
(
config_chain_t
*
);
char
*
(
*
config_ChainCreate_inner
)
(
char
**
,
config_chain_t
**
,
char
*
);
char
*
(
*
config_ChainCreate_inner
)
(
char
**
,
config_chain_t
**
,
char
*
);
int
(
*
utf8_open_inner
)
(
const
char
*
filename
,
int
flags
,
mode_t
mode
);
int
(
*
utf8_open_inner
)
(
const
char
*
filename
,
int
flags
,
mode_t
mode
);
int
(
*
net_ListenUDP1_inner
)
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
);
};
};
# if defined (__PLUGIN__)
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
...
@@ -1032,7 +1031,6 @@ struct module_symbols_t
...
@@ -1032,7 +1031,6 @@ struct module_symbols_t
# define config_ChainDestroy (p_symbols)->config_ChainDestroy_inner
# define config_ChainDestroy (p_symbols)->config_ChainDestroy_inner
# define config_ChainCreate (p_symbols)->config_ChainCreate_inner
# define config_ChainCreate (p_symbols)->config_ChainCreate_inner
# define utf8_open (p_symbols)->utf8_open_inner
# define utf8_open (p_symbols)->utf8_open_inner
# define net_ListenUDP1 (p_symbols)->net_ListenUDP1_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
...
@@ -1513,7 +1511,6 @@ struct module_symbols_t
...
@@ -1513,7 +1511,6 @@ struct module_symbols_t
((p_symbols)->config_ChainDestroy_inner) = config_ChainDestroy; \
((p_symbols)->config_ChainDestroy_inner) = config_ChainDestroy; \
((p_symbols)->config_ChainCreate_inner) = config_ChainCreate; \
((p_symbols)->config_ChainCreate_inner) = config_ChainCreate; \
((p_symbols)->utf8_open_inner) = utf8_open; \
((p_symbols)->utf8_open_inner) = utf8_open; \
((p_symbols)->net_ListenUDP1_inner) = net_ListenUDP1; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->__sout_CfgParse_deprecated = NULL; \
(p_symbols)->__sout_CfgParse_deprecated = NULL; \
(p_symbols)->sout_CfgCreate_deprecated = NULL; \
(p_symbols)->sout_CfgCreate_deprecated = NULL; \
...
...
src/network/io.c
View file @
209a00c6
...
@@ -114,8 +114,8 @@ int net_Socket (vlc_object_t *p_this, int family, int socktype,
...
@@ -114,8 +114,8 @@ int net_Socket (vlc_object_t *p_this, int family, int socktype,
}
}
int
*
net_Listen
(
vlc_object_t
*
p_this
,
const
char
*
psz_host
,
int
i_por
t
,
static
int
*
net_Listen
(
vlc_object_t
*
p_this
,
const
char
*
psz_hos
t
,
int
family
,
int
socktype
,
int
protocol
)
int
i_port
,
int
family
,
int
socktype
,
int
protocol
)
{
{
struct
addrinfo
hints
,
*
res
;
struct
addrinfo
hints
,
*
res
;
...
@@ -233,6 +233,28 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host, int i_port,
...
@@ -233,6 +233,28 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host, int i_port,
}
}
int
net_ListenSingle
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
,
int
family
,
int
socktype
,
int
protocol
)
{
int
*
fdv
=
net_Listen
(
obj
,
host
,
port
,
family
,
socktype
,
protocol
);
if
(
fdv
==
NULL
)
return
-
1
;
for
(
unsigned
i
=
1
;
fdv
[
i
]
!=
-
1
;
i
++
)
{
msg_Warn
(
obj
,
"A socket has been dropped!"
);
net_Close
(
fdv
[
i
]);
}
int
fd
=
fdv
[
0
];
assert
(
fd
!=
-
1
);
free
(
fdv
);
return
fd
;
}
/*****************************************************************************
/*****************************************************************************
* __net_Close:
* __net_Close:
*****************************************************************************
*****************************************************************************
...
...
src/network/udp.c
View file @
209a00c6
...
@@ -402,38 +402,6 @@ int __net_ConnectUDP( vlc_object_t *p_this, const char *psz_host, int i_port,
...
@@ -402,38 +402,6 @@ int __net_ConnectUDP( vlc_object_t *p_this, const char *psz_host, int i_port,
}
}
static
inline
int
*
__net_ListenUDP
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
{
int
*
fdv
=
net_Listen
(
obj
,
host
,
port
,
0
,
SOCK_DGRAM
,
IPPROTO_UDP
);
if
(
fdv
==
NULL
)
return
NULL
;
/* FIXME: handle multicast subscription */
return
fdv
;
}
int
net_ListenUDP1
(
vlc_object_t
*
obj
,
const
char
*
host
,
int
port
)
{
int
*
fdv
=
__net_ListenUDP
(
obj
,
host
,
port
);
if
(
fdv
==
NULL
)
return
-
1
;
for
(
unsigned
i
=
1
;
fdv
[
i
]
!=
-
1
;
i
++
)
{
msg_Warn
(
obj
,
"A socket has been dropped!"
);
net_Close
(
fdv
[
i
]);
}
int
fd
=
fdv
[
0
];
assert
(
fd
!=
-
1
);
free
(
fdv
);
return
fd
;
}
/*****************************************************************************
/*****************************************************************************
* __net_OpenUDP:
* __net_OpenUDP:
*****************************************************************************
*****************************************************************************
...
...
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