strace/print_group_req.c
Dmitry V. Levin b93d52fe3d Change the license of strace to LGPL-2.1-or-later
strace is now provided under the terms of the GNU Lesser General
Public License version 2.1 or later, see COPYING for more details.

strace test suite is now provided under the terms of the GNU General
Public License version 2 or later, see tests/COPYING for more details.
2018-12-10 00:00:00 +00:00

39 lines
781 B
C

/*
* Copyright (c) 2015-2017 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#include <netinet/in.h>
#ifdef MCAST_JOIN_GROUP
# include DEF_MPERS_TYPE(struct_group_req)
typedef struct group_req struct_group_req;
#endif /* MCAST_JOIN_GROUP */
#include MPERS_DEFS
#ifdef MCAST_JOIN_GROUP
# include "print_fields.h"
MPERS_PRINTER_DECL(void, print_group_req, struct tcb *const tcp,
const kernel_ulong_t addr, const int len)
{
struct_group_req greq;
if (len < (int) sizeof(greq)) {
printaddr(addr);
} else if (!umove_or_printaddr(tcp, addr, &greq)) {
PRINT_FIELD_IFINDEX("{", greq, gr_interface);
PRINT_FIELD_SOCKADDR(", ", greq, gr_group);
tprints("}");
}
}
#endif /* MCAST_JOIN_GROUP */