endif()
check_struct_has_member("struct tpacket_auxdata" tp_vlan_tci linux/if_packet.h HAVE_STRUCT_TPACKET_AUXDATA_TP_VLAN_TCI)
+
+ # This check is for TESTrun purposes, not for the C code.
+ # This and the #cmakedefine01 in cmakeconfig.h.in reproduce exactly the
+ # behaviour of "AC_CHECK_DECLS([SKF_AD_VLAN_TAG_PRESENT], ...".
+ check_symbol_exists(SKF_AD_VLAN_TAG_PRESENT linux/filter.h HAVE_DECL_SKF_AD_VLAN_TAG_PRESENT)
elseif(PCAP_TYPE STREQUAL "bpf")
#
# Check whether we have the *BSD-style ioctls.
/* Define to 1 if `tp_vlan_tci' is a member of `struct tpacket_auxdata'. */
#cmakedefine HAVE_STRUCT_TPACKET_AUXDATA_TP_VLAN_TCI 1
+/* Define to 1 if you have the declaration of `SKF_AD_VLAN_TAG_PRESENT', and
+ to 0 if you don't. */
+#cmakedefine01 HAVE_DECL_SKF_AD_VLAN_TAG_PRESENT
+
/* Define to 1 if `bRequestType' is a member of `struct
usbdevfs_ctrltransfer'. */
#cmakedefine HAVE_STRUCT_USBDEVFS_CTRLTRANSFER_BREQUESTTYPE 1
return $^O eq 'linux' ? '' : 'not running on Linux';
}
+sub have_decl {
+ my ($name, $value) = @_;
+ $name = 'HAVE_DECL_' . $name;
+ # "Unlike the other ‘AC_CHECK_*S’ macros, when a symbol is not declared,
+ # HAVE_DECL_symbol is defined to ‘0’ instead of leaving HAVE_DECL_symbol
+ # undeclared." -- GNU Autoconf manual.
+ #
+ # (This requires the CMake leg to do the same for the same symbol.)
+ die "no $name in $config_h" unless defined $config{$name};
+ return int ($config{$name}) == $value ? "$name=$value" : '';
+}
+
# In accept_blocks the top-level keys are test block names. Each test block
# defines one or more tests. When possible, a test block name should be easy
# to relate with the main filter expression, for example, ip_multicast for
',
}, # vlan_netanalyzer_unary
vlan_eth_linuxext_nullary => {
- skip => is_not_linux(),
+ skip => (is_not_linux() or have_decl ('SKF_AD_VLAN_TAG_PRESENT', 0)),
DLT => 'EN10MB',
linuxext => 1,
expr => 'vlan',
',
}, # vlan_eth_linuxext_nullary
vlan_eth_linuxext_unary => {
- skip => is_not_linux(),
+ skip => (is_not_linux() or have_decl ('SKF_AD_VLAN_TAG_PRESENT', 0)),
DLT => 'EN10MB',
linuxext => 1,
expr => 'vlan 10',
',
}, # vlan_eth_linuxext_unary
vlan_and_vlan_eth_linuxext => {
- skip => is_not_linux(),
+ skip => (is_not_linux() or have_decl ('SKF_AD_VLAN_TAG_PRESENT', 0)),
DLT => 'EN10MB',
linuxext => 1,
expr => 'vlan and vlan',