コード例 #1
0
 private static void GenerateRandomLinkValues(LSLink link)
 {
     link.IGPMetric              = GenerateRandomIGPMetric();
     link.unidir_available_bw    = GenerateRandomValue();
     link.unidir_bw_utilization  = GenerateRandomValue();
     link.unidir_delay_variation = GenerateRandomValue();
     link.unidir_link_delay      = GenerateRandomValue();
     link.unidir_packet_loss     = GenerateRandomValue();
     link.unidir_residual_bw     = GenerateRandomValue();
 }
コード例 #2
0
        private static void CreateLink(int from, int to, int fromIp, int toIp)
        {
            LSLink link = new LSLink();

            link._id             = idCounter.ToString();
            link._key            = idCounter.ToString();
            link._from           = CollectionOfNodeName + from + "." + from + "." + from + "." + from;
            link._to             = CollectionOfNodeName + to + "." + to + "." + to + "." + to;
            link.LocalRouterID   = from + "." + from + "." + from + "." + from;
            link.RemoteRouterID  = to + "." + to + "." + to + "." + to;
            link.FromInterfaceIP = fromIp.ToString();
            link.ToInterfaceIP   = toIp.ToString();
            link.Protocol        = "IS-IS Level 2";
            link.ASN             = 64075;
            link.TEMetric        = 1;
            link.MaxLinkBW       = 1290693416;
            GenerateRandomLinkValues(link);
            idCounter++;
            linkList.Add(link);
        }