threadvars: make packet out func ptr naming compliant

pull/15053/head
Victor Julien 10 months ago
parent f553fbdab4
commit 033a327c48

@ -103,7 +103,7 @@ typedef struct ThreadVars_ {
/** outgoing queue and handler */ /** outgoing queue and handler */
Tmq *outq; Tmq *outq;
void *outctx; void *outctx;
void (*tmqh_out)(struct ThreadVars_ *, struct Packet_ *); void (*TmqhOutFn)(struct ThreadVars_ *, struct Packet_ *);
/** Queue for decoders to temporarily store extra packets they /** Queue for decoders to temporarily store extra packets they
* generate. These packets are generated as part of the tunnel * generate. These packets are generated as part of the tunnel

@ -316,11 +316,11 @@ static void *TmThreadsSlotPktAcqLoop(void *td)
TmEcode r = TM_ECODE_OK; TmEcode r = TM_ECODE_OK;
/* check if we are setup properly */ /* check if we are setup properly */
if (s == NULL || s->PktAcqLoop == NULL || tv->TmqhInFn == NULL || tv->tmqh_out == NULL) { if (s == NULL || s->PktAcqLoop == NULL || tv->TmqhInFn == NULL || tv->TmqhOutFn == NULL) {
SCLogError("TmSlot or ThreadVars badly setup: s=%p," SCLogError("TmSlot or ThreadVars badly setup: s=%p,"
" PktAcqLoop=%p, TmqhInFn=%p," " PktAcqLoop=%p, TmqhInFn=%p,"
" tmqh_out=%p", " TmqhOutFn=%p",
s, s ? s->PktAcqLoop : NULL, tv->TmqhInFn, tv->tmqh_out); s, s ? s->PktAcqLoop : NULL, tv->TmqhInFn, tv->TmqhOutFn);
TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE); TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE);
pthread_exit(NULL); pthread_exit(NULL);
return NULL; return NULL;
@ -386,10 +386,10 @@ static void *TmThreadsLib(void *td)
TmSlot *s = tv->tm_slots; TmSlot *s = tv->tm_slots;
/* check if we are setup properly */ /* check if we are setup properly */
if (s == NULL || tv->TmqhInFn == NULL || tv->tmqh_out == NULL) { if (s == NULL || tv->TmqhInFn == NULL || tv->TmqhOutFn == NULL) {
SCLogError("TmSlot or ThreadVars badly setup: s=%p, TmqhInFn=%p," SCLogError("TmSlot or ThreadVars badly setup: s=%p, TmqhInFn=%p,"
" tmqh_out=%p", " TmqhOutFn=%p",
s, tv->TmqhInFn, tv->tmqh_out); s, tv->TmqhInFn, tv->TmqhOutFn);
TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE); TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE);
return NULL; return NULL;
} }
@ -428,7 +428,7 @@ static void *TmThreadsSlotVar(void *td)
SCDropCaps(tv); SCDropCaps(tv);
/* check if we are setup properly */ /* check if we are setup properly */
if (s == NULL || tv->TmqhInFn == NULL || tv->tmqh_out == NULL) { if (s == NULL || tv->TmqhInFn == NULL || tv->TmqhOutFn == NULL) {
TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE); TmThreadsSetFlag(tv, THV_CLOSED | THV_RUNNING_DONE);
pthread_exit(NULL); pthread_exit(NULL);
return NULL; return NULL;
@ -513,7 +513,7 @@ static void *TmThreadsSlotVar(void *td)
} }
/* output the packet */ /* output the packet */
tv->tmqh_out(tv, p); tv->TmqhOutFn(tv, p);
/* now handle the stream pq packets */ /* now handle the stream pq packets */
TmThreadsHandleInjectedPackets(tv); TmThreadsHandleInjectedPackets(tv);
@ -1005,7 +1005,7 @@ ThreadVars *TmThreadCreate(const char *name, const char *inq_name, const char *i
if (tmqh == NULL) if (tmqh == NULL)
goto error; goto error;
tv->tmqh_out = tmqh->OutHandler; tv->TmqhOutFn = tmqh->OutHandler;
tv->outq_id = (uint8_t)id; tv->outq_id = (uint8_t)id;
if (outq_name != NULL && strcmp(outq_name, "packetpool") != 0) { if (outq_name != NULL && strcmp(outq_name, "packetpool") != 0) {

@ -180,7 +180,7 @@ static inline bool TmThreadsHandleInjectedPackets(ThreadVars *tv)
TmThreadsSlotProcessPktFail(tv, extra_p); TmThreadsSlotProcessPktFail(tv, extra_p);
break; break;
} }
tv->tmqh_out(tv, extra_p); tv->TmqhOutFn(tv, extra_p);
} }
return true; return true;
} else { } else {
@ -194,7 +194,7 @@ static inline bool TmThreadsHandleInjectedPackets(ThreadVars *tv)
static inline TmEcode TmThreadsSlotProcessPkt(ThreadVars *tv, TmSlot *s, Packet *p) static inline TmEcode TmThreadsSlotProcessPkt(ThreadVars *tv, TmSlot *s, Packet *p)
{ {
if (s == NULL) { if (s == NULL) {
tv->tmqh_out(tv, p); tv->TmqhOutFn(tv, p);
return TM_ECODE_OK; return TM_ECODE_OK;
} }
@ -204,7 +204,7 @@ static inline TmEcode TmThreadsSlotProcessPkt(ThreadVars *tv, TmSlot *s, Packet
return TM_ECODE_FAILED; return TM_ECODE_FAILED;
} }
tv->tmqh_out(tv, p); tv->TmqhOutFn(tv, p);
TmThreadsHandleInjectedPackets(tv); TmThreadsHandleInjectedPackets(tv);
@ -257,7 +257,7 @@ static inline void TmThreadsCaptureHandleTimeout(ThreadVars *tv, Packet *p)
/* packet could have been passed to us that we won't use /* packet could have been passed to us that we won't use
* return it to the pool. */ * return it to the pool. */
if (p != NULL) if (p != NULL)
tv->tmqh_out(tv, p); tv->TmqhOutFn(tv, p);
} }
static inline void TmThreadsCaptureBreakLoop(ThreadVars *tv) static inline void TmThreadsCaptureBreakLoop(ThreadVars *tv)

Loading…
Cancel
Save