pcap, inet and windows

886 views
Skip to first unread message

Gunnl

unread,
Apr 18, 2011, 5:22:08 AM4/18/11
to omnetpp
Hi.
Sorry I couldn't find any other way to get some help, so I am not
really sure if this is the correct place for requesting help.

I have been trying to compile and use omnet in Windows (XP / 7) and
winpcap but to no success.
I have installed omnetpp-4.1, INET-20110225 and winpcap 4.1.2.
I executed:
$ make cleanall
$ ./configure
$ make MODE=release
in omnet directory, and he found pcap lib correctly in the configure.
Then when I go to inet and I execute the same
$ make cleanall
$ make makefiles
$ make MODE=release
I get the "cannot find -lpcap" error.

I am running out of ideas here, does anyone know what is the problem
and how to fix it?

Thnx,
Henrique

Alfonso Ariza Quintana

unread,
Apr 18, 2011, 6:30:03 AM4/18/11
to omn...@googlegroups.com
two options
1.- install winpcap http://www.winpcap.org/
2.- edit the file src/makefrag and set the option
HAVE_PCAP
to no
HAVE_PCAP=no

> Date: Mon, 18 Apr 2011 02:22:08 -0700
> Subject: [Omnetpp-l] pcap, inet and windows
> From: haeva...@gmail.com
> To: omn...@googlegroups.com
> --
> You received this message because you are subscribed to the Google Groups "omnetpp" group.
> To post to this group, send email to omn...@googlegroups.com.
> To unsubscribe from this group, send email to omnetpp+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/omnetpp?hl=en.
>

Henrique António Evaristo

unread,
Apr 18, 2011, 7:02:29 AM4/18/11
to omn...@googlegroups.com
Well, the problem is that the file specifies exactly the oposite ... I
will try it out anyway...

Quote:
# if you want to use external interfaces with inet, you should install
# winpcap (on windows) or libpcap-dev (on linux) and re-run ./configure in
# the omnetpp root directory and comment out the following line:
#HAVE_PCAP=no

Henrique António Evaristo

unread,
Apr 18, 2011, 8:11:46 AM4/18/11
to omn...@googlegroups.com
I recompilled everything but when trying to run the
emulation->traceroute example I get the error in module (ExtInterface)
during network initialization:
cSocketRTScheduler::setInterfaceModule(): pcap devices not supported.

Meaning winpcap is still not working ... :(
So I think I have to comment out the HAVE_PCAP=no and find out why
isnt he finding the winpcap lib for linking.

2011/4/18 Henrique António Evaristo <haeva...@gmail.com>:

wenchun.peng

unread,
Apr 20, 2011, 10:52:00 AM4/20/11
to omnetpp
Try this:
browse to the the omnetpp installation directory, then copy "msys
\libpcap.a" to "mingw\lib\libpcap.a"

On Apr 18, 8:11 pm, Henrique António Evaristo <haevari...@gmail.com>
wrote:
> I recompilled everything but when trying to run the
> emulation->traceroute example I get the error in module (ExtInterface)
> during network initialization:
> cSocketRTScheduler::setInterfaceModule(): pcap devices not supported.
>
> Meaning winpcap is still not working ... :(
> So I think I have to comment out the HAVE_PCAP=no and find out why
> isnt he finding the winpcap lib for linking.
>
> 2011/4/18 Henrique António Evaristo <haevari...@gmail.com>:
>
>
>
>
>
>
>
> > Well, the problem is that the file specifies exactly the oposite ... I
> > will try it out anyway...
>
> > Quote:
> > # if you want to use external interfaces with inet, you should install
> > # winpcap (on windows) or libpcap-dev (on linux) and re-run ./configure in
> > # the omnetpp root directory and comment out the following line:
> > #HAVE_PCAP=no
>
> > On Mon, Apr 18, 2011 at 12:30 PM, Alfonso Ariza Quintana
> > <aariza...@hotmail.com> wrote:
> >> two options
> >> 1.- install winpcaphttp://www.winpcap.org/
> >> 2.- edit the file src/makefrag and set the option
> >> HAVE_PCAP
> >> to no
> >> HAVE_PCAP=no
>
> >>> Date: Mon, 18 Apr 2011 02:22:08 -0700
> >>> Subject: [Omnetpp-l] pcap, inet and windows
> >>> From: haevari...@gmail.com

Mirkamol

unread,
Apr 21, 2011, 3:45:04 AM4/21/11
to omnetpp
Hi,

I'm a new in omnet. Now trying here to simulate examples with external
interfaces too and getting the same error:
cSocketRTScheduler::setInterfaceModule(): pcap devices not supported.

Installed Ubuntu 10.04.2 ,Omnet++ 4.1, inet_20110225-src, libpcap-dev
1.0.0-6. All are running under VW Player which is on top of Windows XP
SP3.

Appreciate for any help


On 18 Apr., 14:11, Henrique António Evaristo <haevari...@gmail.com>
wrote:
> I recompilled everything but when trying to run the
> emulation->traceroute example I get the error in module (ExtInterface)
> during network initialization:
> cSocketRTScheduler::setInterfaceModule():pcapdevicesnotsupported.
>
> Meaning winpcap is stillnotworking ... :(
> So I think I have to comment out the HAVE_PCAP=no and find out why
> isnt he finding the winpcap lib for linking.
>
> 2011/4/18 Henrique António Evaristo <haevari...@gmail.com>:
>
>
>
>
>
>
>
> > Well, the problem is that the file specifies exactly the oposite ... I
> > will try it out anyway...
>
> > Quote:
> > # if you want to use external interfaces with inet, you should install
> > # winpcap (on windows) or libpcap-dev (on linux) and re-run ./configure in
> > # the omnetpp root directory and comment out the following line:
> > #HAVE_PCAP=no
>
> > On Mon, Apr 18, 2011 at 12:30 PM, Alfonso Ariza Quintana
> > <aariza...@hotmail.com> wrote:
> >> two options
> >> 1.- install winpcaphttp://www.winpcap.org/
> >> 2.- edit the file src/makefrag and set the option
> >> HAVE_PCAP
> >> to no
> >> HAVE_PCAP=no
>
> >>> Date: Mon, 18 Apr 2011 02:22:08 -0700
> >>> Subject: [Omnetpp-l]pcap, inet and windows
> >>> From: haevari...@gmail.com
> >>> To: omn...@googlegroups.com
>
> >>> Hi.
> >>> Sorry I couldn't find any other way to get some help, so I amnot
> >>> really sure if this is the correct place for requesting help.
>
> >>> I have been trying to compile and use omnet in Windows (XP / 7) and
> >>> winpcap but to no success.
> >>> I have installed omnetpp-4.1, INET-20110225 and winpcap 4.1.2.
> >>> I executed:
> >>> $ make cleanall
> >>> $ ./configure
> >>> $ make MODE=release
> >>> in omnet directory, and he foundpcaplib correctly in the configure.

Henrique António Evaristo

unread,
May 2, 2011, 4:27:22 AM5/2/11
to omn...@googlegroups.com
I did the copy and the link passed ... but now I am getting another
link error ...
cannot find -loppenvird
Some more suggestions?

Thnx,
Henrique

PS.: Why are the defaults soo messed up in windows?

Henrique António Evaristo

unread,
May 2, 2011, 4:58:02 AM5/2/11
to omn...@googlegroups.com
Sorry about the last post, it was actually my own mistake since i was
missing to compile omnet with MODE=debug.
After that I believe everything is working now because when I run the
emulation examples instead of complaining he doesnt find the winpcap
he just complains he doesnt have root priviledges.

Anyone knows How to fix this in windows ?

Anyway ... thanks allot Wenchun, without your tip I couldnt have made it.

Mirkamol:
You need to follow the instructions provided by OMNET and INET
regarding the installation with winpcap and then as Wenchun pointed
out you need to copy the file libpcap.a from "msys\lib\" to
"mingw\lib\" otherwise the linker will not find it when building INET.
After that you should be ok, let me know if you still having problems,
I will gladly help you.

Henrique


2011/5/2 Henrique António Evaristo <haeva...@gmail.com>:

Rafael

unread,
May 17, 2011, 10:24:50 AM5/17/11
to omnetpp, Henrique António Evaristo
Hi, guys.

I am also new to Omnetpp. Trying to run the same example inet\examples
\emulation\traceroute
Followed up the steps explained here up to last error about root
priviledges.

Is problem solved or not? Please, could you share with solution.

Thank you all for great help.

saleh alomari

unread,
May 17, 2011, 10:45:14 AM5/17/11
to omn...@googlegroups.com
sure, you will get the problem, you can follow the tutorial, you can open the youtube and see how they install the oment++ and and the whole information until you run whatever you want, good luck 

2011/5/17 Rafael <rafael7...@gmail.com>

Henrique António Evaristo

unread,
May 17, 2011, 10:50:34 AM5/17/11
to omn...@googlegroups.com
Not in Windows.
Rafael, are you using windows ?

Rafael

unread,
May 17, 2011, 11:04:37 AM5/17/11
to omnetpp

Hello, Henrique.
Yes, I am using Win 7.

Henrique António Evaristo

unread,
May 17, 2011, 11:40:42 AM5/17/11
to omn...@googlegroups.com
OK, then I believe your problem is related to the winsock lib initialization.
OMNeT++ incorrectly reports it as a root priviledge problem.
You need to search for the initialization code in the real time
scheduler class and add the missing sockets functions for windows.
One of them is this:
// Initialize Winsock
iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
if (iResult != 0) {
printf("WSAStartup failed: %d\n", iResult);
return 1;
}
http://msdn.microsoft.com/en-us/library/ms738566%28v=vs.85%29.aspx

Don't forget to update also the finalize function.
Also something to be aware of that I ran into also is the fact that,
at least on my machine, Win XP, the sendto function reports an error
code 10049 (if im not mistaken) that I believe it has to do with some
error in the windows socket library ... because when using ICMP
protocol or ARP, there is no such think as a port ... and even though
you are supposed to leave it at 0 it will not work and report it as a
wrong address.

The solution I've implemented makes total use of the Libpcap library
to send and receive packets overriding the sockets.
This has the added advantage that you take control of everything ( I
ended up reimplementing my own versions of the Real Time Scheduler and
the Real Time Interface) but also the disadvantage that you need to
build the Ethernet frame yourself, and also the IP header checksum
calculation ... among other small details.
Its not soo difficult to do but it takes some time, but since I
already lost soo much time trying to get omnet working on windows that
I ended giving up. Not many people here is willing to help who uses
windows ...
I've also detected some problems on the eclipse IDE, at least on
windows... Im trying to avoid using it now.

Best of luck,
Henrique

On Tue, May 17, 2011 at 5:04 PM, Rafael <rafael7...@gmail.com> wrote:
>
> Hello, Henrique.
> Yes, I am using Win 7.
>

Rafael

unread,
May 20, 2011, 9:19:01 AM5/20/11
to omnetpp
Colleagues,

it seems to be a great deal with Win.
I run to Ubuntu 10.04
And again troubles following me.

Faced with 2 troubles:
1 - installing prerequisite package - openjdk-6-jre - new discussiono
created

2 - again when running Omnet - Inet - Examples - Emulation - Tracert -
omnetpp.ini - "pcap devices not supported" - error.

something wrong with me? I followed all point from guide.

Please assist.

Rafael

unread,
May 20, 2011, 11:02:48 AM5/20/11
to omnetpp
Colleagues, clearing info:

2 - again when running Omnet - Inet - Examples - Emulation - Tracert -
omnetpp.ini - "pcap devices not supported" - error.
<!> Error in module (ExtInterface) Traceroute.extRouter.ext[0]
(id=310) during network initialization:
cSocketRTScheduler::setInterfaceModule(): pcap devices not supported.

Thanks again.

Rafael

unread,
May 20, 2011, 11:03:00 AM5/20/11
to omnetpp
Colleagues, clearing info:

2 - again when running Omnet - Inet - Examples - Emulation - Tracert -
omnetpp.ini - "pcap devices not supported" - error.
<!> Error in module (ExtInterface) Traceroute.extRouter.ext[0]
(id=310) during network initialization:
cSocketRTScheduler::setInterfaceModule(): pcap devices not supported.

Thanks again.

Rafael

unread,
May 20, 2011, 11:03:24 AM5/20/11
to omnetpp
Colleagues, clearing info:

2 - again when running Omnet - Inet - Examples - Emulation - Tracert -
omnetpp.ini - "pcap devices not supported" - error.
<!> Error in module (ExtInterface) Traceroute.extRouter.ext[0]
(id=310) during network initialization:
cSocketRTScheduler::setInterfaceModule(): pcap devices not supported.

Thanks again.

Henrique António Evaristo

unread,
May 23, 2011, 9:53:39 AM5/23/11
to omn...@googlegroups.com
You need to follow the installation instructions ...
1. compile omnet with pcap devices on
2. compile inet with pcap devices on

vatesh pasrija

unread,
Oct 20, 2012, 6:53:52 AM10/20/12
to omn...@googlegroups.com, haeva...@gmail.com
Hi..

Need some help..
I am using Omnet 4.1 and inetmanet and getting error "cannot find -lpcap".Please anyone can help me. I have tried editing the file src/makefrag and set the option 
HAVE_PCAP=yes to HAVE_PCAP=no.But still getting the same error while building inetmanet using IDE.

NOTE:- I have wincap already installed on my machine.

Thanks & Regards,
Vatesh Pasrija
BITS Pilani
Reply all
Reply to author
Forward
0 new messages