dns: register logger functions

pull/2081/head
Mats Klepsland 9 years ago committed by Victor Julien
parent 1f98915ebe
commit dacb860d24

@ -236,6 +236,21 @@ int DNSGetAlstateProgress(void *tx, uint8_t direction)
}
}
void DNSSetTxLogged(void *alstate, void *tx, uint32_t logger)
{
DNSTransaction *dns_tx = (DNSTransaction *)tx;
dns_tx->logged |= logger;
}
int DNSGetTxLogged(void *alstate, void *tx, uint32_t logger)
{
DNSTransaction *dns_tx = (DNSTransaction *)tx;
if (dns_tx->logged & logger)
return 1;
return 0;
}
/** \brief get value for 'complete' status in DNS
*
* For DNS we use a simple bool. 1 means done.

@ -191,6 +191,7 @@ typedef struct DNSAnswerEntry_ {
typedef struct DNSTransaction_ {
uint16_t tx_num; /**< internal: id */
uint16_t tx_id; /**< transaction id */
uint32_t logged; /**< flags for loggers done logging */
uint8_t replied; /**< bool indicating request is
replied to. */
uint8_t reply_lost;
@ -253,6 +254,8 @@ void DNSAppLayerRegisterGetEventInfo(uint8_t ipproto, AppProto alproto);
void *DNSGetTx(void *alstate, uint64_t tx_id);
uint64_t DNSGetTxCnt(void *alstate);
void DNSSetTxLogged(void *alstate, void *tx, uint32_t logger);
int DNSGetTxLogged(void *alstate, void *tx, uint32_t logger);
int DNSGetAlstateProgress(void *tx, uint8_t direction);
int DNSGetAlstateProgressCompletionStatus(uint8_t direction);

@ -662,6 +662,8 @@ void RegisterDNSTCPParsers(void)
AppLayerParserRegisterGetTx(IPPROTO_TCP, ALPROTO_DNS, DNSGetTx);
AppLayerParserRegisterGetTxCnt(IPPROTO_TCP, ALPROTO_DNS, DNSGetTxCnt);
AppLayerParserRegisterLoggerFuncs(IPPROTO_TCP, ALPROTO_DNS, DNSGetTxLogged,
DNSSetTxLogged);
AppLayerParserRegisterGetStateProgressFunc(IPPROTO_TCP, ALPROTO_DNS,
DNSGetAlstateProgress);
AppLayerParserRegisterGetStateProgressCompletionStatus(ALPROTO_DNS,

@ -420,6 +420,8 @@ void RegisterDNSUDPParsers(void)
DNSGetTx);
AppLayerParserRegisterGetTxCnt(IPPROTO_UDP, ALPROTO_DNS,
DNSGetTxCnt);
AppLayerParserRegisterLoggerFuncs(IPPROTO_UDP, ALPROTO_DNS, DNSGetTxLogged,
DNSSetTxLogged);
AppLayerParserRegisterGetStateProgressFunc(IPPROTO_UDP, ALPROTO_DNS,
DNSGetAlstateProgress);
AppLayerParserRegisterGetStateProgressCompletionStatus(ALPROTO_DNS,

Loading…
Cancel
Save