views:

41

answers:

0

I'm trying to write an interface for communicating with a network protocol, but the IEEE document describes the protocol at the bit level with information split accross a single byte.

What would be the best way to go about handling a C typedef such as

typedef struct {
   Nibble transportSpecific;
   Enumeration4 messageType;
   UInteger4 versionPTP;
   UInteger16 messageLength;
   UInteger8 domainNumber;
   Octet flagField[2];
   Integer64 correctionfield;
   PortIdentity sourcePortIdentity;
   UInteger16 sequenceId;
   UInteger8 controlField;
   Integer8 logMessageInterval;
} MsgHeader;

when porting a compatibility layer to .Net?