c-libp2p/record/message_handler.c
2017-02-22 10:55:39 -05:00

19 lines
453 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 Libp2pMessage* message) {
return 0;
}
int libp2p_record_message_handle(struct Libp2pPeer* peer, struct Libp2pMessage* message) {
switch (message->message_type) {
case (MESSAGE_TYPE_PING):
return libp2p_record_handler_ping(peer, message);
}
return 0;
}