Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/in6_var.h
Show First 20 Lines • Show All 596 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* IPv6 multicast PCB-layer group filter descriptor. | * IPv6 multicast PCB-layer group filter descriptor. | ||||
*/ | */ | ||||
struct in6_mfilter { | struct in6_mfilter { | ||||
struct ip6_msource_tree im6f_sources; /* source list for (S,G) */ | struct ip6_msource_tree im6f_sources; /* source list for (S,G) */ | ||||
u_long im6f_nsrc; /* # of source entries */ | u_long im6f_nsrc; /* # of source entries */ | ||||
uint8_t im6f_st[2]; /* state before/at commit */ | uint8_t im6f_st[2]; /* state before/at commit */ | ||||
struct in6_multi *im6f_in6m; /* associated multicast address */ | |||||
STAILQ_ENTRY(in6_mfilter) im6f_entry; /* list entry */ | |||||
}; | }; | ||||
/* | |||||
* Helper types and functions for IPv4 multicast filters. | |||||
*/ | |||||
typedef STAILQ_HEAD(, in6_mfilter) ip6_mfilter_head_t; | |||||
struct in6_mfilter * ip6_alloc_mfilter(int mflags, int st0, int st1); | |||||
void ip6_free_mfilter(struct in6_mfilter *); | |||||
static inline struct in6_mfilter * | |||||
ip6_first_mfilter(const ip6_mfilter_head_t *head) | |||||
{ | |||||
return (STAILQ_FIRST(head)); | |||||
} | |||||
static inline void | |||||
ip6_insert_mfilter(ip6_mfilter_head_t *head, struct in6_mfilter *imf) | |||||
{ | |||||
STAILQ_INSERT_TAIL(head, imf, im6f_entry); | |||||
} | |||||
static inline void | |||||
ip6_remove_mfilter(ip6_mfilter_head_t *head, struct in6_mfilter *imf) | |||||
{ | |||||
STAILQ_REMOVE(head, imf, in6_mfilter, im6f_entry); | |||||
} | |||||
static inline bool | |||||
ip6_next_mfilter(const ip6_mfilter_head_t *head, struct in6_mfilter **ppimf) | |||||
{ | |||||
if (*ppimf == NULL) | |||||
*ppimf = STAILQ_FIRST(head); | |||||
else | |||||
*ppimf = STAILQ_NEXT(*ppimf, im6f_entry); | |||||
return (*ppimf != NULL); | |||||
} | |||||
/* | /* | ||||
* Legacy KAME IPv6 multicast membership descriptor. | * Legacy KAME IPv6 multicast membership descriptor. | ||||
*/ | */ | ||||
struct in6_multi_mship { | struct in6_multi_mship { | ||||
struct in6_multi *i6mm_maddr; | struct in6_multi *i6mm_maddr; | ||||
LIST_ENTRY(in6_multi_mship) i6mm_chain; | LIST_ENTRY(in6_multi_mship) i6mm_chain; | ||||
}; | }; | ||||
Show All 21 Lines | |||||
* w/o breaking the ABI for ifmcstat. | * w/o breaking the ABI for ifmcstat. | ||||
*/ | */ | ||||
struct in6_multi { | struct in6_multi { | ||||
struct in6_addr in6m_addr; /* IPv6 multicast address */ | struct in6_addr in6m_addr; /* IPv6 multicast address */ | ||||
struct ifnet *in6m_ifp; /* back pointer to ifnet */ | struct ifnet *in6m_ifp; /* back pointer to ifnet */ | ||||
struct ifmultiaddr *in6m_ifma; /* back pointer to ifmultiaddr */ | struct ifmultiaddr *in6m_ifma; /* back pointer to ifmultiaddr */ | ||||
u_int in6m_refcount; /* reference count */ | u_int in6m_refcount; /* reference count */ | ||||
u_int in6m_state; /* state of the membership */ | u_int in6m_state; /* state of the membership */ | ||||
u_int in6m_timer; /* MLD6 listener report timer */ | u_int in6m_timer; /* MLD6 listener report timer */ | ||||
markj: Should be IP6_MFILTER_FOREACH. | |||||
/* New fields for MLDv2 follow. */ | /* New fields for MLDv2 follow. */ | ||||
struct mld_ifsoftc *in6m_mli; /* MLD info */ | struct mld_ifsoftc *in6m_mli; /* MLD info */ | ||||
SLIST_ENTRY(in6_multi) in6m_nrele; /* to-be-released by MLD */ | SLIST_ENTRY(in6_multi) in6m_nrele; /* to-be-released by MLD */ | ||||
Done Inline ActionsI think it would be a bit simpler to just store a count of the filters in the moptions structure. markj: I think it would be a bit simpler to just store a count of the filters in the moptions… | |||||
Done Inline ActionsThe STAILQ() is already traversed several times, so there is no real benefit of keeping a separate counter. Can this change be made separately later on? hselasky: The STAILQ() is already traversed several times, so there is no real benefit of keeping a… | |||||
SLIST_ENTRY(in6_multi) in6m_defer; /* deferred MLDv1 */ | SLIST_ENTRY(in6_multi) in6m_defer; /* deferred MLDv1 */ | ||||
struct ip6_msource_tree in6m_srcs; /* tree of sources */ | struct ip6_msource_tree in6m_srcs; /* tree of sources */ | ||||
u_long in6m_nsrc; /* # of tree entries */ | u_long in6m_nsrc; /* # of tree entries */ | ||||
struct mbufq in6m_scq; /* queue of pending | struct mbufq in6m_scq; /* queue of pending | ||||
* state-change packets */ | * state-change packets */ | ||||
struct timeval in6m_lastgsrtv; /* last G-S-R query */ | struct timeval in6m_lastgsrtv; /* last G-S-R query */ | ||||
uint16_t in6m_sctimer; /* state-change timer */ | uint16_t in6m_sctimer; /* state-change timer */ | ||||
▲ Show 20 Lines • Show All 221 Lines • Show Last 20 Lines |
Should be IP6_MFILTER_FOREACH.