MCPcopy Index your code
hub / github.com/F-Stack/f-stack / mroute6pr

Function mroute6pr

tools/netstat/mroute6.c:104–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102#define WID_GRP (Wflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */
103
104void
105mroute6pr()
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

Callers 1

main.cFile · 0.85

Calls 10

sysctlbynameFunction · 0.85
xo_warnFunction · 0.85
xo_open_listFunction · 0.85
xo_emitFunction · 0.85
xo_open_instanceFunction · 0.85
if_indextonameFunction · 0.85
xo_close_instanceFunction · 0.85
xo_close_listFunction · 0.85
kreadFunction · 0.70
routenameFunction · 0.70

Tested by

no test coverage detected