net/igmp: Remove igmp_initialize

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-03-12 13:23:37 +08:00 committed by Petro Karashchenko
parent 19ec0b4fe3
commit 4d0fcc2526
6 changed files with 14 additions and 35 deletions

View file

@ -131,8 +131,8 @@ extern "C"
# define EXTERN extern
#endif
EXTERN in_addr_t g_ipv4_allsystems;
EXTERN in_addr_t g_ipv4_allrouters;
EXTERN const in_addr_t g_ipv4_allsystems;
EXTERN const in_addr_t g_ipv4_allrouters;
/****************************************************************************
* Public Function Prototypes
@ -272,7 +272,7 @@ void igmp_poll(FAR struct net_driver_s *dev);
****************************************************************************/
void igmp_send(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group,
FAR in_addr_t *destipaddr, uint8_t msgid);
FAR const in_addr_t *destipaddr, uint8_t msgid);
/****************************************************************************
* Name: igmp_joingroup
@ -359,7 +359,7 @@ bool igmp_cmptimer(FAR struct igmp_group_s *group, int maxticks);
*
****************************************************************************/
void igmp_addmcastmac(FAR struct net_driver_s *dev, FAR in_addr_t *ip);
void igmp_addmcastmac(FAR struct net_driver_s *dev, FAR const in_addr_t *ip);
/****************************************************************************
* Name: igmp_removemcastmac
@ -369,7 +369,8 @@ void igmp_addmcastmac(FAR struct net_driver_s *dev, FAR in_addr_t *ip);
*
****************************************************************************/
void igmp_removemcastmac(FAR struct net_driver_s *dev, FAR in_addr_t *ip);
void igmp_removemcastmac(FAR struct net_driver_s *dev,
FAR const in_addr_t *ip);
#undef EXTERN
#ifdef __cplusplus

View file

@ -59,29 +59,13 @@
* Public Data
****************************************************************************/
in_addr_t g_ipv4_allsystems;
in_addr_t g_ipv4_allrouters;
const in_addr_t g_ipv4_allsystems = HTONL(0xe0000001);
const in_addr_t g_ipv4_allrouters = HTONL(0xe0000002);
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: igmp_initialize
*
* Description:
* Perform one-time IGMP initialization.
*
****************************************************************************/
void igmp_initialize(void)
{
ninfo("IGMP initializing\n");
net_ipaddr(g_ipv4_allrouters, 224, 0, 0, 2);
net_ipaddr(g_ipv4_allsystems, 224, 0, 0, 1);
}
/****************************************************************************
* Name: igmp_devinit
*

View file

@ -70,7 +70,7 @@
*
****************************************************************************/
static void igmp_mcastmac(in_addr_t *ip, FAR uint8_t *mac)
static void igmp_mcastmac(FAR const in_addr_t *ip, FAR uint8_t *mac)
{
/* This mapping is from the IETF IN RFC 1700 */
@ -97,7 +97,7 @@ static void igmp_mcastmac(in_addr_t *ip, FAR uint8_t *mac)
*
****************************************************************************/
void igmp_addmcastmac(FAR struct net_driver_s *dev, FAR in_addr_t *ip)
void igmp_addmcastmac(FAR struct net_driver_s *dev, FAR const in_addr_t *ip)
{
uint8_t mcastmac[6];
@ -117,7 +117,8 @@ void igmp_addmcastmac(FAR struct net_driver_s *dev, FAR in_addr_t *ip)
*
****************************************************************************/
void igmp_removemcastmac(FAR struct net_driver_s *dev, FAR in_addr_t *ip)
void igmp_removemcastmac(FAR struct net_driver_s *dev,
FAR const in_addr_t *ip)
{
uint8_t mcastmac[6];

View file

@ -90,7 +90,7 @@
static inline void igmp_sched_send(FAR struct net_driver_s *dev,
FAR struct igmp_group_s *group)
{
in_addr_t *dest;
FAR const in_addr_t *dest;
/* REVISIT: This should be deferred to a work queue */

View file

@ -102,7 +102,7 @@ static uint16_t igmp_chksum(FAR uint8_t *buffer, int buflen)
****************************************************************************/
void igmp_send(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group,
FAR in_addr_t *destipaddr, uint8_t msgid)
FAR const in_addr_t *destipaddr, uint8_t msgid)
{
FAR struct igmp_iphdr_s *ipv4 = IPv4BUF;
FAR struct igmp_hdr_s *igmp;

View file

@ -43,7 +43,6 @@
#include "ieee802154/ieee802154.h"
#include "can/can.h"
#include "netlink/netlink.h"
#include "igmp/igmp.h"
#include "route/route.h"
#include "usrsock/usrsock.h"
@ -158,12 +157,6 @@ void net_initialize(void)
#endif
#endif
#ifdef CONFIG_NET_IGMP
/* Initialize IGMP support */
igmp_initialize();
#endif
#ifdef CONFIG_NET_ROUTE
/* Initialize the routing table */