Forked from http://www.wireshark.org/lists/wireshark-users/201007/msg00258.html