From 13726cfc7c19328d6af0abd538baadfbf679856f Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 03:31:36 +0200 Subject: use __BYTE_ORDER and __*ENDIAN Those without the __ prefix are BSD specific. Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/netinet/icmp6.h | 12 ++++++------ include/netinet/ip6.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'include/netinet') diff --git a/include/netinet/icmp6.h b/include/netinet/icmp6.h index 0cb1aa6a6..225e49e07 100644 --- a/include/netinet/icmp6.h +++ b/include/netinet/icmp6.h @@ -161,11 +161,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 @@ -299,10 +299,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 @@ -316,10 +316,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/include/netinet/ip6.h b/include/netinet/ip6.h index bef2af2f5..c82b277e1 100644 --- a/include/netinet/ip6.h +++ b/include/netinet/ip6.h @@ -102,11 +102,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 */ @@ -176,11 +176,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_ENDING */ # define IP6_ALERT_MLD 0x0000 # define IP6_ALERT_RSVP 0x0100 # define IP6_ALERT_AN 0x0200 -- cgit v1.2.3 From 9a9fe3ad32b7f42650d6acdab484782320ae8e6d Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 03:45:53 +0200 Subject: sync some headers and disable unused prototypes Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/netinet/ether.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/netinet') diff --git a/include/netinet/ether.h b/include/netinet/ether.h index 3d8902f50..5e89dfe9e 100644 --- a/include/netinet/ether.h +++ b/include/netinet/ether.h @@ -25,7 +25,9 @@ /* Get definition of `struct ether_addr'. */ #include +#ifdef _LIBC #define ETHER_FILE_NAME "/etc/ethers" +#endif __BEGIN_DECLS @@ -41,6 +43,7 @@ extern struct ether_addr *ether_aton_r (__const char *__asc, struct ether_addr *__addr) __THROW; libc_hidden_proto(ether_aton_r) +#if 0 /* Map 48 bit Ethernet number ADDR to HOSTNAME. */ extern int ether_ntohost (char *__hostname, __const struct ether_addr *__addr) __THROW; @@ -52,6 +55,7 @@ extern int ether_hostton (__const char *__hostname, struct ether_addr *__addr) /* Scan LINE and set ADDR and HOSTNAME. */ extern int ether_line (__const char *__line, struct ether_addr *__addr, char *__hostname) __THROW; +#endif __END_DECLS -- cgit v1.2.3 From f683d2c5c57b22f02c5c681f1408ae0bc61412c8 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 03:51:49 +0200 Subject: protocols.h: remove Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/netinet/protocols.h | 62 --------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 include/netinet/protocols.h (limited to 'include/netinet') diff --git a/include/netinet/protocols.h b/include/netinet/protocols.h deleted file mode 100644 index 1a619c474..000000000 --- a/include/netinet/protocols.h +++ /dev/null @@ -1,62 +0,0 @@ -/* protocols.h */ -#ifndef _NETINET_PROTOCOLS_H -#define _NETINET_PROTOCOLS_H - -#define IP_ICMP 1 -#define IP_IGMP 2 -#define IP_GGP 3 -#define IP_ST 5 -#define IP_TCP 6 -#define IP_UCL 7 -#define IP_EGP 8 -#define IP_IGP 9 -#define IP_BBN_RCC_MON 10 -#define IP_NVP_II 11 -#define IP_PUP 12 -#define IP_ARGUS 13 -#define IP_EMCON 14 -#define IP_XNET 15 -#define IP_CHAOS 16 -#define IP_UDP 17 -#define IP_MUX 18 -#define IP_DCN_MEAS 19 -#define IP_HMP 20 -#define IP_PRM 21 -#define IP_XNS_IDP 22 -#define IP_TRUNK1 23 -#define IP_TRUNK2 24 -#define IP_LEAF1 25 -#define IP_LEAF2 26 -#define IP_RDP 27 -#define IP_IRTP 28 -#define IP_ISO_TP4 29 -#define IP_NETBLT 30 -#define IP_MFE_NSP 31 -#define IP_MERIT_INP 32 -#define IP_SEP 33 -#define IP_3PC 34 -#define IP_CFTP 62 -#define SAT_EXPAK 64 -#define IP_RVD 66 -#define IP_IPPC 67 -#define IP_SAT_MON 69 -#define IP_VISA 70 -#define IP_IPCV 71 -#define IP_BR_SAT_MON 76 -#define IP_SUN_ND 77 -#define IP_WB_MON 78 -#define IP_WB_EXPAK 79 -#define IP_ISO_IP 80 -#define IP_VMTP 81 -#define IP_SECURE_VMTP 82 -#define IP_VINES 83 -#define IP_TTP 84 -#define NSFNET_IGP 85 -#define IP_DGP 86 -#define IP_TCF 87 -#define IP_IGRP 88 -#define IP_OSPFIGP 89 -#define IP_SPRITE_RPG 90 -#define IP_LARP 91 - -#endif /* _NETINET_PROTOCOLS_H*/ -- cgit v1.2.3 From a9e4475b961e4f2c502de9953c5d8a8bc6dcffb0 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 04:07:01 +0200 Subject: update headers and disable prototypes Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/netinet/in.h | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) (limited to 'include/netinet') diff --git a/include/netinet/in.h b/include/netinet/in.h index 851aace59..06965d65b 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2001, 2003, 2004, 2006, 2007 +/* Copyright (C) 1991-2001, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -53,6 +53,8 @@ enum #define IPPROTO_IDP IPPROTO_IDP IPPROTO_TP = 29, /* SO Transport Protocol Class 4. */ #define IPPROTO_TP IPPROTO_TP + IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol. */ +#define IPPROTO_DCCP IPPROTO_DCCP IPPROTO_IPV6 = 41, /* IPv6 header. */ #define IPPROTO_IPV6 IPPROTO_IPV6 IPPROTO_ROUTING = 43, /* IPv6 routing header. */ @@ -83,6 +85,8 @@ enum #define IPPROTO_COMP IPPROTO_COMP IPPROTO_SCTP = 132, /* Stream Control Transmission Protocol. */ #define IPPROTO_SCTP IPPROTO_SCTP + IPPROTO_UDPLITE = 136, /* UDP-Lite protocol. */ +#define IPPROTO_UDPLITE IPPROTO_UDPLITE IPPROTO_RAW = 255, /* Raw IP packets. */ #define IPPROTO_RAW IPPROTO_RAW IPPROTO_MAX @@ -195,13 +199,17 @@ struct in6_addr { union { - uint8_t u6_addr8[16]; - uint16_t u6_addr16[8]; - uint32_t u6_addr32[4]; - } in6_u; -#define s6_addr in6_u.u6_addr8 -#define s6_addr16 in6_u.u6_addr16 -#define s6_addr32 in6_u.u6_addr32 + uint8_t __u6_addr8[16]; +#if defined __USE_MISC || defined __USE_GNU + uint16_t __u6_addr16[8]; + uint32_t __u6_addr32[4]; +#endif + } __in6_u; +#define s6_addr __in6_u.__u6_addr8 +#if defined __USE_MISC || defined __USE_GNU +# define s6_addr16 __in6_u.__u6_addr16 +# define s6_addr32 __in6_u.__u6_addr32 +#endif }; extern const struct in6_addr in6addr_any; /* :: */ @@ -213,11 +221,8 @@ libc_hidden_proto(in6addr_loopback) #define INET_ADDRSTRLEN 16 #define INET6_ADDRSTRLEN 46 -/* Get the definition of the macro to define the common sockaddr members. */ -#include - -#if 1 /* defined __UCLIBC_HAS_IPV4__ */ +#if 1 /*def __UCLIBC_HAS_IPV4__*/ /* Structure describing an Internet socket address. */ struct sockaddr_in { @@ -244,6 +249,7 @@ struct sockaddr_in6 }; +#if defined __USE_MISC || defined __USE_GNU /* IPv4 multicast request. */ struct ip_mreq { @@ -265,6 +271,8 @@ struct ip_mreq_source /* IP address of interface. */ struct in_addr imr_sourceaddr; }; +#endif + /* Likewise, for IPv6. */ struct ipv6_mreq @@ -277,6 +285,7 @@ struct ipv6_mreq }; +#if defined __USE_MISC || defined __USE_GNU /* Multicast group request. */ struct group_req { @@ -343,6 +352,7 @@ struct group_filter - sizeof (struct sockaddr_storage) \ + ((numsrc) \ * sizeof (struct sockaddr_storage))) +#endif /* Get system-specific definitions. */ @@ -432,13 +442,17 @@ libc_hidden_proto(htons) && (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \ && (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3])) +#if defined __USE_MISC || defined __USE_GNU /* Bind socket to a privileged IP port. */ extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __THROW; libc_hidden_proto(bindresvport) +# if 0 /*def __UCLIBC_HAS_IPV6__*/ /* The IPv6 version of this function. */ extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in) __THROW; +# endif +#endif #define IN6_IS_ADDR_MC_NODELOCAL(a) \ @@ -461,6 +475,8 @@ extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in) (IN6_IS_ADDR_MULTICAST(a) \ && ((((__const uint8_t *) (a))[1] & 0xf) == 0xe)) + +#if 0 /*def __USE_GNU*/ /* IPv6 packet information. */ struct in6_pktinfo { @@ -476,7 +492,6 @@ struct ip6_mtuinfo }; -#if 0 /*def __USE_GNU*/ /* Obsolete hop-by-hop and Destination Options Processing (RFC 2292). */ extern int inet6_option_space (int __nbytes) __THROW __attribute_deprecated__; -- cgit v1.2.3