Multiple Level Protocol

I am developing a protocol dissector of a custom protocol that could be at the link, network, or transport level depending on the executable that is calling the Ethernet code. How do I build a protocol dissector that can be used for the same protocol on all of these different levels. Additionally I’d like for my dissector to support multiple version of the protocol and be backward compatible.