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
4c858d7e
Commit
4c858d7e
authored
Feb 10, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net_GetPort() returns network-byte order port number from an address
parent
8fb67068
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
include/vlc_network.h
include/vlc_network.h
+14
-0
No files found.
include/vlc_network.h
View file @
4c858d7e
...
...
@@ -317,6 +317,20 @@ static inline int net_GetPeerAddress( int fd, char *address, int *port )
?
VLC_EGENERIC
:
0
;
}
static
inline
uint16_t
net_GetPort
(
const
struct
sockaddr
*
addr
)
{
switch
(
addr
->
sa_family
)
{
#ifdef AF_INET6
case
AF_INET6
:
return
((
const
struct
sockaddr_in6
*
)
addr
)
->
sin6_port
;
#endif
case
AF_INET
:
return
((
const
struct
sockaddr_in
*
)
addr
)
->
sin_port
;
}
return
0
;
}
# ifdef __cplusplus
}
# 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