[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 <ludo@gnu.org>
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));
#endif
+#ifdef IPPROTO_IPV6
+ scm_c_define ("IPPROTO_IPV6", scm_from_int (IPPROTO_IPV6));
+#endif
#ifdef IPPROTO_TCP
scm_c_define ("IPPROTO_TCP", scm_from_int (IPPROTO_TCP));
#endif
@@ -1801,6 +1804,10 @@ scm_init_socket ()
scm_c_define ("IP_MULTICAST_IF", scm_from_int ( IP_MULTICAST_IF));
#endif
+#ifdef IPV6_V6ONLY
+ scm_c_define ("IPV6_V6ONLY", scm_from_int (IPV6_V6ONLY));
+#endif
+
scm_add_feature ("socket");
#include "socket.x"
- [Guile-commits] branch main updated (7e048c6c5 -> 8c976c6a1), Ludovic Courtès, 2022/07/04
- [Guile-commits] 02/06: web: Handle ending CRLF (\r\n) for chunked input and output ports., Ludovic Courtès, 2022/07/04
- [Guile-commits] 04/06: Define IN6ADDR_ANY and IN6ADDR_LOOPBACK., Ludovic Courtès, 2022/07/04
- [Guile-commits] 03/06: web: Don't hide missing data in the chunked input port., Ludovic Courtès, 2022/07/04
- [Guile-commits] 05/06: Define IPPROTO_IPV6 and IPV6_V6ONLY.,
Ludovic Courtès <=
- [Guile-commits] 06/06: Update NEWS., Ludovic Courtès, 2022/07/04
- [Guile-commits] 01/06: web: send capitalized authorization header scheme, Ludovic Courtès, 2022/07/04