/// <summary> /// Creates a new instance of this class /// </summary> public IPTypeOfService() { this.iPrecedence = IPPrecedence.Routine; this.iDelay = IPDelay.Normal; this.iThroughput = IPThroughput.Normal; this.iReliability = IPReliability.Normal; }
/// <summary> /// Creates a new instance of this class from the given data /// </summary> /// <param name="bRaw">The data to parse</param> public IPTypeOfService(byte bRaw) { this.iPrecedence = (IPPrecedence)((bRaw & 0xE0) >> 5); // 11100000 ==> Shift 5 ==> 111 this.iDelay = (IPDelay)((bRaw & 0x10) >> 4); // 0010000 ==> Shift 4 ==> 1 this.iThroughput = (IPThroughput)((bRaw & 0x8) >> 3); // 00001000 ==> Shift 3 ==> 1 this.iReliability = (IPReliability)((bRaw & 0x4) >> 2); // 00000100 ==> Shift 2 ==> 1 }