Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
47397b09
Commit
47397b09
authored
11 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Create a union for all the different sockaddr_* types we may use.
parent
53458cff
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xpdev/sockwrap.h
+15
-0
15 additions, 0 deletions
src/xpdev/sockwrap.h
with
15 additions
and
0 deletions
src/xpdev/sockwrap.h
+
15
−
0
View file @
47397b09
...
@@ -59,6 +59,7 @@
...
@@ -59,6 +59,7 @@
#include
<netdb.h>
/* gethostbyname */
#include
<netdb.h>
/* gethostbyname */
#include
<sys/types.h>
/* For u_int32_t on FreeBSD */
#include
<sys/types.h>
/* For u_int32_t on FreeBSD */
#include
<netinet/in.h>
/* IPPROTO_IP */
#include
<netinet/in.h>
/* IPPROTO_IP */
#include
<sys/un.h>
/* define _BSD_SOCKLEN_T_ in order to define socklen_t on darwin */
/* define _BSD_SOCKLEN_T_ in order to define socklen_t on darwin */
#ifdef __DARWIN__
#ifdef __DARWIN__
#define _BSD_SOCKLEN_T_ int
#define _BSD_SOCKLEN_T_ int
...
@@ -86,6 +87,20 @@ typedef struct {
...
@@ -86,6 +87,20 @@ typedef struct {
int
value
;
int
value
;
}
socket_option_t
;
}
socket_option_t
;
/*
* Fancy sockaddr_* union
*/
union
xp_sockaddr
{
struct
sockaddr
addr
;
struct
sockaddr_in
in
;
struct
sockaddr_in6
in6
;
#ifndef _WIN32
struct
sockaddr_un
un
;
#endif
struct
sockaddr_storage
store
;
};
/**********************************/
/**********************************/
/* Socket Implementation-specific */
/* Socket Implementation-specific */
/**********************************/
/**********************************/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment