Lines Matching defs:illg

46 #define	IPMP_ILLGRP_TO_IPST(illg)	((illg)->ig_ipmp_ill->ill_ipst)
542 ipmp_illgrp_t *illg;
548 if ((illg = kmem_zalloc(sizeof (ipmp_illgrp_t), KM_NOSLEEP)) == NULL)
551 list_create(&illg->ig_if, sizeof (ill_t), offsetof(ill_t, ill_grpnode));
552 list_create(&illg->ig_actif, sizeof (ill_t),
554 list_create(&illg->ig_arpent, sizeof (ipmp_arpent_t),
557 illg->ig_ipmp_ill = ill;
558 ill->ill_grp = illg;
559 ipmp_illgrp_set_mtu(illg, mtu, mtu);
561 return (illg);
565 * Destroy illgrp `illg', and disconnect it from its IPMP meta-interface.
568 ipmp_illgrp_destroy(ipmp_illgrp_t *illg)
570 ASSERT(IAM_WRITER_ILL(illg->ig_ipmp_ill));
571 ASSERT(IS_IPMP(illg->ig_ipmp_ill));
574 * Verify `illg' is empty.
576 ASSERT(illg->ig_next_ill == NULL);
577 ASSERT(illg->ig_cast_ill == NULL);
578 ASSERT(list_is_empty(&illg->ig_arpent));
579 ASSERT(list_is_empty(&illg->ig_if));
580 ASSERT(list_is_empty(&illg->ig_actif));
581 ASSERT(illg->ig_nactif == 0);
584 * Destroy `illg'.
586 illg->ig_ipmp_ill->ill_grp = NULL;
587 illg->ig_ipmp_ill = NULL;
588 list_destroy(&illg->ig_if);
589 list_destroy(&illg->ig_actif);
590 list_destroy(&illg->ig_arpent);
591 kmem_free(illg, sizeof (ipmp_illgrp_t));
595 * Add `ipif' to the pool of usable data addresses on `illg' and attempt to
600 ipmp_illgrp_add_ipif(ipmp_illgrp_t *illg, ipif_t *ipif)
613 entp = ipmp_illgrp_lookup_arpent(illg, &ipif->ipif_lcl_addr);
615 ipmp_illgrp_destroy_arpent(illg, entp);
618 if ((minill = ipmp_illgrp_min_ill(illg)) != NULL)
625 * Delete `ipif' from the pool of usable data addresses on `illg'. If it's
630 ipmp_illgrp_del_ipif(ipmp_illgrp_t *illg, ipif_t *ipif)
639 maxill = ipmp_illgrp_max_ill(illg);
648 * Return the active ill with the greatest number of data addresses in `illg'.
651 ipmp_illgrp_max_ill(ipmp_illgrp_t *illg)
655 ASSERT(IAM_WRITER_ILL(illg->ig_ipmp_ill));
657 ill = list_head(&illg->ig_actif);
658 for (; ill != NULL; ill = list_next(&illg->ig_actif, ill)) {
668 * Return the active ill with the fewest number of data addresses in `illg'.
671 ipmp_illgrp_min_ill(ipmp_illgrp_t *illg)
675 ASSERT(IAM_WRITER_ILL(illg->ig_ipmp_ill));
677 ill = list_head(&illg->ig_actif);
678 for (; ill != NULL; ill = list_next(&illg->ig_actif, ill)) {
690 * Return a pointer to IPMP meta-interface for `illg' (which must exist).
691 * Since ig_ipmp_ill never changes for a given illg, no locks are needed.
694 ipmp_illgrp_ipmp_ill(ipmp_illgrp_t *illg)
696 return (illg->ig_ipmp_ill);
700 * Return a pointer to the next available underlying ill in `illg', or NULL if
704 ipmp_illgrp_next_ill(ipmp_illgrp_t *illg)
707 ip_stack_t *ipst = IPMP_ILLGRP_TO_IPST(illg);
709 ASSERT(IAM_WRITER_ILL(illg->ig_ipmp_ill));
712 if ((ill = illg->ig_next_ill) != NULL) {
713 illg->ig_next_ill = list_next(&illg->ig_actif, ill);
714 if (illg->ig_next_ill == NULL)
715 illg->ig_next_ill = list_head(&illg->ig_actif);
723 * Return a held pointer to the next available underlying ill in `illg', or
727 ipmp_illgrp_hold_next_ill(ipmp_illgrp_t *illg)
731 ip_stack_t *ipst = IPMP_ILLGRP_TO_IPST(illg);
734 for (i = 0; i < illg->ig_nactif; i++) {
735 ill = illg->ig_next_ill;
736 illg->ig_next_ill = list_next(&illg->ig_actif, ill);
737 if (illg->ig_next_ill == NULL)
738 illg->ig_next_ill = list_head(&illg->ig_actif);
751 * Return a held pointer to the nominated multicast ill in `illg', or NULL if
755 ipmp_illgrp_hold_cast_ill(ipmp_illgrp_t *illg)
758 ip_stack_t *ipst = IPMP_ILLGRP_TO_IPST(illg);
761 castill = illg->ig_cast_ill;
771 * Set the nominated cast ill on `illg' to `castill'. If `castill' is NULL,
775 ipmp_illgrp_set_cast(ipmp_illgrp_t *illg, ill_t *castill)
777 ill_t *ocastill = illg->ig_cast_ill;
778 ill_t *ipmp_ill = illg->ig_ipmp_ill;
779 ip_stack_t *ipst = IPMP_ILLGRP_TO_IPST(illg);
788 illg, ill_t *, ocastill);
811 illg->ig_cast_ill = castill;
819 illg, ill_t *, castill);
833 * Create an IPMP ARP entry and add it to the set tracked on `illg'. If an
838 ipmp_illgrp_create_arpent(ipmp_illgrp_t *illg, boolean_t proxyarp,
843 ASSERT(IAM_WRITER_ILL(illg->ig_ipmp_ill));
852 if ((oentp = ipmp_illgrp_lookup_arpent(illg, &entp->ia_ipaddr)) != NULL)
853 ipmp_illgrp_destroy_arpent(illg, oentp);
865 list_insert_head(&illg->ig_arpent, entp);
870 * Remove IPMP ARP entry `entp' from the set tracked on `illg' and destroy it.
873 ipmp_illgrp_destroy_arpent(ipmp_illgrp_t *illg, ipmp_arpent_t *entp)
875 ASSERT(IAM_WRITER_ILL(illg->ig_ipmp_ill));
877 list_remove(&illg->ig_arpent, entp);
882 * Mark that ARP has been notified about the IP address on `entp'; `illg' is
887 ipmp_illgrp_mark_arpent(ipmp_illgrp_t *illg, ipmp_arpent_t *entp)
893 * Look up the IPMP ARP entry for IP address `addrp' on `illg'; if `addrp' is
897 ipmp_illgrp_lookup_arpent(ipmp_illgrp_t *illg, ipaddr_t *addrp)
899 ipmp_arpent_t *entp = list_head(&illg->ig_arpent);
901 ASSERT(IAM_WRITER_ILL(illg->ig_ipmp_ill));
906 for (; entp != NULL; entp = list_next(&illg->ig_arpent, entp))
913 * Refresh ARP entries on `illg' to be distributed across its active
918 ipmp_illgrp_refresh_arpent(ipmp_illgrp_t *illg)
920 ill_t *ill, *ipmp_ill = illg->ig_ipmp_ill;
929 ill = list_head(&illg->ig_actif);
930 entp = list_head(&illg->ig_arpent);
931 for (; entp != NULL; entp = list_next(&illg->ig_arpent, entp)) {
964 ipmp_illgrp_mark_arpent(illg, entp);
966 if ((ill = list_next(&illg->ig_actif, ill)) == NULL)
967 ill = list_head(&illg->ig_actif);
972 * Return an interface in `illg' with the specified `physaddr', or NULL if one
976 ipmp_illgrp_find_ill(ipmp_illgrp_t *illg, uchar_t *physaddr, uint_t paddrlen)
979 ill_t *ipmp_ill = illg->ig_ipmp_ill;
980 ip_stack_t *ipst = IPMP_ILLGRP_TO_IPST(illg);
984 ill = list_head(&illg->ig_if);
985 for (; ill != NULL; ill = list_next(&illg->ig_if, ill)) {
998 ipmp_illgrp_set_mtu(ipmp_illgrp_t *illg, uint_t mtu, uint_t mc_mtu)
1000 ill_t *ill = illg->ig_ipmp_ill;
1003 ASSERT(illg->ig_mtu == 0 || IAM_WRITER_ILL(ill));
1009 illg->ig_mtu = mtu;
1010 illg->ig_mc_mtu = mc_mtu;
1016 * Recalculate the IPMP group MTU for `illg', and update its associated IPMP
1020 ipmp_illgrp_refresh_mtu(ipmp_illgrp_t *illg)
1023 ill_t *ipmp_ill = illg->ig_ipmp_ill;
1035 ill = list_head(&illg->ig_if);
1036 for (; ill != NULL; ill = list_next(&illg->ig_if, ill)) {
1050 if (illg->ig_mtu != mtu || illg->ig_mc_mtu != mc_mtu)
1051 ipmp_illgrp_set_mtu(illg, mtu, mc_mtu);
1055 * Link illgrp `illg' to IPMP group `grp'. To simplify the caller, silently
1059 ipmp_illgrp_link_grp(ipmp_illgrp_t *illg, ipmp_grp_t *grp)
1061 ip_stack_t *ipst = IPMP_ILLGRP_TO_IPST(illg);
1065 if (illg->ig_ipmp_ill->ill_isv6) {
1066 ASSERT(grp->gr_v6 == NULL || grp->gr_v6 == illg);
1067 grp->gr_v6 = illg;
1069 ASSERT(grp->gr_v4 == NULL || grp->gr_v4 == illg);
1070 grp->gr_v4 = illg;
1075 * Unlink illgrp `illg' from its IPMP group. Return an errno if the illgrp
1079 ipmp_illgrp_unlink_grp(ipmp_illgrp_t *illg)
1081 ipmp_grp_t *grp = illg->ig_ipmp_ill->ill_phyint->phyint_grp;
1082 ip_stack_t *ipst = IPMP_ILLGRP_TO_IPST(illg);
1086 if (illg->ig_ipmp_ill->ill_isv6) {
1099 * Place `ill' into `illg', and rebalance the data addresses on `illg'
1104 ipmp_ill_join_illgrp(ill_t *ill, ipmp_illgrp_t *illg)
1115 ipmp_ill = illg->ig_ipmp_ill;
1164 if (list_is_empty(&illg->ig_if)) {
1181 ipmp_illgrp_set_mtu(illg, ill->ill_mtu, ill->ill_mc_mtu);
1192 if (illg->ig_mtu > ill->ill_mtu ||
1193 illg->ig_mc_mtu > ill->ill_mc_mtu) {
1194 ipmp_illgrp_set_mtu(illg, ill->ill_mtu,
1200 list_insert_tail(&illg->ig_if, ill);
1201 ill->ill_grp = illg;
1228 ipmp_illgrp_t *illg = ill->ill_grp;
1229 ip_stack_t *ipst = IPMP_ILLGRP_TO_IPST(illg);
1233 ASSERT(illg != NULL);
1235 ipmp_ill = illg->ig_ipmp_ill;
1272 list_remove(&illg->ig_if, ill);
1287 ipmp_illgrp_refresh_mtu(illg);
1289 if (list_is_empty(&illg->ig_if)) {
1295 while ((entp = ipmp_illgrp_lookup_arpent(illg, NULL)) != NULL)
1296 ipmp_illgrp_destroy_arpent(illg, entp);
1311 ill = list_head(&illg->ig_if);
1315 } while ((ill = list_next(&illg->ig_if, ill)) != NULL);
1428 ipmp_illgrp_t *illg = ill->ill_grp;
1430 ip_stack_t *ipst = IPMP_ILLGRP_TO_IPST(illg);
1446 if (list_is_empty(&illg->ig_actif)) {
1453 ipmp_illgrp_set_cast(illg, ill);
1460 ipif = illg->ig_ipmp_ill->ill_ipif;
1471 maxill = ipmp_illgrp_max_ill(illg);
1484 list_insert_tail(&illg->ig_actif, ill);
1485 illg->ig_nactif++;
1486 illg->ig_next_ill = ill;
1493 ipmp_illgrp_refresh_arpent(illg);
1501 put(illg->ig_ipmp_ill->ill_rq, linkupmp);
1520 ipmp_illgrp_t *illg = ill->ill_grp;
1521 ip_stack_t *ipst = IPMP_ILLGRP_TO_IPST(illg);
1526 ipmp_ill = illg->ig_ipmp_ill;
1532 list_remove(&illg->ig_actif, ill);
1533 illg->ig_nactif--;
1534 illg->ig_next_ill = list_head(&illg->ig_actif);
1541 if (ill == illg->ig_cast_ill)
1542 ipmp_illgrp_set_cast(illg, list_head(&illg->ig_actif));
1567 ipmp_illgrp_refresh_arpent(illg);
1579 if ((minill = ipmp_illgrp_min_ill(illg)) != NULL)
1831 ipmp_illgrp_t *illg;
1836 illg = ill->ill_grp;
1837 if (illg != NULL && ill_check_and_refhold(illg->ig_ipmp_ill)) {
1839 return (illg->ig_ipmp_ill);
2198 ipmp_illgrp_t *illg = ncec->ncec_ill->ill_grp;
2214 ill = list_head(&illg->ig_if);
2215 for (; ill != NULL; ill = list_next(&illg->ig_if, ill))
2232 ipmp_illgrp_t *illg = ncec->ncec_ill->ill_grp;
2255 ill = list_head(&illg->ig_actif);
2256 for (; ill != NULL; ill = list_next(&illg->ig_actif, ill)) {