(with some restructuring and cleanup by me). https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3226 svn path=/trunk/; revision=30625