#include #include "tx01_msg.hpp" #include "tx01_magic_match.hpp" const struct tx01_msg_header *tx01_try_match_msg_header(const char *ptr) { return tx01_try_match_magic(ptr); } const struct tx01_data_msg * tx01_try_match_data_msg(const struct tx01_msg_header *ptr) { if (ptr->size > sizeof(struct tx01_data_msg)) { big_int32_t *p_postamble = (big_int32_t *) ((char *)ptr + ptr->size - sizeof(big_int32_t)); if (*p_postamble == TX01_MSG_POSTAMBLE) return (struct tx01_data_msg *) ptr; } return NULL; }