X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Fnetinet%2Fin.h;h=f18b478dad4cccef89d97da1ffe856fcf9cf9103;hb=5f4ff22aa3ad81c59cac46444d01a7ce5b40636f;hp=db961442cf9e5c269196f1430a518e133e26141a;hpb=c91ad4f7167bad8314b06c487ddd1c638981fc24;p=musl diff --git a/include/netinet/in.h b/include/netinet/in.h index db961442..f18b478d 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -13,16 +13,14 @@ typedef uint16_t in_port_t; typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; }; -struct sockaddr_in -{ +struct sockaddr_in { sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; uint8_t sin_zero[8]; }; -struct in6_addr -{ +struct in6_addr { union { uint8_t __s6_addr[16]; uint16_t __s6_addr16[8]; @@ -33,8 +31,7 @@ struct in6_addr #define s6_addr16 __in6_union.__s6_addr16 #define s6_addr32 __in6_union.__s6_addr32 -struct sockaddr_in6 -{ +struct sockaddr_in6 { sa_family_t sin6_family; in_port_t sin6_port; uint32_t sin6_flowinfo; @@ -42,8 +39,7 @@ struct sockaddr_in6 uint32_t sin6_scope_id; }; -struct ipv6_mreq -{ +struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; unsigned ipv6mr_interface; }; @@ -73,6 +69,8 @@ uint16_t htons(uint16_t); uint32_t ntohl(uint32_t); uint16_t ntohs(uint16_t); +#define IPPORT_RESERVED 1024 + #define IPPROTO_IP 0 #define IPPROTO_HOPOPTS 0 #define IPPROTO_ICMP 1 @@ -103,6 +101,7 @@ uint16_t ntohs(uint16_t); #define IPPROTO_SCTP 132 #define IPPROTO_MH 135 #define IPPROTO_UDPLITE 136 +#define IPPROTO_MPLS 137 #define IPPROTO_RAW 255 #define IPPROTO_MAX 256 @@ -149,7 +148,7 @@ uint16_t ntohs(uint16_t); (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0xe)) #define __ARE_4_EQUAL(a,b) \ - (!( 0[a]-0[b] | 1[a]-1[b] | 2[a]-2[b] | 3[a]-3[b] )) + (!( (0[a]-0[b]) | (1[a]-1[b]) | (2[a]-2[b]) | (3[a]-3[b]) )) #define IN6_ARE_ADDR_EQUAL(a,b) \ __ARE_4_EQUAL((const uint32_t *)(a), (const uint32_t *)(b)) @@ -198,6 +197,10 @@ uint16_t ntohs(uint16_t); #define IP_ORIGDSTADDR 20 #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR #define IP_MINTTL 21 +#define IP_NODEFRAG 22 +#define IP_CHECKSUM 23 +#define IP_BIND_ADDRESS_NO_PORT 24 +#define IP_RECVFRAGSIZE 25 #define IP_MULTICAST_IF 32 #define IP_MULTICAST_TTL 33 #define IP_MULTICAST_LOOP 34 @@ -211,46 +214,43 @@ uint16_t ntohs(uint16_t); #define IP_MULTICAST_ALL 49 #define IP_UNICAST_IF 50 -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -#define MCAST_JOIN_GROUP 42 -#define MCAST_BLOCK_SOURCE 43 -#define MCAST_UNBLOCK_SOURCE 44 -#define MCAST_LEAVE_GROUP 45 -#define MCAST_JOIN_SOURCE_GROUP 46 -#define MCAST_LEAVE_SOURCE_GROUP 47 -#define MCAST_MSFILTER 48 - -#define MCAST_EXCLUDE 0 -#define MCAST_INCLUDE 1 -#endif - #define IP_RECVRETOPTS IP_RETOPTS #define IP_PMTUDISC_DONT 0 #define IP_PMTUDISC_WANT 1 #define IP_PMTUDISC_DO 2 #define IP_PMTUDISC_PROBE 3 - -#define SOL_IP 0 +#define IP_PMTUDISC_INTERFACE 4 +#define IP_PMTUDISC_OMIT 5 #define IP_DEFAULT_MULTICAST_TTL 1 #define IP_DEFAULT_MULTICAST_LOOP 1 #define IP_MAX_MEMBERSHIPS 20 -struct ip_opts -{ +struct ip_opts { struct in_addr ip_dst; char ip_opts[40]; }; -struct ip_mreq -{ +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + +#define MCAST_JOIN_GROUP 42 +#define MCAST_BLOCK_SOURCE 43 +#define MCAST_UNBLOCK_SOURCE 44 +#define MCAST_LEAVE_GROUP 45 +#define MCAST_JOIN_SOURCE_GROUP 46 +#define MCAST_LEAVE_SOURCE_GROUP 47 +#define MCAST_MSFILTER 48 + +#define MCAST_EXCLUDE 0 +#define MCAST_INCLUDE 1 + +struct ip_mreq { struct in_addr imr_multiaddr; struct in_addr imr_interface; }; -struct ip_mreqn -{ +struct ip_mreqn { struct in_addr imr_multiaddr; struct in_addr imr_address; int imr_ifindex; @@ -273,7 +273,6 @@ struct ip_msfilter { (sizeof(struct ip_msfilter) - sizeof(struct in_addr) \ + (numsrc) * sizeof(struct in_addr)) -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) struct group_req { uint32_t gr_interface; struct sockaddr_storage gr_group; @@ -295,26 +294,23 @@ struct group_filter { #define GROUP_FILTER_SIZE(numsrc) \ (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) \ + (numsrc) * sizeof(struct sockaddr_storage)) -#endif -struct in_pktinfo -{ +struct in_pktinfo { int ipi_ifindex; struct in_addr ipi_spec_dst; struct in_addr ipi_addr; }; -struct in6_pktinfo -{ +struct in6_pktinfo { struct in6_addr ipi6_addr; unsigned ipi6_ifindex; }; -struct ip6_mtuinfo -{ +struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; uint32_t ip6m_mtu; }; +#endif #define IPV6_ADDRFORM 1 #define IPV6_2292PKTINFO 2 @@ -324,7 +320,6 @@ struct ip6_mtuinfo #define IPV6_2292PKTOPTIONS 6 #define IPV6_CHECKSUM 7 #define IPV6_2292HOPLIMIT 8 -#define SCM_SRCRT IPV6_RXSRCRT #define IPV6_NEXTHOP 9 #define IPV6_AUTHHDR 10 #define IPV6_UNICAST_HOPS 16 @@ -342,6 +337,7 @@ struct ip6_mtuinfo #define IPV6_LEAVE_ANYCAST 28 #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 +#define IPV6_HDRINCL 36 #define IPV6_RECVPKTINFO 49 #define IPV6_PKTINFO 50 @@ -354,29 +350,60 @@ struct ip6_mtuinfo #define IPV6_RTHDR 57 #define IPV6_RECVDSTOPTS 58 #define IPV6_DSTOPTS 59 - +#define IPV6_RECVPATHMTU 60 +#define IPV6_PATHMTU 61 +#define IPV6_DONTFRAG 62 #define IPV6_RECVTCLASS 66 #define IPV6_TCLASS 67 +#define IPV6_AUTOFLOWLABEL 70 +#define IPV6_ADDR_PREFERENCES 72 +#define IPV6_MINHOPCOUNT 73 +#define IPV6_ORIGDSTADDR 74 +#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR +#define IPV6_TRANSPARENT 75 +#define IPV6_UNICAST_IF 76 +#define IPV6_RECVFRAGSIZE 77 #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP #define IPV6_RXHOPOPTS IPV6_HOPOPTS #define IPV6_RXDSTOPTS IPV6_DSTOPTS - #define IPV6_PMTUDISC_DONT 0 #define IPV6_PMTUDISC_WANT 1 #define IPV6_PMTUDISC_DO 2 #define IPV6_PMTUDISC_PROBE 3 +#define IPV6_PMTUDISC_INTERFACE 4 +#define IPV6_PMTUDISC_OMIT 5 -#define SOL_IPV6 41 -#define SOL_ICMPV6 58 +#define IPV6_PREFER_SRC_TMP 0x0001 +#define IPV6_PREFER_SRC_PUBLIC 0x0002 +#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100 +#define IPV6_PREFER_SRC_COA 0x0004 +#define IPV6_PREFER_SRC_HOME 0x0400 +#define IPV6_PREFER_SRC_CGA 0x0008 +#define IPV6_PREFER_SRC_NONCGA 0x0800 #define IPV6_RTHDR_LOOSE 0 #define IPV6_RTHDR_STRICT 1 #define IPV6_RTHDR_TYPE_0 0 +#define __UAPI_DEF_IN_ADDR 0 +#define __UAPI_DEF_IN_IPPROTO 0 +#define __UAPI_DEF_IN_PKTINFO 0 +#define __UAPI_DEF_IP_MREQ 0 +#define __UAPI_DEF_SOCKADDR_IN 0 +#define __UAPI_DEF_IN_CLASS 0 +#define __UAPI_DEF_IN6_ADDR 0 +#define __UAPI_DEF_IN6_ADDR_ALT 0 +#define __UAPI_DEF_SOCKADDR_IN6 0 +#define __UAPI_DEF_IPV6_MREQ 0 +#define __UAPI_DEF_IPPROTO_V6 0 +#define __UAPI_DEF_IPV6_OPTIONS 0 +#define __UAPI_DEF_IN6_PKTINFO 0 +#define __UAPI_DEF_IP6_MTUINFO 0 + #ifdef __cplusplus } #endif