Commit 6a6c0fc5 authored by Brickner_cp's avatar Brickner_cp

--no commit message

--no commit message
parent 3360a520
#include "BpfFilter.h" #include "BpfFilter.h"
#include "Pcap.h"
#include <stdio.h>
#include <pcap.h>
#include "MarshalingServices.h" #include "MarshalingServices.h"
using namespace System; using namespace System;
......
#pragma once #pragma once
#include "PcapTypedefs.h"
#include "PcapAddress.h" #include "PcapAddress.h"
#include "PcapDeclarations.h"
struct bpf_program;
namespace PcapDotNet namespace PcapDotNet
{ {
......
#include "PacketHeader.h"
#include "Pcap.h"
#include "Timestamp.h"
using namespace PcapDotNet;
// static
void PacketHeader::GetPcapHeader(pcap_pkthdr &header, BPacket::Packet^ packet)
{
Timestamp::DateTimeToPcapTimestamp(packet->Timestamp, header.ts);
header.len = packet->Length;
header.caplen = packet->Length;
}
\ No newline at end of file
#pragma once
#include "PcapDeclarations.h"
namespace PcapDotNet
{
private ref class PacketHeader
{
public:
static void GetPcapHeader(pcap_pkthdr &header, BPacket::Packet^ packet);
};
}
\ No newline at end of file
#pragma once
#include <stdio.h>
#include <pcap.h>
#include <remote-ext.h>
#include <Win32-Extensions.h>
\ No newline at end of file
#include "PcapAddress.h" #include "PcapAddress.h"
#include "Pcap.h"
#include <stdio.h>
#include <pcap.h>
using namespace System; using namespace System;
using namespace System::Text; using namespace System::Text;
......
#pragma once #pragma once
struct sockaddr; #include "PcapDeclarations.h"
typedef struct pcap_addr pcap_addr_t;
namespace PcapDotNet namespace PcapDotNet
{ {
......
#include "PcapTypedefs.h" #include "PcapDeclarations.h"
struct pcap{}; struct pcap{};
struct pcap_dumper{}; struct pcap_dumper{};
......
#pragma once #pragma once
struct bpf_program;
struct pcap_pkthdr;
struct pcap_send_queue;
struct sockaddr;
struct timeval;
typedef struct pcap_addr pcap_addr_t;
typedef struct pcap_dumper pcap_dumper_t; typedef struct pcap_dumper pcap_dumper_t;
typedef struct pcap pcap_t; typedef struct pcap pcap_t;
#include "PcapDeviceHandler.h" #include "PcapDeviceHandler.h"
#include <stdio.h>
#include <pcap.h>
#include "MarshalingServices.h" #include "MarshalingServices.h"
#include "PcapDumpFile.h" #include "PcapDumpFile.h"
#include "Timestamp.h" #include "Timestamp.h"
#include "Pcap.h"
using namespace System; using namespace System;
using namespace BPacket; using namespace BPacket;
......
#include "PcapDumpFile.h" #include "PcapDumpFile.h"
#include <stdio.h>
#include <pcap.h>
#include "Timestamp.h" #include "Timestamp.h"
#include "PacketHeader.h"
#include "MarshalingServices.h" #include "MarshalingServices.h"
#include "Pcap.h"
using namespace System; using namespace System;
using namespace PcapDotNet; using namespace PcapDotNet;
...@@ -19,9 +17,7 @@ PcapDumpFile::PcapDumpFile(pcap_dumper_t* handler, System::String^ filename) ...@@ -19,9 +17,7 @@ PcapDumpFile::PcapDumpFile(pcap_dumper_t* handler, System::String^ filename)
void PcapDumpFile::Dump(Packet^ packet) void PcapDumpFile::Dump(Packet^ packet)
{ {
pcap_pkthdr header; pcap_pkthdr header;
Timestamp::DateTimeToPcapTimestamp(packet->Timestamp, header.ts); PacketHeader::GetPcapHeader(header, packet);
header.len = packet->Length;
header.caplen = packet->Length;
std::string unmanagedFilename = MarshalingServices::ManagedToUnmanagedString(_filename); std::string unmanagedFilename = MarshalingServices::ManagedToUnmanagedString(_filename);
pin_ptr<Byte> unamangedPacketBytes = &packet->Buffer[0]; pin_ptr<Byte> unamangedPacketBytes = &packet->Buffer[0];
......
#pragma once #pragma once
#include "PcapTypedefs.h" #include "PcapDeclarations.h"
namespace PcapDotNet namespace PcapDotNet
{ {
......
#include "PcapLiveDevice.h" #include "PcapLiveDevice.h"
#include <stdio.h>
#include <pcap.h>
#include <remote-ext.h>
#include <string> #include <string>
#include "MarshalingServices.h" #include "MarshalingServices.h"
#include "Pcap.h"
using namespace System; using namespace System;
using namespace System::Collections::Generic; using namespace System::Collections::Generic;
......
#include "PcapOfflineDevice.h" #include "PcapOfflineDevice.h"
#include <stdio.h>
#include <pcap.h>
#include <remote-ext.h>
#include <string> #include <string>
#include "Pcap.h"
#include "MarshalingServices.h" #include "MarshalingServices.h"
using namespace System; using namespace System;
using namespace System::Collections::Generic; using namespace System::Collections::Generic;
using namespace PcapDotNet; using namespace PcapDotNet;
......
#include "PcapSendQueue.h"
#include "Pcap.h"
using namespace PcapDotNet;
using namespace BPacket;
PcapSendQueue::PcapSendQueue(unsigned int size)
{
_pcapSendQueue = pcap_sendqueue_alloc(size);
}
void PcapSendQueue::Enqueue(Packet^ packet)
{
//pcap_sendqueue_queue(_pcapSendQueue,
}
PcapSendQueue::~PcapSendQueue()
{
pcap_sendqueue_destroy(_pcapSendQueue);
}
#pragma once
#include "PcapDeclarations.h"
namespace PcapDotNet
{
public ref class PcapSendQueue : System::IDisposable
{
public:
PcapSendQueue(unsigned int size);
void Enqueue(BPacket::Packet^ packet);
~PcapSendQueue();
private:
pcap_send_queue *_pcapSendQueue;
};
}
\ No newline at end of file
#include "Timestamp.h" #include "Timestamp.h"
#include "Pcap.h"
#include <stdio.h>
#include <pcap.h>
using namespace System; using namespace System;
using namespace PcapDotNet; using namespace PcapDotNet;
......
#pragma once #pragma once
struct timeval; #include "PcapDeclarations.h"
namespace PcapDotNet namespace PcapDotNet
{ {
......
...@@ -218,6 +218,18 @@ ...@@ -218,6 +218,18 @@
RelativePath=".\MarshalingServices.h" RelativePath=".\MarshalingServices.h"
> >
</File> </File>
<File
RelativePath=".\PacketHeader.cpp"
>
</File>
<File
RelativePath=".\PacketHeader.h"
>
</File>
<File
RelativePath=".\Pcap.h"
>
</File>
<File <File
RelativePath=".\PcapAddress.cpp" RelativePath=".\PcapAddress.cpp"
> >
...@@ -226,6 +238,14 @@ ...@@ -226,6 +238,14 @@
RelativePath=".\PcapAddress.h" RelativePath=".\PcapAddress.h"
> >
</File> </File>
<File
RelativePath=".\PcapDeclarations.cpp"
>
</File>
<File
RelativePath=".\PcapDeclarations.h"
>
</File>
<File <File
RelativePath=".\PcapDevice.cpp" RelativePath=".\PcapDevice.cpp"
> >
...@@ -267,11 +287,11 @@ ...@@ -267,11 +287,11 @@
> >
</File> </File>
<File <File
RelativePath=".\PcapTypedefs.cpp" RelativePath=".\PcapSendQueue.cpp"
> >
</File> </File>
<File <File
RelativePath=".\PcapTypedefs.h" RelativePath=".\PcapSendQueue.h"
> >
</File> </File>
<File <File
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment