Add support for more multicast sockopts.
authorTristan Colgate-McFarlane <tcolgate@gmail.com>
Wed, 20 Oct 2010 08:36:32 +0000 (09:36 +0100)
committerAndy Wingo <wingo@pobox.com>
Wed, 20 Oct 2010 21:11:34 +0000 (23:11 +0200)
* libguile/socket.c: Add support for IP_MULTICAST_TTL and IP_MILTICAST_IF sockopts.

libguile/socket.c

index 092f6eb..cc0175a 100644 (file)
@@ -603,6 +603,16 @@ SCM_DEFINE (scm_setsockopt, "setsockopt", 4, 0, 0,
            "are defined (when provided by the system).  See @command{man\n"
            "ip} for what they mean.\n"
            "\n"
+           "@defvar IP_MULTICAST_IF\n"
+            "This sets the source interface used by multicast traffic.\n"
+           "@end defvar\n"
+           "\n"
+           "@defvar IP_MULTICAST_TTL\n"
+            "This sets the default TTL for multicast traffic. This defaults \n"
+            "to 1 and should be increased to allow traffic to pass beyond the\n"
+            "local network.\n"
+           "@end defvar\n"
+           "\n"
            "@defvar IP_ADD_MEMBERSHIP\n"
            "@defvarx IP_DROP_MEMBERSHIP\n"
            "These can be used only with @code{setsockopt}, not\n"
@@ -1765,6 +1775,14 @@ scm_init_socket ()
   scm_c_define ("IP_DROP_MEMBERSHIP", scm_from_int (IP_DROP_MEMBERSHIP));
 #endif
 
+#ifdef IP_MULTICAST_TTL 
+  scm_c_define ("IP_MULTICAST_TTL", scm_from_int ( IP_MULTICAST_TTL));
+#endif
+
+#ifdef IP_MULTICAST_IF 
+  scm_c_define ("IP_MULTICAST_IF", scm_from_int ( IP_MULTICAST_IF));
+#endif
+
   scm_add_feature ("socket");
 
 #include "libguile/socket.x"