<div>Hi guys,</div> <div> </div> <div>I'm trying to store the packets captured to "savefile" using pcap_dump_open and pcap_dump functions. Both these functions use pointer to pcap_dumper_t structure called dumpfile. </div> <div> </div> <div>I'm working in Visual Studio .NET 2003 MFC Console application (.NET). And I'm getting following assembly error:</div> <div><STRONG>An unhandled exception of type 'System.TypeLoadException' occurred in Unknown Module.</STRONG></div> <div><STRONG>Additional information: Could not load type pcap_dumper from assembly try, Version=1.0.2303.25936, Culture=neutral, PublicKeyToken=null.</STRONG></div> <div> </div> <div>The error points to </div><FONT size=2> <div>mainret = main(argc, argv, envp);</div></FONT> <div>in crtexe.c file.</div> <div> </div> <div>This is the related piece of code:</div><FONT size=2> <div>pcap_dumper_t* dumpfile;</div></FONT><FONT color=#0000ff size=2> <div>char</FONT><FONT
size=2>* tmpdir;</div></FONT> <div>.</div> <div>.</div><FONT color=#000000 size=2> <div>tmpdir = strdup(tmpnam(NULL));</div></FONT><FONT size=2> <div>dumpfile =pcap_dump_open(adhandle,"dumpfile"); >>>adhandle is return value </div> <div> >>of pcap_open structure</div> <div></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2>(dumpfile==NULL)</div> <div>{</div> <div>fprintf(stderr,"\nError opening output file\n");</div> <div></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> -1;</div> <div>}</div></FONT>
<div>.</div> <div>.</div><FONT size=2> <div>pcap_loop(adhandle, 0, packet_handler, (</FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>char</FONT><FONT size=2> *)dumpfile);</div></FONT> <div>.</div> <div>.</div> <div>I'm unable to debug this. All other functions work fine. So I guess there is no linking error. It's only when I use pcap_dumper_t I'm getting error.</div> <div> </div> <div> </div><p>
        
        
                <hr size=1>
Jiyo cricket on <a href="http://us.rd.yahoo.com/mail/in/mailcricket/*http://in.sports.yahoo.com/cricket/">Yahoo! India cricket</a><br>
<a href="http://us.rd.yahoo.com/mail/in/mailmobilemessenger/*http://in.mobile.yahoo.com/new/messenger/">Yahoo! Messenger Mobile</a> Stay in touch with your buddies all the time.