sort based on the weight of the gws */
| 2938 | |
| 2939 | /* sort based on the weight of the gws */ |
| 2940 | static void weight_based_sort_cb(void *params) |
| 2941 | { |
| 2942 | pgw_list_t *pgwl; |
| 2943 | int size; |
| 2944 | int rc; |
| 2945 | unsigned short *sorted_dst; |
| 2946 | struct dr_sort_params *dsp = (struct dr_sort_params *)params; |
| 2947 | |
| 2948 | rc = get_pgwl_params(dsp, &pgwl, &size, &sorted_dst); |
| 2949 | if (rc < 0) { |
| 2950 | LM_WARN("failed to sort\n"); |
| 2951 | dsp->rc = -1; |
| 2952 | return; |
| 2953 | } |
| 2954 | |
| 2955 | if (weight_based_sort(pgwl, size, sorted_dst) < 0) |
| 2956 | dsp->rc = -1; |
| 2957 | else |
| 2958 | dsp->rc = 0; |
| 2959 | } |
| 2960 | |
| 2961 | /* sort based on the weight of the gws */ |
| 2962 | static int weight_based_sort(pgw_list_t *pgwl, int size, unsigned short *idx) |
nothing calls this directly
no test coverage detected