コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }
        }