E
exman
Hi !
i have a problem related to winpcap, i'm curretly making a sniffer
aplication for my studies.
I want to accomplish this
http://www.winpcap.org/docs/man/html/group__wpcap__tut3.html
but in visual studio, the problem is related to the function
pcap_loop(adhandle, 0, packet_handler, NULL);
it has a pointer to the function packet_handler.
It works fine in console, but how do i make it work in windows forms??
a have made an form with an button which pressed should do the stuff
that the function main does in te program from the above linlk, but
should call the function from inside the class like this:
namespace sniffer {
/ /code
public ref class Form1 : public System::Windows::Forms::Form
{
....................
private: System::Void buttonStart_Click(System::Object^ sender,
System::EventArgs^ e) {
//some code
pcap_loop(adhandle, 0, packet_handler, NULL);
}//koniec obslugi przycisku start
public: void packet_handler(u_char *param, const struct pcap_pkthdr
*header, const u_char *pkt_data)
{ }
};
the function reference worked fine when i've putted it outside the
class but then i dont know how to get the data from the function to
members of the class.
i have a problem related to winpcap, i'm curretly making a sniffer
aplication for my studies.
I want to accomplish this
http://www.winpcap.org/docs/man/html/group__wpcap__tut3.html
but in visual studio, the problem is related to the function
pcap_loop(adhandle, 0, packet_handler, NULL);
it has a pointer to the function packet_handler.
It works fine in console, but how do i make it work in windows forms??
a have made an form with an button which pressed should do the stuff
that the function main does in te program from the above linlk, but
should call the function from inside the class like this:
namespace sniffer {
/ /code
public ref class Form1 : public System::Windows::Forms::Form
{
....................
private: System::Void buttonStart_Click(System::Object^ sender,
System::EventArgs^ e) {
//some code
pcap_loop(adhandle, 0, packet_handler, NULL);
}//koniec obslugi przycisku start
public: void packet_handler(u_char *param, const struct pcap_pkthdr
*header, const u_char *pkt_data)
{ }
};
the function reference worked fine when i've putted it outside the
class but then i dont know how to get the data from the function to
members of the class.