1 /* SPDX-License-Identifier: LGPL-2.1-or-later */ 2 #pragma once 3 4 #include "log-link.h" 5 6 #define log_interface_prefix_full_errno_zerook(prefix, type, val, error, fmt, ...) \ 7 ({ \ 8 int _e = (error); \ 9 if (DEBUG_LOGGING) { \ 10 const char *_n = NULL; \ 11 type *_v = (val); \ 12 \ 13 if (_v) \ 14 (void) type##_get_ifname(_v, &_n); \ 15 log_interface_full_errno_zerook( \ 16 _n, LOG_DEBUG, _e, prefix fmt, \ 17 ##__VA_ARGS__); \ 18 } \ 19 -ERRNO_VALUE(_e); \ 20 }) 21 22 #define log_interface_prefix_full_errno(prefix, type, val, error, fmt, ...) \ 23 ({ \ 24 int _error = (error); \ 25 ASSERT_NON_ZERO(_error); \ 26 log_interface_prefix_full_errno_zerook( \ 27 prefix, type, val, _error, fmt, ##__VA_ARGS__); \ 28 }) 29 30 int get_ifname(int ifindex, char **ifname); 31