summaryrefslogtreecommitdiff
path: root/inet/netinet
diff options
context:
space:
mode:
Diffstat (limited to 'inet/netinet')
-rw-r--r--inet/netinet/ether.h4
-rw-r--r--inet/netinet/icmp6.h14
-rw-r--r--inet/netinet/igmp.h10
-rw-r--r--inet/netinet/in.h75
-rw-r--r--inet/netinet/ip6.h10
5 files changed, 57 insertions, 56 deletions
diff --git a/inet/netinet/ether.h b/inet/netinet/ether.h
index 3dff523b2f..1d23e4a4c6 100644
--- a/inet/netinet/ether.h
+++ b/inet/netinet/ether.h
@@ -1,5 +1,5 @@
/* Functions for storing Ethernet addresses in ASCII and mapping to hostnames.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
/* Get definition of `struct ether_addr'. */
#include <netinet/if_ether.h>
+#ifdef __USE_MISC
__BEGIN_DECLS
/* Convert 48 bit Ethernet ADDRess to ASCII. */
@@ -49,5 +50,6 @@ extern int ether_line (const char *__line, struct ether_addr *__addr,
char *__hostname) __THROW;
__END_DECLS
+#endif /* Use misc. */
#endif /* netinet/ether.h */
diff --git a/inet/netinet/icmp6.h b/inet/netinet/icmp6.h
index b7a9637b52..a7100abf00 100644
--- a/inet/netinet/icmp6.h
+++ b/inet/netinet/icmp6.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -160,11 +160,11 @@ struct nd_neighbor_advert /* neighbor advertisement */
#define nd_na_code nd_na_hdr.icmp6_code
#define nd_na_cksum nd_na_hdr.icmp6_cksum
#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
#define ND_NA_FLAG_ROUTER 0x80000000
#define ND_NA_FLAG_SOLICITED 0x40000000
#define ND_NA_FLAG_OVERRIDE 0x20000000
-#else /* BYTE_ORDER == LITTLE_ENDIAN */
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
#define ND_NA_FLAG_ROUTER 0x00000080
#define ND_NA_FLAG_SOLICITED 0x00000040
#define ND_NA_FLAG_OVERRIDE 0x00000020
@@ -298,10 +298,10 @@ struct rr_pco_use /* use prefix part */
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x20
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x10
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
-#elif BYTE_ORDER == LITTLE_ENDIAN
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
#endif
@@ -315,10 +315,10 @@ struct rr_result /* router renumbering result message */
struct in6_addr rrr_prefix;
};
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define ICMP6_RR_RESULT_FLAGS_OOB 0x0002
# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
-#elif BYTE_ORDER == LITTLE_ENDIAN
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
# define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
#endif
diff --git a/inet/netinet/igmp.h b/inet/netinet/igmp.h
index fc7599e5e8..7a5b5249df 100644
--- a/inet/netinet/igmp.h
+++ b/inet/netinet/igmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -64,10 +64,10 @@ __BEGIN_DECLS
*/
struct igmp {
- u_int8_t igmp_type; /* IGMP type */
- u_int8_t igmp_code; /* routing code */
- u_int16_t igmp_cksum; /* checksum */
- struct in_addr igmp_group; /* group address */
+ uint8_t igmp_type; /* IGMP type */
+ uint8_t igmp_code; /* routing code */
+ uint16_t igmp_cksum; /* checksum */
+ struct in_addr igmp_group; /* group address */
};
#define IGMP_MINLEN 8
diff --git a/inet/netinet/in.h b/inet/netinet/in.h
index 6122ab599b..03a31b634c 100644
--- a/inet/netinet/in.h
+++ b/inet/netinet/in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
#define _NETINET_IN_H 1
#include <features.h>
-#include <stdint.h>
+#include <bits/stdint-uintn.h>
#include <sys/socket.h>
#include <bits/types.h>
@@ -92,10 +92,10 @@ enum
IPPROTO_MAX
};
-/* If __USE_KERNEL_IPV6_DEFS is defined then the user has included the kernel
+/* If __USE_KERNEL_IPV6_DEFS is 1 then the user has included the kernel
network headers first and we should use those ABI-identical definitions
- instead of our own. */
-#ifndef __USE_KERNEL_IPV6_DEFS
+ instead of our own, otherwise 0. */
+#if !__USE_KERNEL_IPV6_DEFS
enum
{
IPPROTO_HOPOPTS = 0, /* IPv6 Hop-by-Hop options. */
@@ -206,17 +206,15 @@ enum
#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) /* 224.0.0.2 */
#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */
-#ifndef __USE_KERNEL_IPV6_DEFS
+#if !__USE_KERNEL_IPV6_DEFS
/* IPv6 address */
struct in6_addr
{
union
{
uint8_t __u6_addr8[16];
-#ifdef __USE_MISC
uint16_t __u6_addr16[8];
uint32_t __u6_addr32[4];
-#endif
} __in6_u;
#define s6_addr __in6_u.__u6_addr8
#ifdef __USE_MISC
@@ -249,7 +247,7 @@ struct sockaddr_in
sizeof (struct in_addr)];
};
-#ifndef __USE_KERNEL_IPV6_DEFS
+#if !__USE_KERNEL_IPV6_DEFS
/* Ditto, for IPv6. */
struct sockaddr_in6
{
@@ -277,15 +275,15 @@ struct ip_mreq_source
/* IP multicast address of group. */
struct in_addr imr_multiaddr;
- /* IP address of source. */
+ /* IP address of interface. */
struct in_addr imr_interface;
- /* IP address of interface. */
+ /* IP address of source. */
struct in_addr imr_sourceaddr;
};
#endif
-#ifndef __USE_KERNEL_IPV6_DEFS
+#if !__USE_KERNEL_IPV6_DEFS
/* Likewise, for IPv6. */
struct ipv6_mreq
{
@@ -385,6 +383,7 @@ extern uint16_t htons (uint16_t __hostshort)
/* Get machine dependent optimized versions of byte swapping functions. */
#include <bits/byteswap.h>
+#include <bits/uintn-identity.h>
#ifdef __OPTIMIZE__
/* We can optimize calls to the conversion functions. Either nothing has
@@ -393,10 +392,10 @@ extern uint16_t htons (uint16_t __hostshort)
# if __BYTE_ORDER == __BIG_ENDIAN
/* The host byte order is the same as network byte order,
so these functions are all just identity. */
-# define ntohl(x) (x)
-# define ntohs(x) (x)
-# define htonl(x) (x)
-# define htons(x) (x)
+# define ntohl(x) __uint32_identity (x)
+# define ntohs(x) __uint16_identity (x)
+# define htonl(x) __uint32_identity (x)
+# define htons(x) __uint16_identity (x)
# else
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define ntohl(x) __bswap_32 (x)
@@ -411,52 +410,52 @@ extern uint16_t htons (uint16_t __hostshort)
# define IN6_IS_ADDR_UNSPECIFIED(a) \
(__extension__ \
({ const struct in6_addr *__a = (const struct in6_addr *) (a); \
- __a->s6_addr32[0] == 0 \
- && __a->s6_addr32[1] == 0 \
- && __a->s6_addr32[2] == 0 \
- && __a->s6_addr32[3] == 0; }))
+ __a->__in6_u.__u6_addr32[0] == 0 \
+ && __a->__in6_u.__u6_addr32[1] == 0 \
+ && __a->__in6_u.__u6_addr32[2] == 0 \
+ && __a->__in6_u.__u6_addr32[3] == 0; }))
# define IN6_IS_ADDR_LOOPBACK(a) \
(__extension__ \
({ const struct in6_addr *__a = (const struct in6_addr *) (a); \
- __a->s6_addr32[0] == 0 \
- && __a->s6_addr32[1] == 0 \
- && __a->s6_addr32[2] == 0 \
- && __a->s6_addr32[3] == htonl (1); }))
+ __a->__in6_u.__u6_addr32[0] == 0 \
+ && __a->__in6_u.__u6_addr32[1] == 0 \
+ && __a->__in6_u.__u6_addr32[2] == 0 \
+ && __a->__in6_u.__u6_addr32[3] == htonl (1); }))
# define IN6_IS_ADDR_LINKLOCAL(a) \
(__extension__ \
({ const struct in6_addr *__a = (const struct in6_addr *) (a); \
- (__a->s6_addr32[0] & htonl (0xffc00000)) == htonl (0xfe800000); }))
+ (__a->__in6_u.__u6_addr32[0] & htonl (0xffc00000)) == htonl (0xfe800000); }))
# define IN6_IS_ADDR_SITELOCAL(a) \
(__extension__ \
({ const struct in6_addr *__a = (const struct in6_addr *) (a); \
- (__a->s6_addr32[0] & htonl (0xffc00000)) == htonl (0xfec00000); }))
+ (__a->__in6_u.__u6_addr32[0] & htonl (0xffc00000)) == htonl (0xfec00000); }))
# define IN6_IS_ADDR_V4MAPPED(a) \
(__extension__ \
({ const struct in6_addr *__a = (const struct in6_addr *) (a); \
- __a->s6_addr32[0] == 0 \
- && __a->s6_addr32[1] == 0 \
- && __a->s6_addr32[2] == htonl (0xffff); }))
+ __a->__in6_u.__u6_addr32[0] == 0 \
+ && __a->__in6_u.__u6_addr32[1] == 0 \
+ && __a->__in6_u.__u6_addr32[2] == htonl (0xffff); }))
# define IN6_IS_ADDR_V4COMPAT(a) \
(__extension__ \
({ const struct in6_addr *__a = (const struct in6_addr *) (a); \
- __a->s6_addr32[0] == 0 \
- && __a->s6_addr32[1] == 0 \
- && __a->s6_addr32[2] == 0 \
- && ntohl (__a->s6_addr32[3]) > 1; }))
+ __a->__in6_u.__u6_addr32[0] == 0 \
+ && __a->__in6_u.__u6_addr32[1] == 0 \
+ && __a->__in6_u.__u6_addr32[2] == 0 \
+ && ntohl (__a->__in6_u.__u6_addr32[3]) > 1; }))
# define IN6_ARE_ADDR_EQUAL(a,b) \
(__extension__ \
({ const struct in6_addr *__a = (const struct in6_addr *) (a); \
const struct in6_addr *__b = (const struct in6_addr *) (b); \
- __a->s6_addr32[0] == __b->s6_addr32[0] \
- && __a->s6_addr32[1] == __b->s6_addr32[1] \
- && __a->s6_addr32[2] == __b->s6_addr32[2] \
- && __a->s6_addr32[3] == __b->s6_addr32[3]; }))
+ __a->__in6_u.__u6_addr32[0] == __b->__in6_u.__u6_addr32[0] \
+ && __a->__in6_u.__u6_addr32[1] == __b->__in6_u.__u6_addr32[1] \
+ && __a->__in6_u.__u6_addr32[2] == __b->__in6_u.__u6_addr32[2] \
+ && __a->__in6_u.__u6_addr32[3] == __b->__in6_u.__u6_addr32[3]; }))
#else
# define IN6_IS_ADDR_UNSPECIFIED(a) \
(((const uint32_t *) (a))[0] == 0 \
@@ -532,7 +531,7 @@ extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
#ifdef __USE_GNU
struct cmsghdr; /* Forward declaration. */
-#ifndef __USE_KERNEL_IPV6_DEFS
+#if !__USE_KERNEL_IPV6_DEFS
/* IPv6 packet information. */
struct in6_pktinfo
{
diff --git a/inet/netinet/ip6.h b/inet/netinet/ip6.h
index 929d4b5dc0..31422ff927 100644
--- a/inet/netinet/ip6.h
+++ b/inet/netinet/ip6.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -101,11 +101,11 @@ struct ip6_frag
uint32_t ip6f_ident; /* identification */
};
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
# define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
# define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
-#else /* BYTE_ORDER == LITTLE_ENDIAN */
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
# define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */
# define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */
# define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */
@@ -175,11 +175,11 @@ struct ip6_opt_router
};
/* Router alert values (in network byte order) */
-#if BYTE_ORDER == BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
# define IP6_ALERT_MLD 0x0000
# define IP6_ALERT_RSVP 0x0001
# define IP6_ALERT_AN 0x0002
-#else /* BYTE_ORDER == LITTLE_ENDING */
+#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
# define IP6_ALERT_MLD 0x0000
# define IP6_ALERT_RSVP 0x0100
# define IP6_ALERT_AN 0x0200