* Print the route set */
| 380 | * Print the route set |
| 381 | */ |
| 382 | static inline char* print_rs(char* p, struct rte* list, str* contact) |
| 383 | { |
| 384 | struct rte* ptr; |
| 385 | |
| 386 | if (list || contact) { |
| 387 | append_string(p, ROUTE_PREFIX, ROUTE_PREFIX_LEN); |
| 388 | } else { |
| 389 | return p; |
| 390 | } |
| 391 | |
| 392 | ptr = list; |
| 393 | while(ptr) { |
| 394 | if (ptr != list) { |
| 395 | append_string(p, ROUTE_SEPARATOR, ROUTE_SEPARATOR_LEN); |
| 396 | } |
| 397 | |
| 398 | append_string(p, ptr->ptr->nameaddr.name.s, ptr->ptr->len); |
| 399 | ptr = ptr->next; |
| 400 | } |
| 401 | |
| 402 | if (contact) { |
| 403 | if (list) append_string(p, ROUTE_SEPARATOR, ROUTE_SEPARATOR_LEN); |
| 404 | *p++ = '<'; |
| 405 | append_string(p, contact->s, contact->len); |
| 406 | *p++ = '>'; |
| 407 | } |
| 408 | |
| 409 | append_string(p, CRLF, CRLF_LEN); |
| 410 | return p; |
| 411 | } |
| 412 | |
| 413 | |
| 414 | /* |