Compile error - Packet-drill initial make

272 views
Skip to first unread message

Sudharshan

unread,
Oct 24, 2013, 12:25:13 AM10/24/13
to packe...@googlegroups.com
Hi,
I went through the paper on "Packetdrill" and the video presented in USENIX. Looks promising and congratulations for bringing up a beautiful tool. I'd like to learn / contribute to packet drill community.
- as a first step, I did d/l the source from git and did 'configure';and make on RedHat machine. It throws out an error pasted below: Am i missing something here? any pointers here would be useful.. 

cc -g -Wall -Werror   -c -o packetdrill.o packetdrill.c

cc -g -Wall -Werror   -c -o checksum.o checksum.c

cc -g -Wall -Werror   -c -o code.o code.c

cc -g -Wall -Werror   -c -o config.o config.c

cc -g -Wall -Werror   -c -o hash.o hash.c

cc -g -Wall -Werror   -c -o hash_map.o hash_map.c

cc -g -Wall -Werror   -c -o ip_address.o ip_address.c

cc -g -Wall -Werror   -c -o netdev.o netdev.c

cc -g -Wall -Werror   -c -o net_utils.o net_utils.c

cc -g -Wall -Werror   -c -o packet.o packet.c

cc -g -Wall -Werror   -c -o packet_socket_linux.o packet_socket_linux.c

cc -g -Wall -Werror   -c -o packet_socket_pcap.o packet_socket_pcap.c

cc -g -Wall -Werror   -c -o packet_checksum.o packet_checksum.c

cc -g -Wall -Werror   -c -o packet_parser.o packet_parser.c

cc -g -Wall -Werror   -c -o packet_to_string.o packet_to_string.c

cc -g -Wall -Werror   -c -o symbols_linux.o symbols_linux.c

symbols_linux.c:91: error: ‘IP_PMTUDISC_PROBE’ undeclared here (not in a function)

symbols_linux.c:111: error: ‘TCP_CONGESTION’ undeclared here (not in a function)

symbols_linux.c:112: error: ‘TCP_MD5SIG’ undeclared here (not in a function)

symbols_linux.c:152: error: ‘F_DUPFD_CLOEXEC’ undeclared here (not in a function)

symbols_linux.c:187: error: ‘MSG_CMSG_CLOEXEC’ undeclared here (not in a function)

symbols_linux.c:358: error: ‘ERFKILL’ undeclared here (not in a function)

make: *** [symbols_linux.o] Error 1 

Thanks
Sudharshan

Neal Cardwell

unread,
Oct 24, 2013, 9:34:11 AM10/24/13
to Sudharshan, packe...@googlegroups.com
Hi,

The packetdrill code compiles on Ubuntu, but apparently the .h file
organization is different on RedHat.

To get it to compile, you'll have to look for the correct .h file on
your system for each of those symbols, with something like (for
example):

find /usr/include/ -name "*.h" | xargs grep IP_PMTUDISC_PROBE

Then you can add the includes for the appropriate .h files.

If you share the new .h files you needed to include in symbols_linux.c
I would be happy to add these in the next release.

thanks,
neal
> --
> You received this message because you are subscribed to the Google Groups
> "packetdrill" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packetdrill...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Sudharshan

unread,
Oct 24, 2013, 1:24:49 PM10/24/13
to packe...@googlegroups.com, Sudharshan
Thanks Neal. Yes, I can compile on a ubuntu box. Let me see how can this be fixed in RH machine. Has anyone installed on Fedora? 
Sudharshan

Sudharshan

unread,
Oct 24, 2013, 1:40:56 PM10/24/13
to packe...@googlegroups.com, Sudharshan
Should we have to define our own macro definitions for these missing macros, in "tcp.h"? 

Neal Cardwell

unread,
Oct 24, 2013, 2:27:28 PM10/24/13
to Sudharshan, packe...@googlegroups.com
If you can document that these are really missing from RedHat .h files
(by showing the output of a grep through /usr/include for each
symbol), I will apply a patch that adds them to tcp.h.

neal

Sudharshan

unread,
Oct 25, 2013, 1:12:14 PM10/25/13
to Neal Cardwell, packe...@googlegroups.com, Sudharshan Varada


--
You received this message because you are subscribed to a topic in the Google Groups "packetdrill" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/packetdrill/kX9DFeBgR-U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to packetdrill...@googlegroups.com.

Sonia Gupta

unread,
Nov 26, 2013, 2:05:44 PM11/26/13
to packe...@googlegroups.com, Neal Cardwell, Sudharshan Varada
Hi Neal, Sudharshan,
I am trying to build packetdrill on CentOS5.2, I am getting this error...

I have also added the find /usr/include for these macros.
Please advise how to resolve these symbols because most of these are not in /usr/include.

packetdrill]# make

cc -g -Wall -Werror   -c -o symbols_linux.o symbols_linux.c
symbols_linux.c:91: error: ˜IP_PMTUDISC_PROBE undeclared here (not in a function)
symbols_linux.c:111: error: ˜TCP_CONGESTION undeclared here (not in a function)
symbols_linux.c:112: error: ˜TCP_MD5SIG undeclared here (not in a function)
symbols_linux.c:152: error: ˜F_DUPFD_CLOEXEC undeclared here (not in a function)
symbols_linux.c:187: error: ˜MSG_CMSG_CLOEXEC undeclared here (not in a function)
make: *** [symbols_linux.o] Error 1
[root@utm-pc2 packetdrill]#  find /usr/include/ -name "*.h" | xargs grep TCP_CONGESTION
/usr/include/linux/tcp.h:#define TCP_CONGESTION         13      /* Congestion control algorithm */
[root@utm-pc2 packetdrill]#  find /usr/include/ -name "*.h" | xargs grep IP_PMTUDISC_PROBE
[root@utm-pc2 packetdrill]#  find /usr/include/ -name "*.h" | xargs grep TCP_MD5SIG
[root@utm-pc2 packetdrill]#  find /usr/include/ -name "*.h" | xargs grep F_DUPFD_CLOEXEC
[root@utm-pc2 packetdrill]#  find /usr/include/ -name "*.h" | xargs grep MSG_CMSG_CLOEXEC

Thanks a lot,
sonia

Neal Cardwell

unread,
Nov 26, 2013, 2:32:56 PM11/26/13
to Sonia Gupta, packe...@googlegroups.com, Sudharshan Varada
Hi,

I'm afraid I don't have time to research the best solution for CentOS
5.2, but you can just remove the lines from symbols_linux.c that do
not compile on your platform. They are not needed unless you have a
packetdrill script that makes use of those symbols.

Or, if you want to cook up a patch, I would be happy to merge a patch
that adds ifdefs to allow it to compile on your OS, something like the
following (adjusting formatting to match the surrounding code...):

#ifdef FOO
{ FOO, "FOO" },
#endif

neal

Sonia Gupta

unread,
Nov 26, 2013, 3:20:07 PM11/26/13
to Neal Cardwell, packe...@googlegroups.com, Sudharshan Varada
Hi Neal,

Thanks for your email. After adding the following macros, I am able to compile packetdrill on CentOS 5.2


#define IP_PMTUDISC_PROBE               3       /* Ignore dst pmtu      */

#define TCP_CONGESTION          13      /* Congestion control algorithm */
#define TCP_MD5SIG              14      /* TCP MD5 Signature (RFC2385) */

#define F_LINUX_SPECIFIC_BASE  1024
/* Create a file descriptor with FD_CLOEXEC set. */
#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
#define MSG_CMSG_CLOEXEC 0x40000000     /* Set close_on_exit for file
                                            descriptor received through
                                             */

#define ERFKILL         132     /* Operation not possible due to RF-kill */

Thanks
sonia
Reply all
Reply to author
Forward
0 new messages