zephyr/include/net/igmp.h
Jukka Rissanen a1c4952dfd net: ipv4: Add IGMPv2 support
Add Internet Group Management Protocol v2 support, see RFC 2236
for details.

Fixes #2336

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-29 14:49:55 +03:00

67 lines
1.2 KiB
C

/*
* Copyright (c) 2021 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/** @file
* @brief IGMP API
*/
#ifndef ZEPHYR_INCLUDE_NET_IGMP_H_
#define ZEPHYR_INCLUDE_NET_IGMP_H_
/**
* @brief IGMP (Internet Group Management Protocol)
* @defgroup igmp IGMP API
* @ingroup networking
* @{
*/
#include <zephyr/types.h>
#include <net/net_if.h>
#include <net/net_ip.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Join a given multicast group.
*
* @param iface Network interface where join message is sent
* @param addr Multicast group to join
*
* @return Return 0 if joining was done, <0 otherwise.
*/
#if defined(CONFIG_NET_IPV4_IGMP)
int net_ipv4_igmp_join(struct net_if *iface, const struct in_addr *addr);
#else
#define net_ipv4_igmp_join(iface, addr) -ENOSYS
#endif
/**
* @brief Leave a given multicast group.
*
* @param iface Network interface where leave message is sent
* @param addr Multicast group to leave
*
* @return Return 0 if leaving is done, <0 otherwise.
*/
#if defined(CONFIG_NET_IPV4_IGMP)
int net_ipv4_igmp_leave(struct net_if *iface, const struct in_addr *addr);
#else
#define net_ipv4_igmp_leave(iface, addr) -ENOSYS
#endif
#ifdef __cplusplus
}
#endif
/**
* @}
*/
#endif /* ZEPHYR_INCLUDE_NET_IGMP_H_ */