[Winpcap-users] problem with pcap_packetsend

Gianluca Varenni gianluca.varenni at cacetech.com
Wed Nov 1 16:14:22 GMT 2006


1514 is the maximum frame size (excluding the Frame Check Sequence) that you 
can transmit on an ethernet adapter. That's probably the reason why 
pcap_packetsend fails.

Hope it helps

----- Original Message ----- 
From: "Horatio" <horatio at rtlab.cs.nthu.edu.tw>
To: <winpcap-users at winpcap.org>
Cc: <horatio at rtlab.cs.nthu.edu.tw>
Sent: Wednesday, November 01, 2006 5:36 AM
Subject: [Winpcap-users] problem with pcap_packetsend

> Hi there mailinglist,
> I am a newbie and I have a problem with the function,
> "pcap_packetsend(pcap_t *p,u_char *buf,int size)"
> It return -1(error) if the packet size is larger than roughly 1500 bytes.
> I tried to solve this problem by using "pcap_setbuff" and
> "pcap_setuserbuffer", but it still doesn't work.
> I use Wireshark to observe the packets, and I thought that packets' size
> is cause of this error.
> I am working on a NAT server.
> I access to internet on a PPPoE connection. I "open" the REAL ethernet
> adapter as the first argument in
> pcap_packetsend(pcap_t *p....
> I add the PPPoE/PPP header to packets, and call pcap_packetsend to send 
> it.
> It does work. So far, In the computer with a private IP, I can use
> telnet to connect the computer in Internet
> through my NAT server.
> My system : WinXP_SP2 + WinPcap 3.1 + Visual Studio C++ 2005
> By the way, does anybody have any suggestions in developing a NAT server?
> (a term project of a course, not a commercial product.)
> Should I use Socket API to deal with the connection between NAT and
> Internet?
> Forgive me my poor English.
> Thank you very much!
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users 

More information about the Winpcap-users mailing list