Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Jul 2007 23:56:44 GMT
From:      Matus Harvan <mharvan@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 123241 for review
Message-ID:  <200707092356.l69Nui6D035833@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=123241

Change 123241 by mharvan@mharvan_twoflower on 2007/07/09 23:56:29

	initial version of the ICMP plugin

Affected files ...

.. //depot/projects/soc2007/mharvan-mtund/mtund.src/Makefile#5 edit
.. //depot/projects/soc2007/mharvan-mtund/mtund.src/plugin_icmp.c#1 add
.. //depot/projects/soc2007/mharvan-mtund/mtund.src/tunneld.c#6 edit

Differences ...

==== //depot/projects/soc2007/mharvan-mtund/mtund.src/Makefile#5 (text+ko) ====

@@ -1,12 +1,13 @@
+LIBS+= -levent
+LIBS+=-L/usr/local/lib
 # Linux needs -ldl
-#LIBS+= -ldl
+#LIBS+= -ldl -levent
 
-LIBS=-L/usr/local/lib -levent
 CFLAGS=-Wall -rdynamic
 CFLAGS+=-g
 CFLAGS+=-I/usr/local/include
 
-all: tunneld plugin_tcp.so plugin_udp.so
+all: tunneld plugin_tcp.so plugin_udp.so plugin_icmp.so
 
 tunneld: tunneld.h tunneld.c tun_dev.c
 	gcc $(CFLAGS) $(LIBS) -o tunneld tunneld.c tun_dev.c
@@ -18,8 +19,11 @@
 plugin_udp.so: tunneld.h plugin.h plugin_udp.c
 	gcc $(CFLAGS) -shared  -o plugin_udp.so plugin_udp.c
 
+plugin_icmp.so: tunneld.h plugin.h plugin_icmp.c
+	gcc $(CFLAGS) -shared  -o plugin_icmp.so plugin_icmp.c
+
 clean:
-	rm -f tunneld plugin_tcp.so plugin_udp.so *.core
+	rm -f tunneld plugin_tcp.so plugin_udp.so plugin_icmp.so *.core
 
 backup:
 	rsync -a `pwd` meat:backup/

==== //depot/projects/soc2007/mharvan-mtund/mtund.src/tunneld.c#6 (text+ko) ====

@@ -421,10 +421,10 @@
 	system("ifconfig tun0 mtu 1400 192.168.0.1 192.168.0.2");
     } else {
 	/* FeeBSD */
-	//system("ifconfig tun0 mtu 1400 192.168.0.2 192.168.0.1");
+	system("ifconfig tun0 mtu 1400 192.168.0.2 192.168.0.1");
 	/* Linux */
-	system("ifconfig tun0 mtu 1400 192.168.0.2");
-	system("route add 192.168.0.1 tun0");
+	//system("ifconfig tun0 mtu 1400 192.168.0.2");
+	//system("route add 192.168.0.1 tun0");
     }
 
     signal(SIGHUP, sigcb);
@@ -444,6 +444,8 @@
     plugins->name = "tcp_2222";
     load_plugin("./plugin_tcp.so");
     plugins->name = "tcp_3333";
+    load_plugin("./plugin_icmp.so");
+    plugins->name = "icmp";
 
     if (server) {
 	/* initialize all plugins */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707092356.l69Nui6D035833>