[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 05/06: Define IPPROTO_IPV6 and IPV6_V6ONLY.

From: Ludovic Courtès
Subject: [Guile-commits] 05/06: Define IPPROTO_IPV6 and IPV6_V6ONLY.
Date: Mon, 4 Jul 2022 05:52:41 -0400 (EDT)

civodul pushed a commit to branch main
in repository guile.

commit abd39f3328439c0c3d42296a895d54df448448b1
Author: Ludovic Courtès <>
AuthorDate: Mon Jul 4 11:49:31 2022 +0200

    Define IPPROTO_IPV6 and IPV6_V6ONLY.
    * libguile/socket.c (scm_init_socket): Define IPPROTO_IPV6 and IPV6_V6ONLY.
    * doc/ref/posix.texi (Network Sockets and Communication): Document them.
 doc/ref/posix.texi | 11 +++++++++++
 libguile/socket.c  |  7 +++++++
 2 files changed, 18 insertions(+)

diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi
index 50085cd80..19911a427 100644
--- a/doc/ref/posix.texi
+++ b/doc/ref/posix.texi
@@ -3202,6 +3202,7 @@ Databases}).
 @defvar SOL_SOCKET
 @defvarx IPPROTO_IP
+@defvarx IPPROTO_IPV6
 @defvarx IPPROTO_TCP
 @defvarx IPPROTO_UDP
 @end defvar
@@ -3266,6 +3267,16 @@ the interface @var{INTERFACEADDR}.  @var{INTERFACEADDR} 
can be
 @var{INTERFACEADDR} can also be an interface index number, on systems
 supporting that.
 @end defvar
+Last, for IPv6 level (@code{IPPROTO_IPV6}), the following @var{optname}s
+are defined.  See @command{man 7 ipv6} for details.
+@defvar IPV6_V6ONLY
+Determines whether an @code{AF_INET6} socket is restricted to
+transmitting IPv6 packets only, or whether it can also transmit packets
+for an IPv4-mapped IPv6 address.
+@end defvar
 @end deffn
 For @code{IPPROTO_TCP} level the following @var{optname}s are defined
diff --git a/libguile/socket.c b/libguile/socket.c
index 3d5b89e63..b3482c8f3 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -1712,6 +1712,9 @@ scm_init_socket ()
 #ifdef IPPROTO_IP
   scm_c_define ("IPPROTO_IP", scm_from_int (IPPROTO_IP));
+#ifdef IPPROTO_IPV6
+  scm_c_define ("IPPROTO_IPV6", scm_from_int (IPPROTO_IPV6));
   scm_c_define ("IPPROTO_TCP", scm_from_int (IPPROTO_TCP));
@@ -1801,6 +1804,10 @@ scm_init_socket ()
   scm_c_define ("IP_MULTICAST_IF", scm_from_int ( IP_MULTICAST_IF));
+#ifdef IPV6_V6ONLY
+  scm_c_define ("IPV6_V6ONLY", scm_from_int (IPV6_V6ONLY));
   scm_add_feature ("socket");
 #include "socket.x"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]