Beispiel #1
0
 /// <summary>
 /// Adds the route entry.
 /// </summary>
 /// <param name="destination">The destination.</param>
 /// <param name="nextHop">The next hop.</param>
 /// <param name="metric">The metric.</param>
 /// <param name="sequenceNr">The sequence nr.</param>
 public void AddRouteEntry(string destination, string nextHop, int metric, DsdvSequence sequenceNr)
 {
     this.Entries.Add(
         new DsdvTableEntry()
     {
         Destination = destination,
         NextHop     = nextHop,
         Metric      = metric,
         SequenceNr  = sequenceNr,
     });
 }
Beispiel #2
0
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        public override void Initialize()
        {
            // call base initialization (stepcounter and data)
            base.Initialize();

            // set intial broadcast to false
            this.isInitialBroadcastSend = false;

            // initial offline links stroage
            this.offlineLinks = new List <string>();

            // create table
            this.Table = new DsdvTable();

            // cast to right type
            var localTableRef = (DsdvTable)this.Table;

            // create current (initial) sequence nr (ID-000)
            this.CurrentSequence = new DsdvSequence(this.Client.Id, 0);

            // self routing entry with metric 0 and initial sequence nr
            localTableRef.AddRouteEntry(this.Client.Id, this.Client.Id, 0, this.CurrentSequence);
        }