{ "name": "tshark", "version": "4.6.9", "summary": "Wireshark without its graphical program: tshark, dumpcap, editcap, mergecap, capinfos, text2pcap and the dissector libraries", "category": "network", "license": "GPL-2.0-or-later", "homepage": "https://www.wireshark.org/", "source": { "url": "https://www.wireshark.org/download/src/all-versions/wireshark-4.6.9.tar.xz", "sha256": "d062d416a1ab3a49975aafe3a671c882dde0562ccd71b078808ceb59d465fc0f" }, "watch": {"kind": "index", "url": "https://www.wireshark.org/download/src/all-versions/", "regex": "wireshark-([0-9]+\\.[0-9]*[02468]\\.[0-9]+)\\.tar\\.xz", "pin": "4.6"}, "deps": [ "glib", "libgcrypt", "c-ares", "libpcap", "pcre2", "zlib", "lz4", "zstd", "brotli", "nghttp2", "gnutls", "libxml2", "libmaxminddb", "xxhash" ], "env_packages": [], "static": false, "nss": true, "check": "t=$(mktemp -d) && bin/tshark -v 2> /dev/null | first | has '^TShark (Wireshark) 4\\.6\\.9' && printf '%s\\n' 'import struct, sys' 'q = struct.pack(\">HHHHHH\", 0x4242, 0x0100, 1, 0, 0, 0) + b\"\\x03bvs\\x07example\\x00\" + struct.pack(\">HH\", 1, 1)' 'udp = struct.pack(\">HHHH\", 40000, 53, 8 + len(q), 0) + q' 'ip = struct.pack(\">BBHHHBBH4s4s\", 0x45, 0, 20 + len(udp), 1, 0, 64, 17, 0, bytes([192, 0, 2, 1]), bytes([192, 0, 2, 53]))' 's = sum(struct.unpack(\">10H\", ip))' 's = (s & 0xffff) + (s >> 16)' 'ip = ip[:10] + struct.pack(\">H\", ~s & 0xffff) + ip[12:]' 'eth = b\"\\x02\\x00\\x00\\x00\\x00\\x02\" + b\"\\x02\\x00\\x00\\x00\\x00\\x01\" + b\"\\x08\\x00\" + ip + udp' 'open(sys.argv[1], \"wb\").write(struct.pack(\" \"$t/p.py\" && python3 \"$t/p.py\" \"$t/q.pcap\" && bin/tshark -r \"$t/q.pcap\" -T fields -e ip.dst -e udp.dstport -e dns.qry.name -e dns.qry.type 2> /dev/null > \"$t/f\" && has -x \"$(printf '192.0.2.53\\t53\\tbvs.example\\t1')\" < \"$t/f\" && bin/tshark -r \"$t/q.pcap\" -Y 'dns.qry.name matches \"^bvs\\\\.\" && udp.srcport == 40000' -T fields -e frame.number 2> /dev/null | has -x 1 && gzip -c \"$t/q.pcap\" > \"$t/q.pcap.gz\" && bin/tshark -r \"$t/q.pcap.gz\" -T fields -e dns.qry.name 2> /dev/null | has -x bvs.example && bin/mergecap -w \"$t/m.pcapng\" \"$t/q.pcap\" \"$t/q.pcap\" && bin/capinfos -c \"$t/m.pcapng\" | has -E 'Number of packets: +2$' && bin/editcap -r \"$t/m.pcapng\" \"$t/e.pcap\" 2 && bin/capinfos -c \"$t/e.pcap\" | has -E 'Number of packets: +1$' && echo 'tshark 4.6.9: a DNS query in a pcap file (made by python3) dissected to its address, port, name and type, found by a display filter with a PCRE2 match, read again gzipped; mergecap, editcap and capinfos count its packets'; r=$?; rm -rf -- \"${t:?}\"; exit $r" }