|
@@ -0,0 +1,38 @@
|
|
1
|
+Ether2Any and PyTap
|
|
2
|
+===================
|
|
3
|
+Ether2Any is a python baseclass for writing arbitrary Ethernet/IP tunnel using
|
|
4
|
+a TUN/TAP device.
|
|
5
|
+
|
|
6
|
+PyTap is a python class for handling a TUN/TAP device. It exposes read/write
|
|
7
|
+and abstracts a bit of the network configuration.
|
|
8
|
+
|
|
9
|
+Installation and requirements
|
|
10
|
+=============================
|
|
11
|
+
|
|
12
|
+Just put it somewhere and import it. For PyTaps network configuration
|
|
13
|
+functions you need /sbin/ifconfig.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+How to write an Ethernet/IP tunnel
|
|
17
|
+==================================
|
|
18
|
+Writing a tunnel with this is rather easy. All you have to do create a class
|
|
19
|
+inheriting from Ether2Any and implement the method sendToNet(). sendToNet()
|
|
20
|
+will be called for each incoming network packet. If you add extra sockets
|
|
21
|
+to the select loop via addSocket, sendToDev() needs to be implemented,
|
|
22
|
+which gets the socket on which new data is ready. If you don't want to rely
|
|
23
|
+on select you are free to pass self.dev (which is a PyTap() instance) and
|
|
24
|
+call dev.write() whenever you like. Note that if you write invalid network
|
|
25
|
+packets on it, you might get an exception.
|
|
26
|
+
|
|
27
|
+Afterwards you can instanciate your class and call the run() method to start
|
|
28
|
+your tunnel.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+What could be done
|
|
32
|
+==================
|
|
33
|
+ * At the beginning of each packet there are
|
|
34
|
+ * Builtin packet aggregation would be nice
|
|
35
|
+ * Various FIXMEs/TODOs
|
|
36
|
+ * Replace ifconfig with the ip utility
|
|
37
|
+ * Add plugin architecture to pytap for traffic mangling
|
|
38
|
+ * setuptools/pypi dance
|