public OfpPortStatus(Stream stream, OfpHeader header = null) { BeBinaryReader br = new BeBinaryReader(stream, Encoding.ASCII, true); Header = header ?? new OfpHeader(stream); br.Parse(out Reason); br.ReadBytes(7); Desc = new OfpPhyPort(stream); }
public OfpSwitchFeatures(Stream stream, OfpHeader header = null) { BeBinaryReader br = new BeBinaryReader(stream, Encoding.ASCII, true); Header = header ?? new OfpHeader(stream); br.Parse(out DatapathId); br.Parse(out NBuffers); br.Parse(out NTables); br.ReadBytes(3); //PAD 3 br.Parse(out Capabilities); br.Parse(out Actions); var portCount = (Header.Length - Size) / OfpPhyPort.Size; for (int i = 0; i < portCount; i++) { OfpPhyPort port = new OfpPhyPort(stream); Ports.Add(port); } }