Index: configure.ac
===================================================================
--- configure.ac	(revision 7559)
+++ configure.ac	(working copy)
@@ -125,7 +125,7 @@
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(fcntl.h limits.h strings.h time.h sys/ioctl.h sys/time.h unistd.h)
-AC_CHECK_HEADERS(linux/ppdev.h dev/ppbus/ppi.h sys/mman.h sys/select.h sys/types.h)
+AC_CHECK_HEADERS(linux/if_tun.h linux/ppdev.h dev/ppbus/ppi.h sys/mman.h sys/select.h sys/types.h)
 AC_CHECK_HEADERS(sys/resource.h stdint.h sched.h signal.h sys/syscall.h)
 AC_CHECK_HEADERS(netinet/in.h)
 AC_CHECK_HEADERS(windows.h)
Index: gnuradio-examples/python/digital/tunnel.py
===================================================================
--- gnuradio-examples/python/digital/tunnel.py	(revision 7559)
+++ gnuradio-examples/python/digital/tunnel.py	(working copy)
@@ -74,7 +74,8 @@
     from fcntl import ioctl
     
     mode = IFF_TAP | IFF_NO_PI
-    TUNSETIFF = 0x400454ca
+    # grabs TUNSETIFF from <linux/tun_if.h> via a getter
+    TUNSETIFF = gr.get_TUNSETIFF()
 
     tun = os.open(tun_device_filename, os.O_RDWR)
     ifs = ioctl(tun, TUNSETIFF, struct.pack("16sH", "gr%d", mode))
Index: gnuradio-core/src/lib/general/Makefile.am
===================================================================
--- gnuradio-core/src/lib/general/Makefile.am	(revision 7559)
+++ gnuradio-core/src/lib/general/Makefile.am	(working copy)
@@ -224,6 +224,7 @@
 	gr_glfsr_source_b.h		\
 	gr_glfsr_source_f.h		\
 	gr_head.h			\
+	gr_if_tun_utils.h \
 	gr_interleave.h			\
 	gr_interleaved_short_to_complex.h \
 	gr_keep_one_in_n.h		\
@@ -374,6 +375,7 @@
 	gr_glfsr_source_b.i		\
 	gr_glfsr_source_f.i		\
 	gr_head.i			\
+	gr_if_tun_utils.i			\
 	gr_interleave.i 		\
 	gr_interleaved_short_to_complex.i \
 	gr_keep_one_in_n.i		\
Index: gnuradio-core/src/lib/general/general.i
===================================================================
--- gnuradio-core/src/lib/general/general.i	(revision 7559)
+++ gnuradio-core/src/lib/general/general.i	(working copy)
@@ -77,6 +77,7 @@
 #include <gr_conjugate_cc.h>
 #include <gr_vco_f.h>
 #include <gr_crc32.h>
+#include <gr_if_tun_utils.h>
 #include <gr_threshold_ff.h>
 #include <gr_clock_recovery_mm_ff.h>
 #include <gr_clock_recovery_mm_cc.h>
@@ -186,6 +187,7 @@
 %include "gr_conjugate_cc.i"
 %include "gr_vco_f.i"
 %include "gr_crc32.i"
+%include "gr_if_tun_utils.i"
 %include "gr_threshold_ff.i"
 %include "gr_clock_recovery_mm_ff.i"
 %include "gr_clock_recovery_mm_cc.i"
Index: gnuradio-core/src/lib/general/gr_if_tun_utils.h
===================================================================
--- gnuradio-core/src/lib/general/gr_if_tun_utils.h	(revision 0)
+++ gnuradio-core/src/lib/general/gr_if_tun_utils.h	(revision 0)
@@ -0,0 +1,54 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_GR_IF_TUN_UTILS_H
+#define INCLUDED_GR_IF_TUN_UTILS_H
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#ifdef HAVE_LINUX_IF_TUN_H
+#include <linux/if_tun.h>
+#endif
+#include<stdio.h>
+/*!
+ * \brief hack to get some values from if_tun.h
+ * \ingroup misc
+ *
+ * See discussion in mailing list circa Feb 2008
+ * 
+ * 
+ */
+unsigned int 
+gr_get_TUNSETIFF() {
+#ifdef TUNSETIFF
+ return(TUNSETIFF);
+#else
+ perror("TUNSETIFF not defined, is if_tun.h available?");
+ exit(1);
+#endif
+};
+
+
+#endif /* INCLUDED_IF_TUN_UTILS_H*/
Index: gnuradio-core/src/lib/general/gr_if_tun_utils.i
===================================================================
--- gnuradio-core/src/lib/general/gr_if_tun_utils.i	(revision 0)
+++ gnuradio-core/src/lib/general/gr_if_tun_utils.i	(revision 0)
@@ -0,0 +1,25 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005 Free Software Foundation, Inc.
+ * 
+ * This file is part of GNU Radio
+ * 
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ * 
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+%rename(get_TUNSETIFF) gr_get_TUNSETIFF;
+unsigned int gr_get_TUNSETIFF();
