| 229 | } |
| 230 | |
| 231 | char *fmt_wireaddr_internal(const tal_t *ctx, |
| 232 | const struct wireaddr_internal *a) |
| 233 | { |
| 234 | switch (a->itype) { |
| 235 | case ADDR_INTERNAL_SOCKNAME: |
| 236 | return tal_fmt(ctx, "%s", a->u.sockname); |
| 237 | case ADDR_INTERNAL_ALLPROTO: |
| 238 | return tal_fmt(ctx, "%s:%u", a->u.allproto.is_websocket ? "(ws)": "", |
| 239 | a->u.allproto.port); |
| 240 | case ADDR_INTERNAL_WIREADDR: |
| 241 | if (a->u.wireaddr.is_websocket) |
| 242 | return tal_fmt(ctx, "(ws)%s", |
| 243 | fmt_wireaddr(tmpctx, &a->u.wireaddr.wireaddr)); |
| 244 | return fmt_wireaddr(ctx, &a->u.wireaddr.wireaddr); |
| 245 | case ADDR_INTERNAL_FORPROXY: |
| 246 | return tal_fmt(ctx, "%s:%u", |
| 247 | a->u.unresolved.name, a->u.unresolved.port); |
| 248 | case ADDR_INTERNAL_AUTOTOR: |
| 249 | return tal_fmt(ctx, "autotor:%s", |
| 250 | fmt_wireaddr(tmpctx, &a->u.torservice.address)); |
| 251 | case ADDR_INTERNAL_STATICTOR: |
| 252 | return tal_fmt(ctx, "statictor:%s", |
| 253 | fmt_wireaddr(tmpctx, &a->u.torservice.address)); |
| 254 | } |
| 255 | abort(); |
| 256 | } |
| 257 | |
| 258 | char *fmt_wireaddr_without_port(const tal_t * ctx, const struct wireaddr *a) |
| 259 | { |
no test coverage detected