(self,l1,l2)
| 91 | self.i = iter(self.l) |
| 92 | |
| 93 | def parseHeader(self,l1,l2): |
| 94 | _,_,_,opcode,_,status,_,_id = l1.split() |
| 95 | _,flags,_ = l2.split(';') |
| 96 | header = DNSHeader(id=int(_id),bitmap=0) |
| 97 | header.opcode = getattr(QR,opcode.rstrip(',')) |
| 98 | header.rcode = getattr(RCODE,status.rstrip(',')) |
| 99 | for f in ('qr','aa','tc','rd','ra'): |
| 100 | if f in flags: |
| 101 | setattr(header,f,1) |
| 102 | return header |
| 103 | |
| 104 | def expect(self,expect): |
| 105 | t,val = next(self.i) |