| 348 | |
| 349 | |
| 350 | static inline int calc_routeset_len(struct rte* list, str* contact) |
| 351 | { |
| 352 | struct rte* ptr; |
| 353 | int ret; |
| 354 | |
| 355 | if (list || contact) { |
| 356 | ret = ROUTE_PREFIX_LEN + CRLF_LEN; |
| 357 | } else { |
| 358 | return 0; |
| 359 | } |
| 360 | |
| 361 | ptr = list; |
| 362 | while(ptr) { |
| 363 | if (ptr != list) { |
| 364 | ret += ROUTE_SEPARATOR_LEN; |
| 365 | } |
| 366 | ret += ptr->ptr->len; |
| 367 | ptr = ptr->next; |
| 368 | } |
| 369 | |
| 370 | if (contact) { |
| 371 | if (list) ret += ROUTE_SEPARATOR_LEN; |
| 372 | ret += 2 + contact->len; |
| 373 | } |
| 374 | |
| 375 | return ret; |
| 376 | } |
| 377 | |
| 378 | |
| 379 | /* |