From a189941da6c9df9bbf9e04f26660ca53f23ee493 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 19 Aug 2016 13:10:19 +0200 Subject: [PATCH] make igmp/mld6 filter actions an enum and define them in netif.h where the callback function prototypes are defined --- src/include/lwip/igmp.h | 7 ------- src/include/lwip/mld6.h | 5 ----- src/include/lwip/netif.h | 20 ++++++++++++++++++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/include/lwip/igmp.h b/src/include/lwip/igmp.h index 292e5c3b..cc312238 100644 --- a/src/include/lwip/igmp.h +++ b/src/include/lwip/igmp.h @@ -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 diff --git a/src/include/lwip/mld6.h b/src/include/lwip/mld6.h index 000053be..089974ae 100644 --- a/src/include/lwip/mld6.h +++ b/src/include/lwip/mld6.h @@ -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); diff --git a/src/include/lwip/netif.h b/src/include/lwip/netif.h index 593c3af4..f316116a 100644 --- a/src/include/lwip/netif.h +++ b/src/include/lwip/netif.h @@ -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.