c-libp2p/record/message_handler.c

22 lines
479 B
C
Raw Permalink Normal View History

#include "libp2p/record/message.h"
#include "libp2p/peer/peer.h"
/**
* A generic handler for different types of messages
*/
2017-08-30 16:09:28 +00:00
int libp2p_record_handler_ping(struct Libp2pPeer* peer, struct KademliaMessage* message) {
return 0;
}
2017-08-30 16:09:28 +00:00
int libp2p_record_message_handle(struct Libp2pPeer* peer, struct KademliaMessage* message) {
switch (message->message_type) {
2017-07-17 21:14:20 +00:00
case (MESSAGE_TYPE_PING):
return libp2p_record_handler_ping(peer, message);
2017-07-17 21:14:20 +00:00
default:
break;
}
return 0;
}