| 102 | #define WID_GRP (Wflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */ |
| 103 | |
| 104 | void |
| 105 | mroute6pr() |
| 106 | { |
| 107 | struct mf6c *mf6ctable[MF6CTBLSIZ], *mfcp; |
| 108 | struct mif6_sctl mif6table[MAXMIFS]; |
| 109 | struct mf6c mfc; |
| 110 | struct rtdetq rte, *rtep; |
| 111 | struct mif6_sctl *mifp; |
| 112 | mifi_t mifi; |
| 113 | int i; |
| 114 | int banner_printed; |
| 115 | int saved_numeric_addr; |
| 116 | mifi_t maxmif = 0; |
| 117 | long int waitings; |
| 118 | size_t len; |
| 119 | |
| 120 | if (live == 0) |
| 121 | return; |
| 122 | |
| 123 | len = sizeof(mif6table); |
| 124 | if (sysctlbyname("net.inet6.ip6.mif6table", mif6table, &len, NULL, 0) < |
| 125 | 0) { |
| 126 | xo_warn("sysctl: net.inet6.ip6.mif6table"); |
| 127 | return; |
| 128 | } |
| 129 | |
| 130 | saved_numeric_addr = numeric_addr; |
| 131 | numeric_addr = 1; |
| 132 | banner_printed = 0; |
| 133 | |
| 134 | for (mifi = 0, mifp = mif6table; mifi < MAXMIFS; ++mifi, ++mifp) { |
| 135 | char ifname[IFNAMSIZ]; |
| 136 | |
| 137 | if (mifp->m6_ifp == 0) |
| 138 | continue; |
| 139 | |
| 140 | maxmif = mifi; |
| 141 | if (!banner_printed) { |
| 142 | xo_open_list("multicast-interface"); |
| 143 | xo_emit("\n{T:IPv6 Multicast Interface Table}\n" |
| 144 | "{T: Mif Rate PhyIF Pkts-In Pkts-Out}\n"); |
| 145 | banner_printed = 1; |
| 146 | } |
| 147 | |
| 148 | xo_open_instance("multicast-interface"); |
| 149 | xo_emit(" {:mif/%2u} {:rate-limit/%4d}", |
| 150 | mifi, mifp->m6_rate_limit); |
| 151 | xo_emit(" {:ifname/%5s}", (mifp->m6_flags & MIFF_REGISTER) ? |
| 152 | "reg0" : if_indextoname(mifp->m6_ifp, ifname)); |
| 153 | |
| 154 | xo_emit(" {:received-packets/%9ju} {:sent-packets/%9ju}\n", |
| 155 | (uintmax_t)mifp->m6_pkt_in, |
| 156 | (uintmax_t)mifp->m6_pkt_out); |
| 157 | xo_close_instance("multicast-interface"); |
| 158 | } |
| 159 | if (banner_printed) |
| 160 | xo_open_list("multicast-interface"); |
| 161 | else |
no test coverage detected