From 55f31f03f9cca55b8b94ebf31cef3f501d8d76cf Mon Sep 17 00:00:00 2001 From: Anthony Merlino Date: Sat, 27 Oct 2018 19:32:25 +0000 Subject: [PATCH] Merged in antmerlino/nuttx/add-ipv6-options (pull request #741) Adds definitions for IPPROTO_IPV6 socket options to netinet/in.h Adds missing fields to sockaddr_in6. Adds struct ipv6-mreq. These changes all follow the opengroup standard for netinet/in.h Approved-by: GregoryN --- include/netinet/in.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/include/netinet/in.h b/include/netinet/in.h index a9bc1c06899..a5cb18e9ce1 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -43,6 +43,7 @@ #include #include +#include #include /**************************************************************************** @@ -83,6 +84,16 @@ #define IPPROTO_MPLS 137 /* MPLS in IP (RFC 4023) */ #define IPPROTO_RAW 255 /* Raw IP packets */ +/* Values for option_name argument of getsockopt() or setsockopt() */ + +#define IPV6_JOIN_GROUP (__SO_PROTOCOL + 1) /* Join a multicast group */ +#define IPV6_LEAVE_GROUP (__SO_PROTOCOL + 2) /* Quit a multicast group */ +#define IPV6_MULTICAST_HOPS (__SO_PROTOCOL + 3) /* Multicast hop limit */ +#define IPV6_MULTICAST_IF (__SO_PROTOCOL + 4) /* Interface to use for outgoing multicast packets */ +#define IPV6_MULTICAST_LOOP (__SO_PROTOCOL + 5) /* Multicast packets are delivered back to the local application */ +#define IPV6_UNICAST_HOPS (__SO_PROTOCOL + 6) /* Unicast hop limit */ +#define IPV6_V6ONLY (__SO_PROTOCOL + 7) /* Restrict AF_INET6 socket to IPv6 communications only */ + /* Values used with SIOCSIFMCFILTER and SIOCGIFMCFILTER ioctl's */ #define MCAST_EXCLUDE 0 @@ -176,11 +187,19 @@ struct in6_addr struct sockaddr_in6 { - sa_family_t sin6_family; /* Address family: AF_INET */ - uint16_t sin6_port; /* Port in network byte order */ - struct in6_addr sin6_addr; /* IPv6 internet address */ + sa_family_t sin6_family; /* Address family: AF_INET6 */ + in_port_t sin6_port; /* Port in network byte order */ + uint32_t sin6_flowinfo; /* IPv6 traffic class and flow information */ + struct in6_addr sin6_addr; /* IPv6 internet address */ + uint32_t sin6_scope_id; /* Set of interfaces for a scope */ }; +struct ipv6_mreq + { + struct in6_addr ipv6mr_multiaddr; /* IPv6 multicast address of group */ + unsigned int ipv6mr_interface; /* local interface */ + }; + /**************************************************************************** * Public Data ****************************************************************************/