| 805 | } |
| 806 | |
| 807 | static int |
| 808 | dump_rt_4(struct rt_rule_4 *rt) |
| 809 | { |
| 810 | FILE *f; |
| 811 | uint32_t i; |
| 812 | |
| 813 | f = fopen(config.routes_file_s, "w"); |
| 814 | if (f == NULL) { |
| 815 | printf("Can not open file %s\n", config.routes_file_s); |
| 816 | return -1; |
| 817 | } |
| 818 | |
| 819 | for (i = 0; i < config.nb_routes; i++) |
| 820 | fprintf(f, NIPQUAD_FMT"/%d %"PRIu64"\n", NIPQUAD(rt[i].addr), |
| 821 | rt[i].depth, rt[i].nh); |
| 822 | |
| 823 | fclose(f); |
| 824 | return 0; |
| 825 | } |
| 826 | |
| 827 | static inline void |
| 828 | print_depth_err(void) |