private void PrepareSendDBD(IPAddress destinationAddress, DBDOptions dbdOptions, Boolean sendLsaHeaderData = false) { lock (Lock) { //++ parsers build the header ushort mtu = Interface.OspfNetworkType == OspfNetworkType.VirtualLink ? (ushort)0 : OspfDbdHeader.EthernetAndP2PMtu; var ospfLlsDataBlockTlv = (OspfLlsDataBlockTlv)_controller.GetSingletonHandler("OSPFLLSDATABLOCKTLV").Build(); var ospfLlsDataBlockHeader = (OspfLlsDataBlockHeader)_controller.GetSingletonHandler("OSPFLLSDATABLOCK").Build(); List<OspfLsaHeader> headerList = null; if (sendLsaHeaderData) { headerList = DBSummaryList; } var dbdHeader = (OspfDbdHeader)_controller.GetSingletonHandler("OSPFDBD").Build( Value.Raw("OspfDbdHeader:Mtu", mtu), Value.Raw("OspfDbdHeader:Options", (byte)Interface.Area.GetOptions(supportOBit: true)), Value.Raw("OspfDbdHeader:Flags", (byte)dbdOptions), Value.Raw("OspfDbdHeader:SequenceNumber", DDSequenceNumber)); dbdHeader.LsaList = headerList; _dbdSendList.Add(DDSequenceNumber, new Tuple<IPAddress, OspfDbdHeader, OspfLlsDataBlockHeader, OspfLlsDataBlockTlv>(destinationAddress, dbdHeader, ospfLlsDataBlockHeader, ospfLlsDataBlockTlv)); SendDBDReady(); } }
private DBDOptions GetDBDOptions(bool isFirstRun, bool hasMore) { var options = new DBDOptions(); if (isFirstRun) { options |= DBDOptions.Initial; } if (LocalMSState == MasterSlaveState.Master) { options |= DBDOptions.Master; } if (hasMore) { options |= DBDOptions.More; } return options; }