Zephyr API Documentation  3.6.0
A Scalable Open Source RTOS
3.6.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
igmp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
11#ifndef ZEPHYR_INCLUDE_NET_IGMP_H_
12#define ZEPHYR_INCLUDE_NET_IGMP_H_
13
21#include <zephyr/types.h>
22
23#include <zephyr/net/net_if.h>
24#include <zephyr/net/net_ip.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30struct igmp_param {
31 struct in_addr *source_list; /* List of sources to include or exclude */
32 size_t sources_len; /* Length of source list */
33 bool include; /* Source list filter type */
34};
35
45#if defined(CONFIG_NET_IPV4_IGMP)
46int net_ipv4_igmp_join(struct net_if *iface, const struct in_addr *addr,
47 const struct igmp_param *param);
48#else
49static inline int net_ipv4_igmp_join(struct net_if *iface, const struct in_addr *addr,
50 const struct igmp_param *param)
51{
52 ARG_UNUSED(iface);
53 ARG_UNUSED(addr);
54 ARG_UNUSED(param);
55
56 return -ENOSYS;
57}
58#endif
59
68#if defined(CONFIG_NET_IPV4_IGMP)
69int net_ipv4_igmp_leave(struct net_if *iface, const struct in_addr *addr);
70#else
71static inline int net_ipv4_igmp_leave(struct net_if *iface,
72 const struct in_addr *addr)
73{
74 ARG_UNUSED(iface);
75 ARG_UNUSED(addr);
76
77 return -ENOSYS;
78}
79#endif
80
81#ifdef __cplusplus
82}
83#endif
84
89#endif /* ZEPHYR_INCLUDE_NET_IGMP_H_ */
static int net_ipv4_igmp_join(struct net_if *iface, const struct in_addr *addr, const struct igmp_param *param)
Join a given multicast group.
Definition: igmp.h:49
static int net_ipv4_igmp_leave(struct net_if *iface, const struct in_addr *addr)
Leave a given multicast group.
Definition: igmp.h:71
#define ENOSYS
Function not implemented.
Definition: errno.h:83
Public API for network interface.
IPv6 and IPv4 definitions.
Definition: igmp.h:30
bool include
Definition: igmp.h:33
struct in_addr * source_list
Definition: igmp.h:31
size_t sources_len
Definition: igmp.h:32
IPv4 address struct.
Definition: net_ip.h:151
Network Interface structure.
Definition: net_if.h:615