| 482 | } |
| 483 | |
| 484 | static unsigned connectd_msg(struct subd *connectd, const u8 *msg, const int *fds) |
| 485 | { |
| 486 | enum connectd_wire t = fromwire_peektype(msg); |
| 487 | |
| 488 | switch (t) { |
| 489 | /* These are messages we send, not them. */ |
| 490 | case WIRE_CONNECTD_INIT: |
| 491 | case WIRE_CONNECTD_ACTIVATE: |
| 492 | case WIRE_CONNECTD_CONNECT_TO_PEER: |
| 493 | case WIRE_CONNECTD_DISCARD_PEER: |
| 494 | case WIRE_CONNECTD_DEV_MEMLEAK: |
| 495 | case WIRE_CONNECTD_DEV_SUPPRESS_GOSSIP: |
| 496 | case WIRE_CONNECTD_PEER_FINAL_MSG: |
| 497 | case WIRE_CONNECTD_PEER_CONNECT_SUBD: |
| 498 | case WIRE_CONNECTD_PING: |
| 499 | case WIRE_CONNECTD_SEND_ONIONMSG: |
| 500 | case WIRE_CONNECTD_CUSTOMMSG_OUT: |
| 501 | /* This is a reply, so never gets through to here. */ |
| 502 | case WIRE_CONNECTD_INIT_REPLY: |
| 503 | case WIRE_CONNECTD_ACTIVATE_REPLY: |
| 504 | case WIRE_CONNECTD_DEV_MEMLEAK_REPLY: |
| 505 | case WIRE_CONNECTD_PING_REPLY: |
| 506 | break; |
| 507 | |
| 508 | case WIRE_CONNECTD_PEER_CONNECTED: |
| 509 | peer_connected(connectd->ld, msg); |
| 510 | break; |
| 511 | |
| 512 | case WIRE_CONNECTD_PEER_SPOKE: |
| 513 | peer_spoke(connectd->ld, msg); |
| 514 | break; |
| 515 | |
| 516 | case WIRE_CONNECTD_PEER_DISCONNECT_DONE: |
| 517 | peer_disconnect_done(connectd->ld, msg); |
| 518 | break; |
| 519 | |
| 520 | case WIRE_CONNECTD_CONNECT_FAILED: |
| 521 | handle_connect_failed(connectd->ld, msg); |
| 522 | break; |
| 523 | |
| 524 | case WIRE_CONNECTD_GOT_ONIONMSG_TO_US: |
| 525 | handle_onionmsg_to_us(connectd->ld, msg); |
| 526 | break; |
| 527 | |
| 528 | case WIRE_CONNECTD_CUSTOMMSG_IN: |
| 529 | handle_custommsg_in(connectd->ld, msg); |
| 530 | break; |
| 531 | } |
| 532 | return 0; |
| 533 | } |
| 534 | |
| 535 | static void connect_init_done(struct subd *connectd, |
| 536 | const u8 *reply, |
nothing calls this directly
no test coverage detected