Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
60a679f5
Commit
60a679f5
authored
Feb 11, 2007
by
Rémi Denis-Courmont
Browse files
net_SetPort() sets a port within a socket address
parent
19ed4ded
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/vlc_network.h
View file @
60a679f5
...
...
@@ -331,6 +331,20 @@ static inline uint16_t net_GetPort (const struct sockaddr *addr)
return
0
;
}
static
inline
void
net_SetPort
(
struct
sockaddr
*
addr
,
uint16_t
port
)
{
switch
(
addr
->
sa_family
)
{
#ifdef AF_INET6
case
AF_INET6
:
((
struct
sockaddr_in6
*
)
addr
)
->
sin6_port
=
port
;
break
;
#endif
case
AF_INET
:
((
struct
sockaddr_in
*
)
addr
)
->
sin_port
=
port
;
break
;
}
}
# ifdef __cplusplus
}
# endif
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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