| 39 | |
| 40 | |
| 41 | /* |
| 42 | * prefGlobalCmp() |
| 43 | */ |
| 44 | int |
| 45 | prefGlobalCmp(const void *elem1, const void *elem2){ |
| 46 | struct PrefixV4 *el1 = (struct PrefixV4 *) elem1; |
| 47 | struct PrefixV4 *el2 = (struct PrefixV4 *) elem2; |
| 48 | if ( el1->beginning >= el2->beginning && el1->beginning <= el2->end ) { |
| 49 | return 0; |
| 50 | } else if (el1->beginning < el2->beginning) { |
| 51 | return -1; |
| 52 | } else if (el1->beginning > el2->end) { |
| 53 | return 1; |
| 54 | } else { |
| 55 | syslog(LOG_ERR,"You have won !!! This case doesn't exist !!!!"); |
| 56 | exit(1); |
| 57 | return 0; |
| 58 | } |
| 59 | } |
| 60 | |