| 1011 | } |
| 1012 | |
| 1013 | static int |
| 1014 | dump_rt_6(struct rt_rule_6 *rt) |
| 1015 | { |
| 1016 | FILE *f; |
| 1017 | uint32_t i; |
| 1018 | |
| 1019 | f = fopen(config.routes_file_s, "w"); |
| 1020 | if (f == NULL) { |
| 1021 | printf("Can not open file %s\n", config.routes_file_s); |
| 1022 | return -1; |
| 1023 | } |
| 1024 | |
| 1025 | for (i = 0; i < config.nb_routes; i++) { |
| 1026 | fprintf(f, NIPQUAD6_FMT"/%d %"PRIu64"\n", NIPQUAD6(rt[i].addr), |
| 1027 | rt[i].depth, rt[i].nh); |
| 1028 | |
| 1029 | } |
| 1030 | fclose(f); |
| 1031 | return 0; |
| 1032 | } |
| 1033 | |
| 1034 | static int |
| 1035 | run_v6(void) |