c-libp2p/record/message_handler.c
2017-08-30 11:09:28 -05:00

21 lines
479 B
C

#include "libp2p/record/message.h"
#include "libp2p/peer/peer.h"
/**
* A generic handler for different types of messages
*/
int libp2p_record_handler_ping(struct Libp2pPeer* peer, struct KademliaMessage* message) {
return 0;
}
int libp2p_record_message_handle(struct Libp2pPeer* peer, struct KademliaMessage* message) {
switch (message->message_type) {
case (MESSAGE_TYPE_PING):
return libp2p_record_handler_ping(peer, message);
default:
break;
}
return 0;
}