This commit is contained in:
Peter Wilson 2015-11-19 14:50:37 -06:00
commit 85e063cb3a
5 changed files with 36 additions and 25 deletions

View File

@ -1982,15 +1982,15 @@ namespace EduNetworkBuilder
{
if (tPacket.MyType == PacketType.dhcp_answer)
{
tPacket.AddMessage(DebugLevel.info, hostname + string.Format(NB.Translate("ND_PrepPackGtewyErr")) + " " + tPacket.OutboundIP.GetIP.ToIpString());
tPacket.Tracking.Status = hostname + string.Format(NB.Translate("ND_PrepPackGtewyErr"));
tPacket.AddMessage(DebugLevel.info, hostname + " " + string.Format(NB.Translate("ND_PrepPackGtewyErr")) + " " + tPacket.OutboundIP.GetIP.ToIpString());
tPacket.Tracking.Status = hostname + " " + string.Format(NB.Translate("ND_PrepPackGtewyErr"));
tPacket.MyStatus = PacketStatus.finished_failed;
return false;
}
else
{
tPacket.AddMessage(DebugLevel.info, hostname + string.Format(NB.Translate("ND_PrepPackRoutErr")) +" "+ tPacket.OutboundIP.GetIP.ToIpString());
tPacket.Tracking.Status = hostname + NB.Translate("ND_PrepPackRoutErr");
tPacket.AddMessage(DebugLevel.info, hostname + " " + string.Format(NB.Translate("ND_PrepPackRoutErr")) +" "+ tPacket.OutboundIP.GetIP.ToIpString());
tPacket.Tracking.Status = hostname + " " + NB.Translate("ND_PrepPackRoutErr");
tPacket.MyStatus = PacketStatus.finished_failed;
return false;
}
@ -2003,8 +2003,8 @@ namespace EduNetworkBuilder
tPacket.OutboundNic = LocalNic(tPacket.OutboundIP);
if (tPacket.OutboundNic == null)
{
tPacket.AddMessage(DebugLevel.info, hostname + string.Format(NB.Translate("ND_PrepPackNICErr")) + " :"+ tPacket.OutboundIP.GetIP.ToIpString());
tPacket.Tracking.Status = hostname + NB.Translate("ND_PrepPackNICErr");
tPacket.AddMessage(DebugLevel.info, hostname + " " + string.Format(NB.Translate("ND_PrepPackNICErr")) + " :"+ tPacket.OutboundIP.GetIP.ToIpString());
tPacket.Tracking.Status = hostname + " " + NB.Translate("ND_PrepPackNICErr");
tPacket.MyStatus = PacketStatus.finished_failed;
return false;
}
@ -2015,8 +2015,8 @@ namespace EduNetworkBuilder
tPacket.OutboundIF = tPacket.OutboundNic.LocalInterface(tPacket.OutboundIP, tPacket.Tracking);
if (tPacket.OutboundIF == null)
{
tPacket.AddMessage(DebugLevel.info, hostname + string.Format(NB.Translate("ND_PrepPackRoutErr")) + " :" + tPacket.OutboundIP.GetIP.ToIpString());
tPacket.Tracking.Status = hostname + NB.Translate("ND_PrepPackRoutErr");
tPacket.AddMessage(DebugLevel.info, hostname + " " + string.Format(NB.Translate("ND_PrepPackRoutErr")) + " :" + tPacket.OutboundIP.GetIP.ToIpString());
tPacket.Tracking.Status = hostname + " " + NB.Translate("ND_PrepPackRoutErr");
tPacket.MyStatus = PacketStatus.finished_failed;
return false;
}
@ -2193,7 +2193,7 @@ namespace EduNetworkBuilder
if(nc == null)
{
tPacket.AddMessage(DebugLevel.info, NB.Translate("ND_DoInputFromLink_CardFail1"));
tPacket.Tracking.Status = hostname + string.Format(NB.Translate("ND_DoInputFromLink_CardFail2"));
tPacket.Tracking.Status = hostname + " " + string.Format(NB.Translate("ND_DoInputFromLink_CardFail2"));
tPacket.MyStatus = PacketStatus.finished_failed;
return;
}
@ -2232,16 +2232,16 @@ namespace EduNetworkBuilder
{
if (tPacket.MyType == PacketType.dhcp_request && !isDHCPServer)
{
tPacket.AddMessage(DebugLevel.debug, hostname + string.Format(NB.Translate("ND_DoInFromLnkDeaf")));
tPacket.Tracking.Status = hostname + string.Format(NB.Translate("ND_DoInFromLnkNoDHCP"));
tPacket.AddMessage(DebugLevel.debug, hostname + " " +string.Format(NB.Translate("ND_DoInFromLnkDeaf")));
tPacket.Tracking.Status = hostname +" " + string.Format(NB.Translate("ND_DoInFromLnkNoDHCP"));
tPacket.MyStatus = PacketStatus.finished_failed;
return;
}
if ((tPacket.MyType == PacketType.ping_answer || tPacket.MyType== PacketType.ping_request) &&
!RoutesPackets() && (!HasIPAddress(tPacket.destIP) && !HasBroadcastAddress(tPacket.destIP)))
{
tPacket.AddMessage(DebugLevel.debug, hostname + string.Format(NB.Translate("ND_NotRouter")));
tPacket.Tracking.Status = hostname + string.Format(NB.Translate("ND_NotRouter2"));
tPacket.AddMessage(DebugLevel.debug, hostname + " " +string.Format(NB.Translate("ND_NotRouter")));
tPacket.Tracking.Status = hostname + " " + string.Format(NB.Translate("ND_NotRouter2"));
tPacket.MyStatus = PacketStatus.finished_failed;
return;
}
@ -2251,7 +2251,7 @@ namespace EduNetworkBuilder
myType != NetworkComponentType.wrouter)
{
tPacket.AddMessage(DebugLevel.debug, hostname + string.Format(NB.Translate("ND_NoLocIP")));
tPacket.Tracking.Status = hostname + string.Format(NB.Translate("ND_NoLocIP2"));
tPacket.Tracking.Status = hostname + " " + string.Format(NB.Translate("ND_NoLocIP2"));
tPacket.MyStatus = PacketStatus.finished_failed;
return;
}

View File

@ -340,8 +340,8 @@ namespace EduNetworkBuilder
myDirection = nb_direction.to_dst;
else
myDirection = nb_direction.to_src;
Console.WriteLine(NB.Translate("Starting on link.") + string.Format(" SMAC: {0} DMAC: {1}",sourceMAC,destMAC));
AddMessage(DebugLevel.debug, " " + "Starting on link");
Console.WriteLine(NB.Translate("P_StartingOnLink") + string.Format(" SMAC: {0} DMAC: {1}",sourceMAC,destMAC));
AddMessage(DebugLevel.debug, " " + NB.Translate("P_StartingOnLink"));
}
public void StartOnDevice(NetworkDevice theDevice)
@ -366,9 +366,9 @@ namespace EduNetworkBuilder
}
if(MyType == PacketType.arp_request && MyStatus == PacketStatus.finished_failed)
{
Tracking.AddMessage(DebugLevel.info, "Packet",
string.Format("Packet failed to reach any IP. No such IP on network: {0}", destIP.GetIPString));
Tracking.Status = string.Format("Packet failed to reach IP: {0}",destIP.GetIPString);
Tracking.AddMessage(DebugLevel.info, NB.Translate("P_Packet"),
NB.Translate("P_PacketFailedToReach") + ": " + destIP.GetIPString);
Tracking.Status = NB.Translate("P_PacketFailedToReach2") + ": "+ destIP.GetIPString;
MyStatus = PacketStatus.finished_failed;
}
if (MyStatus != PacketStatus.finished)
@ -448,7 +448,7 @@ namespace EduNetworkBuilder
{
if (!typeof(T).IsSerializable)
{
throw new ArgumentException("The type must be serializable.", "source");
throw new ArgumentException(NB.Translate("NC_CloneSerialzable"), NB.Translate("NC_source"));
}
// Don't serialize a null object, simply return the default for that object

View File

@ -1505,4 +1505,20 @@
<value>Not found.</value>
<comment>RTFW_NotFound = Not found.</comment>
</data>
<data name="P_Packet" xml:space="preserve">
<value>Packet</value>
<comment>P_Packet = Packet</comment>
</data>
<data name="P_PacketFailedToReach" xml:space="preserve">
<value>Packet failed to reach any IP. No such IP on network</value>
<comment>P_PacketFailedToReach = Packet failed to reach any IP. No such IP on network</comment>
</data>
<data name="P_PacketFailedToReach2" xml:space="preserve">
<value>Packet failed to reach IP</value>
<comment>P_PacketFailedToReach2 = Packet failed to reach IP</comment>
</data>
<data name="P_StartingOnLink" xml:space="preserve">
<value>Starting on link.</value>
<comment>P_StartingOnLink = Starting on link.</comment>
</data>
</root>

View File

@ -63,16 +63,11 @@ Packet.cs:32: PacketDump(" " + status, DebugPausePoint.packet
Packet.cs:125: Tracking.AddMessage(DebugLevel.routing, start, string.Format(" MAC: {0} -> {1}", source, dest));
Packet.cs:138: Tracking.AddMessage(DebugLevel.routing, start, string.Format(" IP: {0} -> {1}", source, dest));
Packet.cs:157: Tracking.AddMessage(DebugLevel.routing, start, string.Format(" IP:{0} -> {1}", sourceIP.GetIP.ToIpString(), dest.GetIP.ToIpString()));
Packet.cs:344: AddMessage(DebugLevel.debug, " " + "Starting on link");
Packet.cs:369: Tracking.AddMessage(DebugLevel.info, "Packet",
Packet.cs:370: string.Format("Packet failed to reach any IP. No such IP on network: {0}", destIP.GetIPString));
Packet.cs:371: Tracking.Status = string.Format("Packet failed to reach IP: {0}",destIP.GetIPString);
Packet.cs:435: Console.WriteLine("Pausing");
Packet.cs:439: Console.WriteLine(string.Format("{0}: {1} PACKET: dstIP: {2} destMAC: {3}", hostname, position, dIP, destMAC));
Packet.cs:440: Console.WriteLine(string.Format("{0}: {1} PACKET: srcIP: {2} srcMAC: {3}", hostname, position, sIP, sourceMAC));
Packet.cs:441: Console.WriteLine("---");
Packet.cs:443: AddMessage(DebugLevel.packet, string.Format("{0}: {1} PACKET: dstIP: {2} destMAC: {3}", hostname, position, dIP, destMAC));
Packet.cs:444: AddMessage(DebugLevel.packet, string.Format("{0}: {1} PACKET: srcIP: {2} srcMAC: {3}", hostname,position,sIP,sourceMAC));
Packet.cs:451: throw new ArgumentException("The type must be serializable.", "source");
PacketMessage.cs:91: tString = tmessage.HostName + " \t" + tmessage.WhatLevel.ToString() + "\t" + tmessage.Message;
PacketMessage.cs:103: tString = time.ToString() + " ms " + Status;