(self, pcapObj)
| 70 | |
| 71 | class Decoder: |
| 72 | def __init__(self, pcapObj): |
| 73 | # Query the type of the link and instantiate a decoder accordingly. |
| 74 | datalink = pcapObj.datalink() |
| 75 | if pcapy.DLT_EN10MB == datalink: |
| 76 | self.decoder = EthDecoder() |
| 77 | elif pcapy.DLT_LINUX_SLL == datalink: |
| 78 | self.decoder = LinuxSLLDecoder() |
| 79 | else: |
| 80 | raise Exception("Datalink type not supported: " % datalink) |
| 81 | |
| 82 | self.pcap = pcapObj |
| 83 | self.connections = {} |
| 84 | |
| 85 | def start(self): |
| 86 | # Sniff ad infinitum. |
nothing calls this directly
no test coverage detected