Problem getting gopacket

768 views
Skip to first unread message

webus...@gmail.com

unread,
Apr 17, 2015, 2:09:56 PM4/17/15
to golan...@googlegroups.com
I'm on ubuntu 14.04

I ran:


But am getting the following error:

src/code.google.com/p/gopacket/pfring/pfring.go:13:20: fatal error: pfring.h: No such file or directory
 #include <pfring.h>

I installed pcap-dev:

sudo apt-get install libpcap-dev

Any ideas what I'm doing wrong?

Regards,

WU

Christopher Nielsen

unread,
Apr 17, 2015, 3:33:36 PM4/17/15
to webus...@gmail.com, golang-nuts

Pfring is not pcap. They are different methods of packets off the wire. You need to install the dev package for pfring.

webus...@gmail.com

unread,
Apr 17, 2015, 3:55:39 PM4/17/15
to golan...@googlegroups.com, webus...@gmail.com, m4dh...@gmail.com
I tried to google for a package for pfring and did not find one. Any idea what the package name is for ubuntu...

Thanks,

WU

Christopher Nielsen

unread,
Apr 17, 2015, 5:37:45 PM4/17/15
to webuser1200, golang-nuts
Have a look at http://www.nmon.net/apt-stable/
--
Christopher Nielsen
"They who can give up essential liberty for temporary safety, deserve
neither liberty nor safety." --Benjamin Franklin
"The tree of liberty must be refreshed from time to time with the
blood of patriots & tyrants." --Thomas Jefferson

webus...@gmail.com

unread,
Apr 18, 2015, 10:18:23 AM4/18/15
to golan...@googlegroups.com, m4dh...@gmail.com, webus...@gmail.com
Thanks. Installing that got me past the previous error. Then I got the following error:

//usr/local/lib/libpfring.so: undefined reference to `numa_node_of_cpu'
//usr/local/lib/libpfring.so: undefined reference to `numa_bind'
//usr/local/lib/libpfring.so: undefined reference to `numa_parse_nodestring'
//usr/local/lib/libpfring.so: undefined reference to `numa_available'
collect2: error: ld returned 1 exit status

I had to install the libnuma package:

sudo apt-get install libnuma-dev

Still no luck. Then I had to change the following line in pfring.go 

#cgo LDFLAGS: -lpfring -lpcap

to 

#cgo LDFLAGS: -lpfring -lpcap -lnuma -lrt

Now everything looks good...
Reply all
Reply to author
Forward
0 new messages