MCPcopy Create free account
hub / github.com/ElementsProject/lightning / connectd_msg

Function connectd_msg

lightningd/connect_control.c:535–607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533}
534
535static unsigned connectd_msg(struct subd *connectd, const u8 *msg, const int *fds)
536{
537 enum connectd_wire t = fromwire_peektype(msg);
538
539 switch (t) {
540 /* These are messages we send, not them. */
541 case WIRE_CONNECTD_INIT:
542 case WIRE_CONNECTD_ACTIVATE:
543 case WIRE_CONNECTD_CONNECT_TO_PEER:
544 case WIRE_CONNECTD_DOWNGRADE_PEER:
545 case WIRE_CONNECTD_DISCONNECT_PEER:
546 case WIRE_CONNECTD_DEV_MEMLEAK:
547 case WIRE_CONNECTD_DEV_SUPPRESS_GOSSIP:
548 case WIRE_CONNECTD_DEV_REPORT_FDS:
549 case WIRE_CONNECTD_PEER_SEND_MSG:
550 case WIRE_CONNECTD_PEER_CONNECT_SUBD:
551 case WIRE_CONNECTD_PING:
552 case WIRE_CONNECTD_SEND_ONIONMSG:
553 case WIRE_CONNECTD_INJECT_ONIONMSG:
554 case WIRE_CONNECTD_CUSTOMMSG_OUT:
555 case WIRE_CONNECTD_START_SHUTDOWN:
556 case WIRE_CONNECTD_SET_CUSTOMMSGS:
557 case WIRE_CONNECTD_DEV_EXHAUST_FDS:
558 case WIRE_CONNECTD_DEV_SET_MAX_SCIDS_ENCODE_SIZE:
559 case WIRE_CONNECTD_SCID_MAP:
560 case WIRE_CONNECTD_CUSTOMMSG_IN_COMPLETE:
561 /* This is a reply, so never gets through to here. */
562 case WIRE_CONNECTD_INIT_REPLY:
563 case WIRE_CONNECTD_ACTIVATE_REPLY:
564 case WIRE_CONNECTD_DEV_MEMLEAK_REPLY:
565 case WIRE_CONNECTD_START_SHUTDOWN_REPLY:
566 case WIRE_CONNECTD_INJECT_ONIONMSG_REPLY:
567 break;
568
569 case WIRE_CONNECTD_PEER_CONNECTED:
570 case WIRE_CONNECTD_PEER_RECONNECTED:
571 handle_peer_connected(connectd->ld, msg);
572 break;
573
574 case WIRE_CONNECTD_PEER_SPOKE:
575 handle_peer_spoke(connectd->ld, msg);
576 break;
577
578 case WIRE_CONNECTD_PEER_DISCONNECTED:
579 handle_peer_disconnected(connectd->ld, msg);
580 break;
581
582 case WIRE_CONNECTD_CONNECT_FAILED:
583 handle_connect_failed(connectd->ld, msg);
584 break;
585
586 case WIRE_CONNECTD_GOT_ONIONMSG_TO_US:
587 handle_onionmsg_to_us(connectd->ld, msg);
588 break;
589
590 case WIRE_CONNECTD_CUSTOMMSG_IN:
591 handle_custommsg_in(connectd->ld, msg);
592 break;

Callers

nothing calls this directly

Calls 10

fromwire_peektypeFunction · 0.85
handle_peer_connectedFunction · 0.85
handle_peer_spokeFunction · 0.85
handle_peer_disconnectedFunction · 0.85
handle_connect_failedFunction · 0.85
handle_onionmsg_to_usFunction · 0.85
handle_custommsg_inFunction · 0.85
handle_ping_doneFunction · 0.85
handle_ping_latencyFunction · 0.85

Tested by

no test coverage detected