#include "defs.h"
#include <sys/socket.h>
-#ifdef AF_SMC
+#ifndef AF_SMC
+# define XLAT_MACROS_ONLY
+# include "xlat/addrfams.h"
+# undef XLAT_MACROS_ONLY
+#endif
-# include "netlink.h"
-# include "netlink_sock_diag.h"
-# include "nlattr.h"
-# include "print_fields.h"
+#include "netlink.h"
+#include "netlink_sock_diag.h"
+#include "nlattr.h"
+#include "print_fields.h"
-# include <arpa/inet.h>
-# include <linux/smc_diag.h>
+#include <arpa/inet.h>
+#include <linux/smc_diag.h>
-# include "xlat/smc_diag_attrs.h"
-# include "xlat/smc_diag_extended_flags.h"
-# include "xlat/smc_link_group_roles.h"
-# include "xlat/smc_states.h"
+#include "xlat/smc_diag_attrs.h"
+#include "xlat/smc_diag_extended_flags.h"
+#include "xlat/smc_link_group_roles.h"
+#include "xlat/smc_states.h"
DECL_NETLINK_DIAG_DECODER(decode_smc_diag_req)
{
ARRAY_SIZE(smc_diag_msg_nla_decoders), NULL);
}
}
-
-#endif /* AF_SMC */
#include "netlink.h"
#include "netlink_sock_diag.h"
+#define XLAT_MACROS_ONLY
+#include "xlat/addrfams.h"
+#undef XLAT_MACROS_ONLY
+
static void
decode_family(struct tcb *const tcp, const uint8_t family,
const kernel_ulong_t addr, const unsigned int len)
static const struct {
const netlink_diag_decoder_t request, response;
} diag_decoders[] = {
+ [AF_UNIX] = { decode_unix_diag_req, decode_unix_diag_msg },
[AF_INET] = { decode_inet_diag_req, decode_inet_diag_msg },
[AF_INET6] = { decode_inet_diag_req, decode_inet_diag_msg },
[AF_NETLINK] = { decode_netlink_diag_req, decode_netlink_diag_msg },
[AF_PACKET] = { decode_packet_diag_req, decode_packet_diag_msg },
-#ifdef AF_SMC
[AF_SMC] = { decode_smc_diag_req, decode_smc_diag_msg },
-#endif
- [AF_UNIX] = { decode_unix_diag_req, decode_unix_diag_msg }
};
bool
#include "tests.h"
#include <sys/socket.h>
-#ifdef AF_SMC
-
-# include <stdio.h>
-# include <string.h>
-# include <stdint.h>
-# include <arpa/inet.h>
-# include "test_nlattr.h"
-# include <linux/rtnetlink.h>
-# include <linux/smc_diag.h>
-# include <linux/sock_diag.h>
-
-# ifndef SMC_CLNT
-# define SMC_CLNT 0
-# endif
-# ifndef SMC_ACTIVE
-# define SMC_ACTIVE 1
-# endif
+#ifndef AF_SMC
+# define AF_SMC 43
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include <arpa/inet.h>
+#include "test_nlattr.h"
+#include <linux/rtnetlink.h>
+#include <linux/smc_diag.h>
+#include <linux/sock_diag.h>
+
+#ifndef SMC_CLNT
+# define SMC_CLNT 0
+#endif
+#ifndef SMC_ACTIVE
+# define SMC_ACTIVE 1
+#endif
static const char address[] = "12.34.56.78";
printf("+++ exited with 0 +++\n");
return 0;
}
-
-#else
-
-SKIP_MAIN_UNDEFINED("AF_SMC")
-
-#endif