raw.py 811 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright (c) Twisted Matrix Laboratories.
  2. # See LICENSE for details.
  3. """
  4. Interface definitions for working with raw packets
  5. """
  6. from zope.interface import Interface
  7. class IRawDatagramProtocol(Interface):
  8. """
  9. An interface for protocols such as UDP, ICMP and TCP.
  10. """
  11. def addProto():
  12. """
  13. Add a protocol on top of this one.
  14. """
  15. def datagramReceived():
  16. """
  17. An IP datagram has been received. Parse and process it.
  18. """
  19. class IRawPacketProtocol(Interface):
  20. """
  21. An interface for low-level protocols such as IP and ARP.
  22. """
  23. def addProto():
  24. """
  25. Add a protocol on top of this one.
  26. """
  27. def datagramReceived():
  28. """
  29. An IP datagram has been received. Parse and process it.
  30. """