Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

raw.py 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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(num, proto):
  12. """
  13. Add a protocol on top of this one.
  14. """
  15. def datagramReceived(
  16. data,
  17. partial,
  18. source,
  19. dest,
  20. protocol,
  21. version,
  22. ihl,
  23. tos,
  24. tot_len,
  25. fragment_id,
  26. fragment_offset,
  27. dont_fragment,
  28. more_fragments,
  29. ttl,
  30. ):
  31. """
  32. An IP datagram has been received. Parse and process it.
  33. """
  34. class IRawPacketProtocol(Interface):
  35. """
  36. An interface for low-level protocols such as IP and ARP.
  37. """
  38. def addProto(num, proto):
  39. """
  40. Add a protocol on top of this one.
  41. """
  42. def datagramReceived(data, partial, dest, source, protocol):
  43. """
  44. An IP datagram has been received. Parse and process it.
  45. """