mirror of https://github.com/OISF/suricata
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
777 B
C
31 lines
777 B
C
16 years ago
|
#include "eidps-common.h"
|
||
|
#include "app-layer.h"
|
||
|
#include "stream-tcp-private.h"
|
||
|
|
||
|
/** \brief Get the active app layer state from the packet */
|
||
|
void *AppLayerGetProtoStateFromPacket(Packet *p) {
|
||
|
if (p == NULL || p->flow == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
TcpSession *ssn = (TcpSession *)p->flow->protoctx;
|
||
|
if (ssn == NULL || ssn->aldata == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
void *alstate = ssn->aldata[ssn->alproto];
|
||
|
return alstate;
|
||
|
}
|
||
|
|
||
|
/** \brief Get the active app layer state from the flow */
|
||
|
void *AppLayerGetProtoStateFromFlow(Flow *f) {
|
||
|
if (f == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
TcpSession *ssn = (TcpSession *)f->protoctx;
|
||
|
if (ssn == NULL || ssn->aldata == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
void *alstate = ssn->aldata[ssn->alproto];
|
||
|
return alstate;
|
||
|
}
|
||
|
|