Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/process packet command #236

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Arrowgene.Ddon.Cli/Command/PacketCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public CommandResultType Run(CommandParameter parameter)
if (pcapPackets.Count <= 0)
{
Logger.Error("No packets found to annotate");
return CommandResultType.Continue;
return CommandResultType.Exit;
}

ServerType serverType = pcapPackets[0].ServerType;
Expand All @@ -49,7 +49,7 @@ public CommandResultType Run(CommandParameter parameter)
else
{
Logger.Error("could not determinate server type");
return CommandResultType.Continue;
return CommandResultType.Exit;
}

PacketFactory serverFactory = new PacketFactory(new ServerSetting(), packetIdResolver);
Expand Down Expand Up @@ -97,7 +97,7 @@ public CommandResultType Run(CommandParameter parameter)
string outputPath = yamlPath + ".annotated.txt";
File.WriteAllText(outputPath, annotated.ToString());

return CommandResultType.Continue;
return CommandResultType.Exit;
}


Expand All @@ -106,6 +106,7 @@ private List<PcapPacket> ReadYamlPcap(string yaml)
List<PcapPacket> pcapPackets = new List<PcapPacket>();
IDeserializer yamlDeserializer = new DeserializerBuilder()
.WithTagMapping("tag:yaml.org,2002:binary", typeof(string))
.IgnoreUnmatchedProperties()
.Build();
YamlFile yamlFile = yamlDeserializer.Deserialize<YamlFile>(yaml);
if (yamlFile.peers.Count != 2)
Expand Down
2 changes: 1 addition & 1 deletion Arrowgene.Ddon.Shared/Arrowgene.Ddon.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ItemGroup>
<PackageReference Include="Arrowgene.Buffers" Version="1.0.2" />
<PackageReference Include="Arrowgene.Logging" Version="1.2.1" />
<PackageReference Include="YamlDotNet" Version="11.2.1" />
<PackageReference Include="YamlDotNet" Version="13.7.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading