The example code at http://www.tcpdump.org/pcap.html is not looking at the Ethernet type, so it works regardless of the byte order of the machine on which it's running. It's relying on the capture filter ("port 23") not to capture non-IPv4 traffic.
You'll have to, for example, use ntohs()
on the ether_type
field when you use its value in your code.