Advertisement
i4640

cannon.py

Jun 4th, 2018
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. from pox.lib.packet.ipv4 import ipv4
  2. import re
  3.  
  4. class Cannon(object):
  5.  
  6. def __init__ (self, target_domain_re, url_path_re, iframe_url):
  7. self.target_domain_re = target_domain_re
  8. self.url_path_re = url_path_re
  9. self.iframe_url = iframe_url
  10.  
  11. # Input: an instance of ipv4 class
  12. # Output: an instance of ipv4 class or None
  13. def manipulate_packet (self, ip_packet):
  14. print "src = ", ip_packet.srcip
  15. print "dst = ", ip_packet.dstip
  16.  
  17. # TODO
  18.  
  19. # Must return an ip packet or None
  20. return ip_packet
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement