old_contents: #!/usr/bin/python
  
  from pytun import TunTapDevice
  
  if __name__ == '__main__':
  	tun = TunTapDevice(name='ipsec-tun')
  	tun.up()
  
  	while True:
  		buf = tun.read(tun.mtu)
  		print buf
  
new_contents: #!/usr/bin/python
  
  from pytun import TunTapDevice
  from binascii import hexlify
  
  
  if __name__ == '__main__':
  	tun = TunTapDevice(name='ipsec-tun')
  	tun.up()
  	tun.persist(True)
  
  	while True:
  		try:
  			buf = tun.read(tun.mtu)
  			print hexlify(buf[4:])
  			IPpayload = buf[4:]
  			# TODO encrypt buf
  			# TODO send to wlan0
  			# TODO enable routing			
  		except KeyboardInterrupt:
  			tun.close()
  
subject: Add TODOs.