| 250 | } |
| 251 | |
| 252 | static void |
| 253 | print_nhgrp_sysctl(int fibnum, int af) |
| 254 | { |
| 255 | struct nhops_dump nd; |
| 256 | struct nhgrp_external *nhg; |
| 257 | struct rt_msghdr *rtm; |
| 258 | |
| 259 | dump_nhgrp_sysctl(fibnum, af, &nd); |
| 260 | |
| 261 | xo_open_container("nhgrp-table"); |
| 262 | xo_open_list("rt-family"); |
| 263 | if (nd.nh_count > 0) { |
| 264 | wid_gw = WID_GW_DEFAULT(af); |
| 265 | xo_open_instance("rt-family"); |
| 266 | pr_family(af); |
| 267 | xo_open_list("nhgrp-entry"); |
| 268 | |
| 269 | print_nhgroup_header(af); |
| 270 | |
| 271 | for (size_t i = 0; i < nd.nh_count; i++) { |
| 272 | rtm = nd.nh_map[i].rtm; |
| 273 | nhg = (struct nhgrp_external *)(rtm + 1); |
| 274 | print_nhgroup_entry_sysctl("nhgrp-entry", rtm, nhg); |
| 275 | } |
| 276 | } |
| 277 | xo_close_list("rt-family"); |
| 278 | xo_close_container("nhgrp-table"); |
| 279 | free(nd.nh_buf); |
| 280 | } |
| 281 | |
| 282 | static void |
| 283 | update_global_map(struct nhop_external *nh) |
no test coverage detected