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
e7ef1d97
Commit
e7ef1d97
authored
Sep 07, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement net_SetDSCP() to set Diffserv code point on a socket.
parent
429c5e99
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
include/network.h
include/network.h
+1
-0
include/vlc_symbols.h
include/vlc_symbols.h
+3
-0
src/network/udp.c
src/network/udp.c
+36
-0
No files found.
include/network.h
View file @
e7ef1d97
...
...
@@ -102,6 +102,7 @@ VLC_EXPORT( int, __net_OpenUDP, ( vlc_object_t *p_this, const char *psz_bind, in
VLC_EXPORT
(
void
,
net_Close
,
(
int
fd
)
);
VLC_EXPORT
(
void
,
net_ListenClose
,
(
int
*
fd
)
);
VLC_EXPORT
(
int
,
net_SetDSCP
,
(
int
fd
,
uint8_t
dscp
)
);
/* Functions to read from or write to the networking layer */
struct
virtual_socket_t
...
...
include/vlc_symbols.h
View file @
e7ef1d97
...
...
@@ -533,6 +533,7 @@ struct module_symbols_t
playlist_item_t
*
(
*
playlist_GetPreferredNode_inner
)
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_node
);
int
(
*
utf8_fprintf_inner
)
(
FILE
*
,
const
char
*
,
...);
int
(
*
utf8_vfprintf_inner
)
(
FILE
*
stream
,
const
char
*
fmt
,
va_list
ap
);
int
(
*
net_SetDSCP_inner
)
(
int
fd
,
uint8_t
dscp
);
};
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
...
...
@@ -1001,6 +1002,7 @@ struct module_symbols_t
# define playlist_GetPreferredNode (p_symbols)->playlist_GetPreferredNode_inner
# define utf8_fprintf (p_symbols)->utf8_fprintf_inner
# define utf8_vfprintf (p_symbols)->utf8_vfprintf_inner
# define net_SetDSCP (p_symbols)->net_SetDSCP_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
...
...
@@ -1472,6 +1474,7 @@ struct module_symbols_t
((p_symbols)->playlist_GetPreferredNode_inner) = playlist_GetPreferredNode; \
((p_symbols)->utf8_fprintf_inner) = utf8_fprintf; \
((p_symbols)->utf8_vfprintf_inner) = utf8_vfprintf; \
((p_symbols)->net_SetDSCP_inner) = net_SetDSCP; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->__playlist_ItemNew_deprecated = NULL; \
(p_symbols)->__playlist_ItemCopy_deprecated = NULL; \
...
...
src/network/udp.c
View file @
e7ef1d97
...
...
@@ -2,6 +2,8 @@
* udp.c:
*****************************************************************************
* Copyright (C) 2004-2006 the VideoLAN team
* Copyright © 2006 Rémi Denis-Courmont
*
* $Id$
*
* Authors: Laurent Aimar <fenrir@videolan.org>
...
...
@@ -166,6 +168,40 @@ static int net_SetMcastIface( vlc_object_t *p_this,
return
VLC_SUCCESS
;
}
int
net_SetDSCP
(
int
fd
,
uint8_t
dscp
)
{
struct
sockaddr_storage
addr
;
if
(
getsockname
(
fd
,
(
struct
sockaddr
*
)
&
addr
,
&
(
socklen_t
){
sizeof
(
addr
)
})
)
return
-
1
;
int
level
,
cmd
;
switch
(
addr
.
ss_family
)
{
#ifdef IPV6_TCLASS
case
AF_INET6
:
level
=
SOL_IPV6
;
cmd
=
IPV6_TCLASS
;
break
;
#endif
case
AF_INET
:
level
=
SOL_IP
;
cmd
=
IP_TOS
;
break
;
default:
#ifdef ENOPROTOOPT
errno
=
ENOPROTOOPT
;
#endif
return
-
1
;
}
return
setsockopt
(
fd
,
level
,
cmd
,
&
(
int
){
dscp
},
sizeof
(
int
));
}
/*****************************************************************************
* __net_ConnectUDP:
*****************************************************************************
...
...
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