make igmp/mld6 filter actions an enum and define them in netif.h where the callback function prototypes are defined

This commit is contained in:
goldsimon 2016-08-19 13:10:19 +02:00
parent f93a6e3310
commit a189941da6
3 changed files with 18 additions and 14 deletions

View File

@ -51,18 +51,11 @@
extern "C" {
#endif
/* IGMP timer */
#define IGMP_TMR_INTERVAL 100 /* Milliseconds */
#define IGMP_V1_DELAYING_MEMBER_TMR (1000/IGMP_TMR_INTERVAL)
#define IGMP_JOIN_DELAYING_MEMBER_TMR (500 /IGMP_TMR_INTERVAL)
/* MAC Filter Actions, these are passed to a netif's
* igmp_mac_filter callback function. */
#define IGMP_DEL_MAC_FILTER 0
#define IGMP_ADD_MAC_FILTER 1
/**
* igmp group structure - there is
* a list of groups for each interface

View File

@ -74,11 +74,6 @@ struct mld_group {
#define MLD6_TMR_INTERVAL 100 /* Milliseconds */
/* MAC Filter Actions, these are passed to a netif's
* mld_mac_filter callback function. */
#define MLD6_DEL_MAC_FILTER 0
#define MLD6_ADD_MAC_FILTER 1
err_t mld6_stop(struct netif *netif);
void mld6_report_groups(struct netif *netif);
void mld6_tmr(void);

View File

@ -181,15 +181,31 @@ typedef err_t (*netif_output_ip6_fn)(struct netif *netif, struct pbuf *p,
typedef err_t (*netif_linkoutput_fn)(struct netif *netif, struct pbuf *p);
/** Function prototype for netif status- or link-callback functions. */
typedef void (*netif_status_callback_fn)(struct netif *netif);
#if LWIP_IPV4 && LWIP_IGMP
/** MAC Filter Actions, these are passed to a netif's igmp_mac_filter callback function. */
enum netif_igmp_filter_action {
/** Delete a filter entry */
IGMP_DEL_MAC_FILTER = 0,
/** Add a filter entry */
IGMP_ADD_MAC_FILTER = 1
};
/** Function prototype for netif igmp_mac_filter functions */
typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif,
const ip4_addr_t *group, u8_t action);
const ip4_addr_t *group, enum netif_igmp_filter_action action);
#endif /* LWIP_IPV4 && LWIP_IGMP */
#if LWIP_IPV6 && LWIP_IPV6_MLD
/** MAC Filter Actions, these are passed to a netif's mld_mac_filter callback function. */
enum netif_mld6_filter_action {
/** Delete a filter entry */
MLD6_DEL_MAC_FILTER = 0,
/** Add a filter entry */
MLD6_ADD_MAC_FILTER = 1
};
/** Function prototype for netif mld_mac_filter functions */
typedef err_t (*netif_mld_mac_filter_fn)(struct netif *netif,
const ip6_addr_t *group, u8_t action);
const ip6_addr_t *group, enum netif_mld6_filter_action action);
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */
/** Generic data structure used for all lwIP network interfaces.