Fingerprints the MTU based on the maximum segment size specified in TCP options. If a match was found, returns the label. If not returns None
(pkt)
| 675 | |
| 676 | |
| 677 | def fingerprint_mtu(pkt): |
| 678 | """ |
| 679 | Fingerprints the MTU based on the maximum segment size specified |
| 680 | in TCP options. |
| 681 | If a match was found, returns the label. If not returns None |
| 682 | """ |
| 683 | pkt = validate_packet(pkt) |
| 684 | mss = 0 |
| 685 | for name, value in pkt.payload.options: |
| 686 | if name == "MSS": |
| 687 | mss = value |
| 688 | |
| 689 | if not mss: |
| 690 | return None |
| 691 | |
| 692 | mtu = (mss + MIN_TCP4) if pkt.version == 4 else (mss + MIN_TCP6) |
| 693 | |
| 694 | if not p0fdb.get_base(): |
| 695 | warning("p0f base empty.") |
| 696 | return None |
| 697 | |
| 698 | return p0fdb.mtu_find_match(mtu) |
| 699 | |
| 700 | |
| 701 | def p0f(pkt): |
nothing calls this directly
no test coverage detected