My changes

This commit is contained in:
Tim Young 2015-11-19 14:14:50 -05:00
parent 2df0409bb4
commit 5dd3bf8e81
2 changed files with 40 additions and 16 deletions

View File

@ -106,7 +106,7 @@ namespace EduNetworkBuilder
health = copyfrom.health;
StartTime = copyfrom.StartTime;
OriginalDestIP = copyfrom.OriginalDestIP;
Tracking.AddMessage(DebugLevel.debug, WhereAmI, "Packet duplicated");
Tracking.AddMessage(DebugLevel.debug, WhereAmI, NB.Translate("P_PacketDuplicated"));
}
//Generate a packet with the given payload.
@ -121,7 +121,7 @@ namespace EduNetworkBuilder
sourceMAC = source;
destMAC = dest;
OutboundDestMAC = dest;
Tracking.AddMessage(DebugLevel.info, start, theType.ToString() + string.Format("Packet Created"));
Tracking.AddMessage(DebugLevel.info, start, theType.ToString() + string.Format(NB.Translate("Packet Created")));
Tracking.AddMessage(DebugLevel.routing, start, string.Format(" MAC: {0} -> {1}", source, dest));
}
else
@ -134,9 +134,9 @@ namespace EduNetworkBuilder
destMAC = NB.BroadcastMACString;
OutboundDestMAC = destMAC;
}
Tracking.AddMessage(DebugLevel.info, start, "Packet Created");
Tracking.AddMessage(DebugLevel.info, start, NB.Translate("Packet Created"));
Tracking.AddMessage(DebugLevel.routing, start, string.Format(" IP: {0} -> {1}", source, dest));
Tracking.AddMessage(DebugLevel.debug, start, string.Format(" IPs Translated {0} -> {1}",sourceIP.GetIP.ToIpString(), destIP.GetIP.ToIpString()));
Tracking.AddMessage(DebugLevel.debug, start, string.Format(NB.Translate(" IPs Translated {0} -> {1}"),sourceIP.GetIP.ToIpString(), destIP.GetIP.ToIpString()));
}
isFresh = true;
}
@ -153,7 +153,7 @@ namespace EduNetworkBuilder
destIP = dest;
if (destIP != null && destIP.BroadcastAddress == destIP.GetIP)
destMAC = NB.BroadcastMACString;
Tracking.AddMessage(DebugLevel.info, start, "Packet Created");
Tracking.AddMessage(DebugLevel.info, start, NB.Translate("Packet Created"));
Tracking.AddMessage(DebugLevel.routing, start, string.Format(" IP:{0} -> {1}", sourceIP.GetIP.ToIpString(), dest.GetIP.ToIpString()));
}
else
@ -161,7 +161,7 @@ namespace EduNetworkBuilder
sourceIP = new IPAddress(NB.ZeroIPString);
destMAC = NB.BroadcastMACString;
destIP = dest;
Tracking.AddMessage(DebugLevel.info, start, "Packet Created");
Tracking.AddMessage(DebugLevel.info, start, NB.Translate("Packet Created"));
//Tracking.AddMessage(DebugLevel.routing, start, " IP:" + sourceIP.GetIP.ToIpString() + " -> " + dest.GetIP.ToIpString());
}
isFresh = true;
@ -261,8 +261,8 @@ namespace EduNetworkBuilder
if(MyNet.CountPackets(PacketType.arp_answer) + MyNet.CountPackets(PacketType.arp_request) == 0)
{
//No more arps going. We do not have an answer!
Tracking.AddMessage(DebugLevel.info, WhereAmI, string.Format("Unable to find a mac address for the IP address: {0}", dest.GetIP.ToIpString()));
Tracking.Status = string.Format("{0} Failed: Unable to find a MAC address for the specified IP.", WhereAmI.hostname );
Tracking.AddMessage(DebugLevel.info, WhereAmI, NB.Translate("P_ProcessTick") + ": "+ dest.GetIP.ToIpString());
Tracking.Status = WhereAmI.hostname + NB.Translate("P_ProcessTick");
MyStatus = PacketStatus.finished_failed;
}
return;
@ -277,8 +277,8 @@ namespace EduNetworkBuilder
//We pass it to the device
if (WhereAmI == null)
{
AddMessage(DebugLevel.debug, "The packet was dropped because we lost where it was. WhereAmI == null!");
Tracking.Status = "NO_Host Lost location of packet..";
AddMessage(DebugLevel.debug, NB.Translate("P_PacketLostLong"));
Tracking.Status = NB.Translate("P_PacketLostShort");
MyStatus = PacketStatus.finished_failed;
return; //We cannot process the packet
}
@ -297,8 +297,8 @@ namespace EduNetworkBuilder
//So, we pass the packet to the device to process
if (WhereAmI == null)
{
AddMessage(DebugLevel.debug, "The packet was dropped because we lost where it was. WhereAmI == null!");
Tracking.Status = "NO_Host Lost location of packet..";
AddMessage(DebugLevel.debug, NB.Translate("P_PacketLostLong"));
Tracking.Status = NB.Translate("P_PacketLostShort");
MyStatus = PacketStatus.finished_failed;
return; //We cannot process the packet
}
@ -309,8 +309,8 @@ namespace EduNetworkBuilder
{
if (WhereAmI == null)
{
AddMessage(DebugLevel.debug, "The packet was dropped because we lost where it was. WhereAmI == null!");
Tracking.Status = "NO_Host Lost location of packet..";
AddMessage(DebugLevel.debug, NB.Translate("P_PacketLostLong"));
Tracking.Status = NB.Translate("P_PacketLostShort");
MyStatus = PacketStatus.finished_failed;
return; //We cannot process the packet
}
@ -340,8 +340,8 @@ namespace EduNetworkBuilder
myDirection = nb_direction.to_dst;
else
myDirection = nb_direction.to_src;
Console.WriteLine(string.Format("Starting on link. SMAC: {0} DMAC: {1}",sourceMAC,destMAC));
AddMessage(DebugLevel.debug, " Starting on link");
Console.WriteLine(NB.Translate("Starting on link.") + string.Format(" SMAC: {0} DMAC: {1}",sourceMAC,destMAC));
AddMessage(DebugLevel.debug, " " + "Starting on link");
}
public void StartOnDevice(NetworkDevice theDevice)

View File

@ -1525,6 +1525,30 @@
<value>unknown</value>
<comment>PacketMessage PM_UnknownHost = unknown</comment>
</data>
<data name="P_IPsTranslated" xml:space="preserve">
<value>IPs Translated {0} -&gt; {1}</value>
<comment>Packet IPsTranslated = IPs Translated {0} -&gt; {1}</comment>
</data>
<data name="P_PacketCreated" xml:space="preserve">
<value>Packet Created</value>
<comment>Packet P_PacketCreated = Packet Created</comment>
</data>
<data name="P_PacketDuplicated" xml:space="preserve">
<value>Packet duplicated</value>
<comment>Packet P_PacketDuplicated = Packet duplicated</comment>
</data>
<data name="P_PacketLostLong" xml:space="preserve">
<value>The packet was dropped because we lost where it was. WhereAmI == null!</value>
<comment>P_PacketLostLong = The packet was dropped because we lost where it was. WhereAmI == null!</comment>
</data>
<data name="P_PacketLostShort" xml:space="preserve">
<value>NO_Host Lost location of packet..</value>
<comment>P_PacketLostShort = NO_Host Lost location of packet..</comment>
</data>
<data name="P_ProcessTick" xml:space="preserve">
<value>Unable to find a MAC address for the IP address</value>
<comment>P_ProcessTick = Unable to find a MAC address for the IP address</comment>
</data>
<data name="RTFW_NotFound" xml:space="preserve">
<value>Not found.</value>
<comment>RTFW_NotFound = Not found.</comment>