netsniff-ng: trafgen: use bug_on around gettimeofday
[netsniff-ng.git] / src / cmake / modules / CheckTxRing.cmake
blobbb5d2bbbd527116d61019409e15e67811203854b
2 # netsniff-ng - the packet sniffing beast
3 # By Daniel Borkmann <daniel@netsniff-ng.org>
4 # Copyright 2011 Emmanuel Roullit <emmanuel@netsniff-ng.org>.
5 # Copyright 2009 Aaron Turner, <aturner@synfin.net>, 3-clause BSD
6 # Subject to the GPL, version 2.
9 # Copyright (c) 2009 Aaron Turner, <aturner@synfin.net>
10 # All rights reserved.
12 # Redistribution and use in source and binary forms, with or without
13 # modification, are permitted provided that the following conditions
14 # are met:
16 # * Redistributions of source code must retain the above copyright
17 #   notice, this list of conditions and the following disclaimer.
19 # * Redistributions in binary form must reproduce the above copyright
20 #   notice, this list of conditions and the following disclaimer in
21 #   the documentation and/or other materials provided with the
22 #   distribution.
24 # * Neither the name of the Aaron Turner nor the names of its
25 #   contributors may be used to endorse or promote products derived
26 #   from this software without specific prior written permission.
28 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 # POSSIBILITY OF SUCH DAMAGE.
41 include(CheckCSourceRuns)
43 check_c_source_runs("
44 #include <stdlib.h>
45 #include <sys/socket.h>
46 #include <net/ethernet.h>
47 #include <netinet/in.h>
48 #include <linux/if_packet.h>
50 int main(int argc, char *argv[])
52     int test;
53     test = TP_STATUS_SEND_REQUEST;
54     exit(0);
55 }" TX_RING_RUN_RESULT)
57 set(HAVE_TX_RING NO)
59 if(TX_RING_RUN_RESULT EQUAL 1)
60   set(HAVE_TX_RING YES)
61   message(STATUS "System has TX_RING support")
62 else(TX_RING_RUN_RESULT EQUAL 1)
63   message(STATUS "System has no TX_RING support")
64 endif(TX_RING_RUN_RESULT EQUAL 1)