(self, pcapObj)
| 39 | |
| 40 | class DecoderThread(Thread): |
| 41 | def __init__(self, pcapObj): |
| 42 | # Query the type of the link and instantiate a decoder accordingly. |
| 43 | datalink = pcapObj.datalink() |
| 44 | if pcapy.DLT_EN10MB == datalink: |
| 45 | self.decoder = EthDecoder() |
| 46 | elif pcapy.DLT_LINUX_SLL == datalink: |
| 47 | self.decoder = LinuxSLLDecoder() |
| 48 | else: |
| 49 | raise Exception("Datalink type not supported: " % datalink) |
| 50 | |
| 51 | self.pcap = pcapObj |
| 52 | Thread.__init__(self) |
| 53 | |
| 54 | def run(self): |
| 55 | # Sniff ad infinitum. |
nothing calls this directly
no test coverage detected