A C++ library for defining and implementing network protocols