News for hackers. Stuff that matters.
Re:How not to design a wire protocol by wmf on Tuesday March 05, 2019 @04:56PM (#19314628)
Magic numbers are better than nothing, but "next protocol" fields accomplish the same thing without magic. Usually the steward of each protocol maintains a registry of protocol IDs. For example, IEEE maintains a list of Ethernet protocols: http://standards-oui.ieee.org/ethertype/eth.txt and IANA tracks IP protocols: https://www.iana.org/assignments/protocol-numbers/protocol-n... and TCP/UDP port numbers: https://www.iana.org/assignments/service-names-port-numbers/... and MIME types are used for HTTP and email: https://www.iana.org/assignments/media-types/media-types.xht...

In classic Mac OS and BeOS, file inodes carried file types so you didn't have to guess about file types either.

There are no comments on this comment yet.