(self, pkt, s)
| 286 | self.no_length = "length_from" not in kwargs |
| 287 | |
| 288 | def getfield(self, pkt, s): |
| 289 | if self.no_length: |
| 290 | index = s.find(_BGP_HEADER_MARKER) |
| 291 | if index == 0: |
| 292 | return s, [] |
| 293 | if index != -1: |
| 294 | self.length_from = lambda pkt: index |
| 295 | remain = s[:self.length_from(pkt)] if self.length_from else s |
| 296 | |
| 297 | cls = self.cls_group[ |
| 298 | detect_add_path_prefix46(remain, self.max_bit_length) |
| 299 | ] |
| 300 | self.next_cls_cb = lambda *args: cls |
| 301 | res = super(BGPNLRIPacketListField, self).getfield(pkt, s) |
| 302 | if self.no_length: |
| 303 | self.length_from = None |
| 304 | return res |
| 305 | |
| 306 | |
| 307 | class _BGPInvalidDataException(Exception): |
nothing calls this directly
no test coverage detected