net/igmp: Remove igmp_initialize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
19ec0b4fe3
commit
4d0fcc2526
6 changed files with 14 additions and 35 deletions
|
@ -131,8 +131,8 @@ extern "C"
|
||||||
# define EXTERN extern
|
# define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EXTERN in_addr_t g_ipv4_allsystems;
|
EXTERN const in_addr_t g_ipv4_allsystems;
|
||||||
EXTERN in_addr_t g_ipv4_allrouters;
|
EXTERN const in_addr_t g_ipv4_allrouters;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* 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,
|
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
|
* 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
|
* 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
|
#undef EXTERN
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -59,29 +59,13 @@
|
||||||
* Public Data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
in_addr_t g_ipv4_allsystems;
|
const in_addr_t g_ipv4_allsystems = HTONL(0xe0000001);
|
||||||
in_addr_t g_ipv4_allrouters;
|
const in_addr_t g_ipv4_allrouters = HTONL(0xe0000002);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* 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
|
* Name: igmp_devinit
|
||||||
*
|
*
|
||||||
|
|
|
@ -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 */
|
/* 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];
|
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];
|
uint8_t mcastmac[6];
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
static inline void igmp_sched_send(FAR struct net_driver_s *dev,
|
static inline void igmp_sched_send(FAR struct net_driver_s *dev,
|
||||||
FAR struct igmp_group_s *group)
|
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 */
|
/* REVISIT: This should be deferred to a work queue */
|
||||||
|
|
||||||
|
|
|
@ -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,
|
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_iphdr_s *ipv4 = IPv4BUF;
|
||||||
FAR struct igmp_hdr_s *igmp;
|
FAR struct igmp_hdr_s *igmp;
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
#include "ieee802154/ieee802154.h"
|
#include "ieee802154/ieee802154.h"
|
||||||
#include "can/can.h"
|
#include "can/can.h"
|
||||||
#include "netlink/netlink.h"
|
#include "netlink/netlink.h"
|
||||||
#include "igmp/igmp.h"
|
|
||||||
#include "route/route.h"
|
#include "route/route.h"
|
||||||
#include "usrsock/usrsock.h"
|
#include "usrsock/usrsock.h"
|
||||||
|
|
||||||
|
@ -158,12 +157,6 @@ void net_initialize(void)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
|
||||||
/* Initialize IGMP support */
|
|
||||||
|
|
||||||
igmp_initialize();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_NET_ROUTE
|
#ifdef CONFIG_NET_ROUTE
|
||||||
/* Initialize the routing table */
|
/* Initialize the routing table */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue