Observing X11 protocol differences
I was trying to understand some oddities going with an X11 legacy application showing bad artifacts in one environment and working flawlessly in another environment. Since wireshark does not have any support for diffing two pcaps, I came up with the following steps:
- Dump both
working.pcap
andnonworking.pcap
into text files with full headers:
~/Devel/wireshark/tshark -r working.pcap -T text -V -Y "x11" > working.txt ~/Devel/wireshark/tshark -r notworking.pcap -T text -V -Y "x11" > notworking.txt
- Prune the two text files with a script like the following:
def clean(source, dest): f = open(source, "r") x11_state = False output = [] for line in f.readlines(): if x11_state: if line.startswith(' '): output.append(line) else: x11_state = False else: if line.startswith('X11') and \ "Property" in line: output.append(line) x11_state = True else: continue o = open(dest, "w") for i in output: o.write(i) if __name__ == '__main__': clean("working.txt", "working-trimmed.txt") clean("notworking.txt", "notworking-trimmed.txt")