summaryrefslogtreecommitdiff
path: root/Libraries/LibC/netinet
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-11 21:07:42 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-11 21:13:18 +0200
commitc37dc4ae73a5f75a13c313bf888be5bfdc832d0b (patch)
treea2c25516a5f0e8a1e4dce566d208c4628457a6f2 /Libraries/LibC/netinet
parent36c738d9bf5089875c769edf17fec249df15dc9a (diff)
downloadserenity-c37dc4ae73a5f75a13c313bf888be5bfdc832d0b.zip
LibC: Add sa_family_t and in_port_t types
Diffstat (limited to 'Libraries/LibC/netinet')
-rw-r--r--Libraries/LibC/netinet/in.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/Libraries/LibC/netinet/in.h b/Libraries/LibC/netinet/in.h
index ca89ac729d..71802d633e 100644
--- a/Libraries/LibC/netinet/in.h
+++ b/Libraries/LibC/netinet/in.h
@@ -28,6 +28,7 @@
#include <bits/stdint.h>
#include <sys/cdefs.h>
+#include <sys/socket.h>
__BEGIN_DECLS
@@ -43,13 +44,15 @@ in_addr_t inet_addr(const char*);
#define IPPORT_RESERVED 1024
#define IPPORT_USERRESERVED 5000
+typedef uint16_t in_port_t;
+
struct in_addr {
uint32_t s_addr;
};
struct sockaddr_in {
- uint16_t sin_family;
- uint16_t sin_port;
+ sa_family_t sin_family;
+ in_port_t sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
@@ -59,8 +62,8 @@ struct in6_addr {
};
struct sockaddr_in6 {
- uint16_t sin6_family; // AF_INET6.
- uint16_t sin6_port; // Port number.
+ sa_family_t sin6_family; // AF_INET6.
+ in_port_t sin6_port; // Port number.
uint32_t sin6_flowinfo; // IPv6 traffic class and flow information.
struct in6_addr sin6_addr; // IPv6 address.
uint32_t sin6_scope_id; // Set of interfaces for a scop