suricata
app-layer-frames.c File Reference
#include "suricata-common.h"
#include "util-print.h"
#include "flow.h"
#include "stream-tcp.h"
#include "app-layer-frames.h"
#include "app-layer-parser.h"
Include dependency graph for app-layer-frames.c:

Go to the source code of this file.

Functions

FrameFrameGetById (Frames *frames, const int64_t id)
 
FrameFrameGetByIndex (Frames *frames, const uint32_t idx)
 
void AppLayerFramesSlide (Flow *f, const uint32_t slide, const uint8_t direction)
 
void FramesFree (Frames *frames)
 
FrameAppLayerFrameNewByPointer (Flow *f, const StreamSlice *stream_slice, const uint8_t *frame_start, const int64_t len, int dir, uint8_t frame_type)
 create new frame using a pointer to start of the frame More...
 
FrameAppLayerFrameNewByRelativeOffset (Flow *f, const StreamSlice *stream_slice, const uint32_t frame_start_rel, const int64_t len, int dir, uint8_t frame_type)
 create new frame using a relative offset from the start of the stream slice More...
 
void AppLayerFrameDump (Flow *f)
 
FrameAppLayerFrameNewByAbsoluteOffset (Flow *f, const StreamSlice *stream_slice, const uint64_t frame_start, const int64_t len, int dir, uint8_t frame_type)
 create new frame using the absolute offset from the start of the stream More...
 
void AppLayerFrameAddEvent (Frame *r, uint8_t e)
 
void AppLayerFrameAddEventById (Flow *f, const int dir, const FrameId id, uint8_t e)
 
FrameId AppLayerFrameGetId (Frame *r)
 
void AppLayerFrameSetLength (Frame *frame, int64_t len)
 
void AppLayerFrameSetLengthById (Flow *f, const int dir, const FrameId id, int64_t len)
 
void AppLayerFrameSetTxId (Frame *r, uint64_t tx_id)
 
void AppLayerFrameSetTxIdById (Flow *f, const int dir, const FrameId id, uint64_t tx_id)
 
FrameAppLayerFrameGetById (Flow *f, const int dir, const FrameId frame_id)
 
void FramesPrune (Flow *f, Packet *p)
 

Detailed Description

Function Documentation

◆ AppLayerFrameAddEvent()

void AppLayerFrameAddEvent ( Frame r,
uint8_t  e 
)

Definition at line 583 of file app-layer-frames.c.

References Frame::event_cnt, and Frame::events.

Referenced by AppLayerFrameAddEventById().

Here is the caller graph for this function:

◆ AppLayerFrameAddEventById()

void AppLayerFrameAddEventById ( Flow f,
const int  dir,
const FrameId  id,
uint8_t  e 
)

Definition at line 593 of file app-layer-frames.c.

References AppLayerFrameAddEvent(), and AppLayerFrameGetById().

Here is the call graph for this function:

◆ AppLayerFrameDump()

void AppLayerFrameDump ( Flow f)

Definition at line 525 of file app-layer-frames.c.

References Flow_::alparser, AppLayerFramesGetContainer(), Flow_::proto, and Flow_::protoctx.

Here is the call graph for this function:

◆ AppLayerFrameGetById()

Frame* AppLayerFrameGetById ( Flow f,
const int  dir,
const FrameId  frame_id 
)

Definition at line 637 of file app-layer-frames.c.

References AppLayerFramesGetContainer(), FrameGetById(), FramesContainer::toclient, and FramesContainer::toserver.

Referenced by AppLayerFrameAddEventById(), AppLayerFrameSetLengthById(), and AppLayerFrameSetTxIdById().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AppLayerFrameGetId()

FrameId AppLayerFrameGetId ( Frame r)

Definition at line 599 of file app-layer-frames.c.

References Frame::id.

◆ AppLayerFrameNewByAbsoluteOffset()

Frame* AppLayerFrameNewByAbsoluteOffset ( Flow f,
const StreamSlice *  stream_slice,
const uint64_t  frame_start,
const int64_t  len,
int  dir,
uint8_t  frame_type 
)

create new frame using the absolute offset from the start of the stream

Definition at line 538 of file app-layer-frames.c.

References Flow_::alparser, AppLayerFramesSetupContainer(), BUG_ON, TcpSession_::client, len, offset, Flow_::proto, Flow_::protoctx, SCLogDebug, TcpSession_::server, STREAM_BASE_OFFSET, FramesContainer::toclient, and FramesContainer::toserver.

Here is the call graph for this function:

◆ AppLayerFrameNewByPointer()

Frame* AppLayerFrameNewByPointer ( Flow f,
const StreamSlice *  stream_slice,
const uint8_t *  frame_start,
const int64_t  len,
int  dir,
uint8_t  frame_type 
)

create new frame using a pointer to start of the frame

Definition at line 384 of file app-layer-frames.c.

References Flow_::alparser, AppLayerFramesSetupContainer(), BUG_ON, TcpSession_::client, len, offset, Flow_::proto, Flow_::protoctx, SCLogDebug, TcpSession_::server, STREAM_BASE_OFFSET, FramesContainer::toclient, and FramesContainer::toserver.

Here is the call graph for this function:

◆ AppLayerFrameNewByRelativeOffset()

Frame* AppLayerFrameNewByRelativeOffset ( Flow f,
const StreamSlice *  stream_slice,
const uint32_t  frame_start_rel,
const int64_t  len,
int  dir,
uint8_t  frame_type 
)

create new frame using a relative offset from the start of the stream slice

Definition at line 461 of file app-layer-frames.c.

References Flow_::alparser, BUG_ON, Flow_::proto, and Flow_::protoctx.

◆ AppLayerFrameSetLength()

void AppLayerFrameSetLength ( Frame frame,
int64_t  len 
)

Definition at line 608 of file app-layer-frames.c.

References len, and Frame::len.

Referenced by AppLayerFrameSetLengthById().

Here is the caller graph for this function:

◆ AppLayerFrameSetLengthById()

void AppLayerFrameSetLengthById ( Flow f,
const int  dir,
const FrameId  id,
int64_t  len 
)

Definition at line 616 of file app-layer-frames.c.

References AppLayerFrameGetById(), AppLayerFrameSetLength(), and len.

Here is the call graph for this function:

◆ AppLayerFrameSetTxId()

void AppLayerFrameSetTxId ( Frame r,
uint64_t  tx_id 
)

Definition at line 622 of file app-layer-frames.c.

References Frame::flags, FRAME_FLAG_TX_ID_SET, and Frame::tx_id.

Referenced by AppLayerFrameSetTxIdById().

Here is the caller graph for this function:

◆ AppLayerFrameSetTxIdById()

void AppLayerFrameSetTxIdById ( Flow f,
const int  dir,
const FrameId  id,
uint64_t  tx_id 
)

Definition at line 631 of file app-layer-frames.c.

References AppLayerFrameGetById(), and AppLayerFrameSetTxId().

Here is the call graph for this function:

◆ AppLayerFramesSlide()

void AppLayerFramesSlide ( Flow f,
const uint32_t  slide,
const uint8_t  direction 
)

Definition at line 329 of file app-layer-frames.c.

References AppLayerFramesGetContainer(), TcpSession_::client, Flow_::protoctx, and FramesContainer::toserver.

Here is the call graph for this function:

◆ FrameGetById()

Frame* FrameGetById ( Frames frames,
const int64_t  id 
)

Definition at line 47 of file app-layer-frames.c.

References Frames::cnt, Frames::dframes, FRAMES_STATIC_CNT, Frame::id, and Frames::sframes.

Referenced by AppLayerFrameGetById().

Here is the caller graph for this function:

◆ FrameGetByIndex()

Frame* FrameGetByIndex ( Frames frames,
const uint32_t  idx 
)

Definition at line 64 of file app-layer-frames.c.

References Frames::cnt, FRAMES_STATIC_CNT, and Frames::sframes.

◆ FramesFree()

void FramesFree ( Frames frames)

Definition at line 374 of file app-layer-frames.c.

References BUG_ON.

◆ FramesPrune()

void FramesPrune ( Flow f,
Packet p 
)