Lines Matching refs:imo
153 int ip_addmembership(struct ip_moptions *imo, struct ip_mreq *mreq);
154 int ip_dropmembership(struct ip_moptions *imo, struct ip_mreq *mreq);
198 struct ip_moptions *imo,
202 error = ip_output_list(m0, 0, opt, ro, flags, imo, ipoa);
235 struct ip_moptions *imo,
290 imo = NULL;
481 imo != NULL && imo->imo_multicast_ifp != NULL) {
486 ifp = imo->imo_multicast_ifp;
625 if (imo != NULL) {
626 if ((flags & IP_RAWOUTPUT) == 0) ip->ip_ttl = imo->imo_multicast_ttl;
627 if (imo->imo_multicast_ifp != NULL) {
628 ifp = imo->imo_multicast_ifp;
631 if (imo->imo_multicast_vif != -1 &&
634 ip_mcast_src(imo->imo_multicast_vif);
641 if ((imo == NULL) || (imo->imo_multicast_vif == -1)) {
672 (imo == NULL || imo->imo_multicast_loop)) {
683 if (imo) {
685 ipf_pktopts.ippo_mcast_ifnet = imo->imo_multicast_ifp;
686 ipf_pktopts.ippo_mcast_ttl = imo->imo_multicast_ttl;
687 ipf_pktopts.ippo_mcast_loop = imo->imo_multicast_loop;
746 imo = NULL;
747 if (ip_mforward(ip, ifp, m, imo) != 0) {
2506 struct ip_moptions *imo = *imop;
2509 if (imo == NULL) {
2517 imo = *imop;
2535 imo->imo_multicast_vif = i;
2552 imo->imo_multicast_ifp = NULL;
2565 imo->imo_multicast_ifp = ifp;
2567 imo->imo_multicast_addr = addr;
2569 imo->imo_multicast_addr.s_addr = INADDR_ANY;
2584 imo->imo_multicast_ttl = ttl;
2594 imo->imo_multicast_ttl = ttl;
2610 imo->imo_multicast_loop = !!loop;
2617 imo->imo_multicast_loop = !!loop;
2630 error = ip_addmembership(imo, &mreq);
2642 error = ip_dropmembership(imo, &mreq);
2653 if (imo->imo_multicast_ifp == NULL &&
2654 imo->imo_multicast_vif == (u_long)-1 &&
2655 imo->imo_multicast_ttl == IP_DEFAULT_MULTICAST_TTL &&
2656 imo->imo_multicast_loop == IP_DEFAULT_MULTICAST_LOOP &&
2657 imo->imo_num_memberships == 0) {
2672 struct ip_moptions *imo;
2673 imo = (struct ip_moptions*) _MALLOC(sizeof(*imo), M_IPMOPTS,
2676 if (imo == NULL)
2678 *imop = imo;
2679 imo->imo_multicast_ifp = NULL;
2680 imo->imo_multicast_addr.s_addr = INADDR_ANY;
2681 imo->imo_multicast_vif = -1;
2682 imo->imo_multicast_ttl = IP_DEFAULT_MULTICAST_TTL;
2683 imo->imo_multicast_loop = IP_DEFAULT_MULTICAST_LOOP;
2684 imo->imo_num_memberships = 0;
2694 struct ip_moptions *imo,
2746 for (i = 0; i < imo->imo_num_memberships; ++i) {
2747 if (imo->imo_membership[i]->inm_ifp == ifp &&
2748 imo->imo_membership[i]->inm_addr.s_addr
2752 if (i < imo->imo_num_memberships) {
2764 if ((imo->imo_membership[i] =
2769 ++imo->imo_num_memberships;
2779 struct ip_moptions *imo,
2807 for (i = 0; i < imo->imo_num_memberships; ++i) {
2809 imo->imo_membership[i]->inm_ifp == ifp) &&
2810 imo->imo_membership[i]->inm_addr.s_addr ==
2814 if (i == imo->imo_num_memberships) {
2822 in_delmulti(&imo->imo_membership[i]);
2826 for (++i; i < imo->imo_num_memberships; ++i)
2827 imo->imo_membership[i-1] = imo->imo_membership[i];
2828 --imo->imo_num_memberships;
2837 ip_getmoptions(sopt, imo)
2839 register struct ip_moptions *imo;
2850 if (imo != NULL)
2851 optval = imo->imo_multicast_vif;
2859 if (imo == NULL || imo->imo_multicast_ifp == NULL)
2861 else if (imo->imo_multicast_addr.s_addr) {
2863 addr = imo->imo_multicast_addr;
2865 IFP_TO_IA(imo->imo_multicast_ifp, ia);
2873 if (imo == 0)
2876 optval = coptval = imo->imo_multicast_ttl;
2884 if (imo == 0)
2887 optval = coptval = imo->imo_multicast_loop;
2905 ip_freemoptions(imo)
2906 register struct ip_moptions *imo;
2910 if (imo != NULL) {
2911 for (i = 0; i < imo->imo_num_memberships; ++i)
2912 in_delmulti(&imo->imo_membership[i]);
2913 FREE(imo, M_IPMOPTS);