Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

print_group_req.c 781B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2015-2018 The strace developers.
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  6. */
  7. #include "defs.h"
  8. #include <netinet/in.h>
  9. #ifdef MCAST_JOIN_GROUP
  10. # include DEF_MPERS_TYPE(struct_group_req)
  11. typedef struct group_req struct_group_req;
  12. #endif /* MCAST_JOIN_GROUP */
  13. #include MPERS_DEFS
  14. #ifdef MCAST_JOIN_GROUP
  15. # include "print_fields.h"
  16. MPERS_PRINTER_DECL(void, print_group_req, struct tcb *const tcp,
  17. const kernel_ulong_t addr, const int len)
  18. {
  19. struct_group_req greq;
  20. if (len < (int) sizeof(greq)) {
  21. printaddr(addr);
  22. } else if (!umove_or_printaddr(tcp, addr, &greq)) {
  23. PRINT_FIELD_IFINDEX("{", greq, gr_interface);
  24. PRINT_FIELD_SOCKADDR(", ", greq, gr_group);
  25. tprints("}");
  26. }
  27. }
  28. #endif /* MCAST_JOIN_GROUP */