path: root/mcon/U/d_iptos.U
diff options
Diffstat (limited to 'mcon/U/d_iptos.U')
1 files changed, 94 insertions, 0 deletions
diff --git a/mcon/U/d_iptos.U b/mcon/U/d_iptos.U
new file mode 100644
index 0000000..ddb6d50
--- /dev/null
+++ b/mcon/U/d_iptos.U
@@ -0,0 +1,94 @@
+?RCS: $Id: d_iptos.U 170 2013-08-30 16:47:47Z rmanfredi $
+?RCS: Copyright (c) 2006, Christian Biere
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?MAKE:d_iptos: cat rm contains cppstdin cppflags cppminus d_windows \
+ i_niin i_sysin i_niip i_syssock i_winsock2 i_ws2tcpip test Setvar
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines the USE_IP_TOS symbol, which
+?S: indicates to the C program that the IP TOS services are available.
+?C: This symbol, if defined, indicates that the IP TOS services are
+?C: available and can be used. Be prepared to include <sys/socket.h>,
+?C: either <netinet/in.h> or <sys/in.h>, and <netinet/ip.h> when
+?C: I_NETINET_IP is defined.
+?H:#$d_iptos USE_IP_TOS /**/
+?F:!iptos !iptos.h
+?LINT:set d_iptos
+?LINT:usefile iptos.h
+: check for IP TOS support
+echo " "
+echo "Checking whether IP TOS (Type of Service) support is available..." >&4
+case "$i_niin" in
+"$define") inh=netinet/in.h;;
+ case "$i_sysin" in
+ "$define") inh=sys/in.h;;
+ *)
+ case "$i_ws2tcpip" in
+ "$define") inh=Ws2tcpip.h;;
+ esac
+ ;;
+ esac
+ ;;
+$cat >iptos <<EOM
+#$i_syssock I_SYS_SOCKET
+#$i_winsock2 I_WINSOCK2
+#$d_windows WINDOWS_SYSTEM
+#define WINVER 0x0501
+#ifdef I_SYS_SOCKET
+#include <sys/socket.h>
+#ifdef I_WINSOCK2
+#include <Winsock2.h>
+#include <$inh>
+#if defined(IP_TOS) && defined(IPTOS_LOWDELAY) && defined(IPTOS_THROUGHPUT)
+$cppstdin $cppflags $cppminus <iptos >iptos.h 2>/dev/null
+if $contains YES iptos.h >/dev/null 2>&1; then
+ val="$define"
+ echo "You have IP TOS support in <$inh>." >&4
+elif $test "x$i_niip" = "x$define"; then
+ $cat >iptos <<EOM
+#$i_syssock I_SYS_SOCKET
+#ifdef I_SYS_SOCKET
+#include <sys/socket.h>
+#include <$inh>
+#include <netinet/ip.h>
+#if defined(IP_TOS) && defined(IPTOS_LOWDELAY) && defined(IPTOS_THROUGHPUT)
+ $cppstdin $cppflags $cppminus <iptos >iptos.h 2>/dev/null
+ if $contains YES iptos.h >/dev/null 2>&1; then
+ val="$define"
+ echo "You have IP TOS support in <netinet/ip.h>." >&4
+ fi
+case "$val" in
+"$define") ;;
+*) echo "Sorry, you seem to be lacking IP TOS support." >&4;;
+set d_iptos
+eval $setvar
+$rm -f iptos iptos.h