suricata
util-file.h File Reference
#include "conf.h"
#include "util-streaming-buffer.h"
Include dependency graph for util-file.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  File_
 
struct  FileContainer_
 

Macros

#define FILE_TRUNCATED   BIT_U16(0)
 
#define FILE_NOMAGIC   BIT_U16(1)
 
#define FILE_NOMD5   BIT_U16(2)
 
#define FILE_MD5   BIT_U16(3)
 
#define FILE_NOSHA1   BIT_U16(4)
 
#define FILE_SHA1   BIT_U16(5)
 
#define FILE_NOSHA256   BIT_U16(6)
 
#define FILE_SHA256   BIT_U16(7)
 
#define FILE_LOGGED   BIT_U16(8)
 
#define FILE_NOSTORE   BIT_U16(9)
 
#define FILE_STORE   BIT_U16(10)
 
#define FILE_STORED   BIT_U16(11)
 
#define FILE_NOTRACK   BIT_U16(12)
 
#define FILE_USE_DETECT   BIT_U16(13)
 
#define FILE_USE_TRACKID   BIT_U16(14)
 
#define FILE_HAS_GAPS   BIT_U16(15)
 

Typedefs

typedef enum FileState_ FileState
 
typedef struct File_ File
 
typedef struct FileContainer_ FileContainer
 

Enumerations

enum  FileState_ {
  FILE_STATE_NONE = 0, FILE_STATE_OPENED, FILE_STATE_CLOSED, FILE_STATE_TRUNCATED,
  FILE_STATE_ERROR, FILE_STATE_MAX
}
 

Functions

FileContainerFileContainerAlloc (void)
 allocate a FileContainer More...
 
void FileContainerFree (FileContainer *)
 Free a FileContainer. More...
 
void FileContainerRecycle (FileContainer *)
 Recycle a FileContainer. More...
 
void FileContainerAdd (FileContainer *, File *)
 
int FileOpenFileWithId (FileContainer *, const StreamingBufferConfig *, uint32_t track_id, const uint8_t *name, uint16_t name_len, const uint8_t *data, uint32_t data_len, uint16_t flags)
 Open a new File. More...
 
int FileCloseFile (FileContainer *, const uint8_t *data, uint32_t data_len, uint16_t flags)
 Close a File. More...
 
int FileCloseFileById (FileContainer *, uint32_t track_id, const uint8_t *data, uint32_t data_len, uint16_t flags)
 
int FileCloseFilePtr (File *ff, const uint8_t *data, uint32_t data_len, uint16_t flags)
 
int FileAppendData (FileContainer *, const uint8_t *data, uint32_t data_len)
 Store a chunk of file data in the flow. The open "flowfile" will be used. More...
 
int FileAppendDataById (FileContainer *, uint32_t track_id, const uint8_t *data, uint32_t data_len)
 Store/handle a chunk of file data in the File structure The file with 'track_id' in the FileContainer will be used. More...
 
int FileAppendGAPById (FileContainer *ffc, uint32_t track_id, const uint8_t *data, uint32_t data_len)
 Store/handle a chunk of file data in the File structure The file with 'track_id' in the FileContainer will be used. More...
 
int FileSetRange (FileContainer *, uint64_t start, uint64_t end)
 Sets the offset range for a file. More...
 
int FileStore (File *)
 Tag a file for storing. More...
 
int FileSetTx (File *, uint64_t txid)
 Set the TX id for a file. More...
 
void FileContainerSetTx (FileContainer *ffc, uint64_t tx_id)
 
void FileDisableStoring (struct Flow_ *, uint8_t)
 disable file storage for a flow More...
 
void FileDisableFilesize (Flow *f, uint8_t direction)
 disable file size tracking for this flow More...
 
void FileDisableStoringForTransaction (Flow *f, uint8_t direction, uint64_t tx_id)
 disable file storing for a transaction More...
 
void FlowFileDisableStoringForTransaction (struct Flow_ *f, uint64_t tx_id)
 
void FilePrune (FileContainer *ffc)
 
void FileForceFilestoreEnable (void)
 
int FileForceFilestore (void)
 
void FileReassemblyDepthEnable (uint32_t size)
 
uint32_t FileReassemblyDepth (void)
 
void FileDisableMagic (Flow *f, uint8_t)
 disable file magic lookups for this flow More...
 
void FileForceMagicEnable (void)
 
int FileForceMagic (void)
 
void FileDisableMd5 (Flow *f, uint8_t)
 disable file md5 calc for this flow More...
 
void FileForceMd5Enable (void)
 
int FileForceMd5 (void)
 
void FileDisableSha1 (Flow *f, uint8_t)
 disable file sha1 calc for this flow More...
 
void FileForceSha1Enable (void)
 
int FileForceSha1 (void)
 
void FileDisableSha256 (Flow *f, uint8_t)
 disable file sha256 calc for this flow More...
 
void FileForceSha256Enable (void)
 
int FileForceSha256 (void)
 
void FileForceHashParseCfg (ConfNode *)
 Function to parse forced file hashing configuration. More...
 
void FileForceTrackingEnable (void)
 
void FileStoreAllFiles (FileContainer *)
 
void FileStoreAllFilesForTx (FileContainer *, uint64_t)
 
void FileStoreFileById (FileContainer *fc, uint32_t)
 flag a file with id "file_id" to be stored. More...
 
void FileTruncateAllOpenFiles (FileContainer *)
 
uint64_t FileDataSize (const File *file)
 get the size of the file data More...
 
uint64_t FileTrackedSize (const File *file)
 get the size of the file More...
 
uint16_t FileFlowToFlags (const Flow *flow, uint8_t direction)
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Definition in file util-file.h.

Macro Definition Documentation

#define FILE_HAS_GAPS   BIT_U16(15)

Definition at line 51 of file util-file.h.

Referenced by FileAppendGAPById(), FileCloseFilePtr(), and JsonBuildFileInfoRecord().

#define FILE_LOGGED   BIT_U16(8)

Definition at line 44 of file util-file.h.

Referenced by FileTrackedSize(), JsonBuildFileInfoRecord(), and OutputRegisterFileLogger().

#define FILE_MD5   BIT_U16(3)

Definition at line 39 of file util-file.h.

Referenced by FileAppendGAPById(), FileCloseFilePtr(), and JsonBuildFileInfoRecord().

#define FILE_NOMAGIC   BIT_U16(1)
#define FILE_NOMD5   BIT_U16(2)
#define FILE_NOSHA1   BIT_U16(4)

Definition at line 40 of file util-file.h.

Referenced by FileAppendGAPById(), FileDisableSha1(), FileFlowToFlags(), and FileSetRange().

#define FILE_NOSHA256   BIT_U16(6)

Definition at line 42 of file util-file.h.

Referenced by FileAppendGAPById(), FileDisableSha256(), FileFlowToFlags(), and FileSetRange().

#define FILE_NOTRACK   BIT_U16(12)

track size of file

Definition at line 48 of file util-file.h.

Referenced by FileContainerSetTx(), and FileDisableFilesize().

#define FILE_SHA1   BIT_U16(5)

Definition at line 41 of file util-file.h.

Referenced by FileAppendGAPById(), FileCloseFilePtr(), and JsonBuildFileInfoRecord().

#define FILE_SHA256   BIT_U16(7)
#define FILE_STORED   BIT_U16(11)
#define FILE_USE_DETECT   BIT_U16(13)

use content_inspected tracker

Definition at line 49 of file util-file.h.

Referenced by FileContainerSetTx(), FileSetRange(), FileTrackedSize(), and SMTPProcessDataChunk().

#define FILE_USE_TRACKID   BIT_U16(14)

File::file_track_id field is in use

Definition at line 50 of file util-file.h.

Referenced by FileOpenFileWithId().

Typedef Documentation

typedef struct File_ File
typedef struct FileContainer_ FileContainer
typedef enum FileState_ FileState

Enumeration Type Documentation

enum FileState_
Enumerator
FILE_STATE_NONE 

no state

FILE_STATE_OPENED 

flow file is opened

FILE_STATE_CLOSED 

flow file is completed, there will be no more data.

FILE_STATE_TRUNCATED 

flow file is not complete, but there will be no more data.

FILE_STATE_ERROR 

file is in an error state

FILE_STATE_MAX 

Definition at line 53 of file util-file.h.

Function Documentation

int FileAppendData ( FileContainer ffc,
const uint8_t *  data,
uint32_t  data_len 
)

Store a chunk of file data in the flow. The open "flowfile" will be used.

Parameters
ffcthe container
datadata chunk
data_lendata chunk len
Return values
0ok
-1error

Store a chunk of file data in the flow. The open "flowfile" will be used.

Parameters
ffcFileContainer used to append to
datadata chunk
data_lendata chunk len
Return values
0ok
-1error
-2no store for this file

Definition at line 664 of file util-file.c.

References SCEnter, SCReturnInt, and FileContainer_::tail.

Referenced by HTPFileStoreChunk(), and SMTPProcessDataChunk().

Here is the caller graph for this function:

int FileAppendDataById ( FileContainer ffc,
uint32_t  track_id,
const uint8_t *  data,
uint32_t  data_len 
)

Store/handle a chunk of file data in the File structure The file with 'track_id' in the FileContainer will be used.

Parameters
ffcFileContainer used to append to
track_idid to lookup the file
datadata chunk
data_lendata chunk len
Return values
0ok
-1error
-2no store for this file

Definition at line 688 of file util-file.c.

References File_::file_track_id, FileContainer_::head, File_::next, SCEnter, SCReturnInt, and FileContainer_::tail.

Referenced by main().

Here is the caller graph for this function:

int FileAppendGAPById ( FileContainer ffc,
uint32_t  track_id,
const uint8_t *  data,
uint32_t  data_len 
)

Store/handle a chunk of file data in the File structure The file with 'track_id' in the FileContainer will be used.

Parameters
ffcFileContainer used to append to
track_idid to lookup the file
datadata chunk
data_lendata chunk len
Return values
0ok
-1error
-2no store for this file

Definition at line 719 of file util-file.c.

References FILE_HAS_GAPS, FILE_MD5, FILE_NOMD5, FILE_NOSHA1, FILE_NOSHA256, FILE_SHA1, FILE_SHA256, File_::file_track_id, File_::flags, FileContainer_::head, File_::next, SCEnter, SCLogDebug, SCReturnInt, and FileContainer_::tail.

Referenced by main().

Here is the caller graph for this function:

int FileCloseFile ( FileContainer ffc,
const uint8_t *  data,
uint32_t  data_len,
uint16_t  flags 
)

Close a File.

Parameters
ffcthe container
datafinal data if any
data_lendata len if any
flagsflags
Return values
0ok
-1error

Definition at line 964 of file util-file.c.

References FileCloseFilePtr(), SCEnter, SCReturnInt, and FileContainer_::tail.

Referenced by HTPFileClose(), and SMTPProcessDataChunk().

Here is the call graph for this function:

Here is the caller graph for this function:

int FileCloseFileById ( FileContainer ,
uint32_t  track_id,
const uint8_t *  data,
uint32_t  data_len,
uint16_t  flags 
)

Definition at line 980 of file util-file.c.

References File_::file_track_id, FileCloseFilePtr(), FileContainer_::head, File_::next, SCEnter, SCReturnInt, and FileContainer_::tail.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int FileCloseFilePtr ( File ff,
const uint8_t *  data,
uint32_t  data_len,
uint16_t  flags 
)
void FileContainerAdd ( FileContainer ,
File  
)

Definition at line 496 of file util-file.c.

References FileContainer_::head, File_::next, and FileContainer_::tail.

Referenced by FileSetRange().

Here is the caller graph for this function:

FileContainer* FileContainerAlloc ( void  )

allocate a FileContainer

Return values
newnewly allocated FileContainer
NULLerror

Definition at line 380 of file util-file.c.

References SC_ERR_MEM_ALLOC, SCLogError, SCMalloc, and unlikely.

Referenced by HTPFileOpen(), and SMTPProcessDataChunk().

Here is the caller graph for this function:

void FileContainerFree ( FileContainer ffc)

Free a FileContainer.

Parameters
ffcFileContainer

Definition at line 416 of file util-file.c.

References FileContainer_::head, File_::name, File_::next, next, File_::sb, SC_ERR_MEM_ALLOC, SCFree, SCLogError, SCMalloc, File_::sid, StreamingBufferFree(), FileContainer_::tail, and unlikely.

Referenced by HTPStateFree(), and SMTPStateAlloc().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileContainerRecycle ( FileContainer ffc)

Recycle a FileContainer.

Parameters
ffcFileContainer

Definition at line 397 of file util-file.c.

References FileContainer_::head, File_::next, next, and FileContainer_::tail.

Referenced by main().

Here is the caller graph for this function:

void FileContainerSetTx ( FileContainer ffc,
uint64_t  tx_id 
)

Definition at line 531 of file util-file.c.

References BUG_ON, FILE_NOSTORE, FILE_NOTRACK, FILE_STATE_ERROR, FILE_STATE_OPENED, FILE_STATE_TRUNCATED, FILE_USE_DETECT, FileDataSize(), FileSetTx(), File_::flags, File_::sb, SCEnter, SCLogDebug, SCReturnInt, File_::size, File_::state, StreamingBufferAppendNoTrack(), and FileContainer_::tail.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t FileDataSize ( const File file)

get the size of the file data

This doesn't reflect how much of the file we have in memory, just the total size of filedata so far.

Definition at line 277 of file util-file.c.

References StreamingBuffer_::buf_offset, File_::sb, SCLogDebug, and StreamingBuffer_::stream_offset.

Referenced by DetectFilemagicRegister(), FileContainerSetTx(), FileDisableFilesize(), FileTrackedSize(), HTPFileClose(), OutputRegisterFiledataLogger(), and SMTPParserCleanup().

Here is the caller graph for this function:

void FileDisableFilesize ( Flow f,
uint8_t  direction 
)

disable file size tracking for this flow

Parameters
fLOCKED flow
directionflow direction

Definition at line 1185 of file util-file.c.

References Flow_::alproto, Flow_::alstate, AppLayerParserGetFiles(), DEBUG_ASSERT_FLOW_LOCKED, Flow_::file_flags, FILE_NOSTORE, FILE_NOTRACK, FILE_STATE_OPENED, FILE_TRUNCATED, FileCloseFilePtr(), FileDataSize(), File_::flags, FLOWFILE_NO_SIZE_TC, FLOWFILE_NO_SIZE_TS, FileContainer_::head, File_::next, Flow_::proto, SCEnter, SCLogDebug, SCReturn, File_::state, and STREAM_TOSERVER.

Referenced by SigMatchSignaturesGetSgh().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileDisableMagic ( Flow f,
uint8_t  direction 
)

disable file magic lookups for this flow

Parameters
fLOCKED flow
directionflow direction

Definition at line 1037 of file util-file.c.

References Flow_::alproto, Flow_::alstate, AppLayerParserGetFiles(), DEBUG_ASSERT_FLOW_LOCKED, Flow_::file_flags, FILE_NOMAGIC, File_::flags, FLOWFILE_NO_MAGIC_TC, FLOWFILE_NO_MAGIC_TS, FileContainer_::head, File_::next, Flow_::proto, SCEnter, SCLogDebug, SCReturn, and STREAM_TOSERVER.

Referenced by SigMatchSignaturesGetSgh().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileDisableMd5 ( Flow f,
uint8_t  direction 
)

disable file md5 calc for this flow

Parameters
fLOCKED flow
directionflow direction

Definition at line 1068 of file util-file.c.

References Flow_::alproto, Flow_::alstate, AppLayerParserGetFiles(), DEBUG_ASSERT_FLOW_LOCKED, Flow_::file_flags, FILE_NOMD5, File_::flags, FLOWFILE_NO_MD5_TC, FLOWFILE_NO_MD5_TS, FileContainer_::head, File_::next, Flow_::proto, SCEnter, SCLogDebug, SCReturn, and STREAM_TOSERVER.

Referenced by SigMatchSignaturesGetSgh().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileDisableSha1 ( Flow f,
uint8_t  direction 
)

disable file sha1 calc for this flow

Parameters
fLOCKED flow
directionflow direction

Definition at line 1107 of file util-file.c.

References Flow_::alproto, Flow_::alstate, AppLayerParserGetFiles(), DEBUG_ASSERT_FLOW_LOCKED, Flow_::file_flags, FILE_NOSHA1, File_::flags, FLOWFILE_NO_SHA1_TC, FLOWFILE_NO_SHA1_TS, FileContainer_::head, File_::next, Flow_::proto, SCEnter, SCLogDebug, SCReturn, and STREAM_TOSERVER.

Referenced by SigMatchSignaturesGetSgh().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileDisableSha256 ( Flow f,
uint8_t  direction 
)

disable file sha256 calc for this flow

Parameters
fLOCKED flow
directionflow direction

Definition at line 1146 of file util-file.c.

References Flow_::alproto, Flow_::alstate, AppLayerParserGetFiles(), DEBUG_ASSERT_FLOW_LOCKED, Flow_::file_flags, FILE_NOSHA256, File_::flags, FLOWFILE_NO_SHA256_TC, FLOWFILE_NO_SHA256_TS, FileContainer_::head, File_::next, Flow_::proto, SCEnter, SCLogDebug, SCReturn, and STREAM_TOSERVER.

Referenced by SigMatchSignaturesGetSgh().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileDisableStoring ( Flow f,
uint8_t  direction 
)

disable file storage for a flow

Parameters
fLOCKED flow
fLOCKED flow
directionflow direction

Definition at line 1005 of file util-file.c.

References Flow_::alproto, Flow_::alstate, AppLayerParserGetFiles(), DEBUG_ASSERT_FLOW_LOCKED, Flow_::file_flags, FILE_NOSTORE, FILE_STORE, File_::flags, FLOWFILE_NO_STORE_TC, FLOWFILE_NO_STORE_TS, FileContainer_::head, File_::next, Flow_::proto, SCEnter, SCLogDebug, SCReturn, and STREAM_TOSERVER.

Referenced by SigMatchSignaturesGetSgh().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileDisableStoringForTransaction ( Flow f,
uint8_t  direction,
uint64_t  tx_id 
)

disable file storing for a transaction

Parameters
fflow
tx_idtransaction id

disable file storing for a transaction

Parameters
fLOCKED flow
directionflow direction
tx_idtransaction id

Definition at line 1243 of file util-file.c.

References Flow_::alproto, Flow_::alstate, AppLayerParserGetFiles(), DEBUG_ASSERT_FLOW_LOCKED, FILE_STORE, File_::flags, FileContainer_::head, File_::next, Flow_::proto, SCEnter, SCLogDebug, SCReturn, and File_::txid.

Referenced by DetectEngineStateFree().

Here is the call graph for this function:

Here is the caller graph for this function:

int FileForceFilestore ( void  )

Definition at line 111 of file util-file.c.

Referenced by SigMatchSignaturesGetSgh().

Here is the caller graph for this function:

void FileForceFilestoreEnable ( void  )

Definition at line 86 of file util-file.c.

Referenced by JsonBuildFileInfoRecord().

Here is the caller graph for this function:

void FileForceHashParseCfg ( ConfNode )

Function to parse forced file hashing configuration.

Definition at line 158 of file util-file.c.

References BUG_ON, ConfNodeLookupChild(), ConfNodeLookupChildValue(), ConfValIsTrue(), FileForceMd5Enable(), FileForceSha1Enable(), FileForceSha256Enable(), next, SC_ERR_DEPRECATED_CONF, SCLogInfo, SCLogWarning, TAILQ_FOREACH, and ConfNode_::val.

Referenced by JsonBuildFileInfoRecord().

Here is the call graph for this function:

Here is the caller graph for this function:

int FileForceMagic ( void  )

Definition at line 130 of file util-file.c.

Referenced by OutputRegisterFiledataLogger(), OutputRegisterFileLogger(), and SigMatchSignaturesGetSgh().

Here is the caller graph for this function:

void FileForceMagicEnable ( void  )

Definition at line 91 of file util-file.c.

Referenced by JsonBuildFileInfoRecord().

Here is the caller graph for this function:

int FileForceMd5 ( void  )

Definition at line 135 of file util-file.c.

Referenced by SigMatchSignaturesGetSgh().

Here is the caller graph for this function:

void FileForceMd5Enable ( void  )

Definition at line 96 of file util-file.c.

Referenced by FileForceHashParseCfg().

Here is the caller graph for this function:

int FileForceSha1 ( void  )

Definition at line 140 of file util-file.c.

Referenced by SigMatchSignaturesGetSgh().

Here is the caller graph for this function:

void FileForceSha1Enable ( void  )

Definition at line 101 of file util-file.c.

Referenced by FileForceHashParseCfg().

Here is the caller graph for this function:

int FileForceSha256 ( void  )

Definition at line 145 of file util-file.c.

Referenced by SigMatchSignaturesGetSgh().

Here is the caller graph for this function:

void FileForceSha256Enable ( void  )

Definition at line 106 of file util-file.c.

Referenced by FileForceHashParseCfg().

Here is the caller graph for this function:

void FileForceTrackingEnable ( void  )

Definition at line 150 of file util-file.c.

Referenced by JsonBuildFileInfoRecord().

Here is the caller graph for this function:

int FileOpenFileWithId ( FileContainer ffc,
const StreamingBufferConfig sbcfg,
uint32_t  track_id,
const uint8_t *  name,
uint16_t  name_len,
const uint8_t *  data,
uint32_t  data_len,
uint16_t  flags 
)

Open a new File.

Parameters
ffcflow container
sbcfgbuffer config
namefilename character array
name_lenfilename len
datainitial data
data_leninitial data len
flagsopen flags
Return values
ffflowfile object
Note
filename is not a string, so it's not nul terminated.

If flags contains the FILE_USE_DETECT bit, the pruning code will consider not just the content_stored tracker, but also content_inspected. It's the responsibility of the API user to make sure this tracker is properly updated.

Return values
0ok
-1failed

Definition at line 869 of file util-file.c.

References File_::file_track_id, FILE_USE_TRACKID, and File_::flags.

Referenced by HTPFileOpen(), main(), and SMTPProcessDataChunk().

Here is the caller graph for this function:

void FilePrune ( FileContainer ffc)

Definition at line 345 of file util-file.c.

References FileContainer_::head, File_::next, SCLogDebug, and FileContainer_::tail.

Referenced by main().

Here is the caller graph for this function:

uint32_t FileReassemblyDepth ( void  )

Definition at line 122 of file util-file.c.

References TcpStreamCnf_::reassembly_depth, and stream_config.

Referenced by AppLayerHtpNeedFileInspection(), DetectFilestoreRegister(), and HtpConfigRestoreBackup().

Here is the caller graph for this function:

void FileReassemblyDepthEnable ( uint32_t  size)

Definition at line 116 of file util-file.c.

Referenced by HtpConfigRestoreBackup().

Here is the caller graph for this function:

int FileSetRange ( FileContainer ffc,
uint64_t  start,
uint64_t  end 
)

Sets the offset range for a file.

Parameters
ffcthe container
startstart offset
endend offset
Return values
0ok
-1error

Definition at line 752 of file util-file.c.

References File_::end, File_::fd, FILE_NOMAGIC, FILE_NOMD5, FILE_NOSHA1, FILE_NOSHA256, FILE_NOSTORE, FILE_STATE_ERROR, FILE_STATE_OPENED, FILE_STORE, FILE_USE_DETECT, FileContainerAdd(), FileStore(), FileTrackedSize(), File_::flags, flags, File_::sb, SCEnter, SCLogDebug, SCReturnInt, SCReturnPtr, File_::size, File_::start, File_::state, StreamingBufferInit(), and FileContainer_::tail.

Referenced by HTPFileSetRange().

Here is the call graph for this function:

Here is the caller graph for this function:

int FileSetTx ( File ff,
uint64_t  txid 
)

Set the TX id for a file.

Parameters
ffThe file to store
txidthe tx id

Definition at line 523 of file util-file.c.

References SCLogDebug, SCReturnInt, and File_::txid.

Referenced by FileContainerSetTx(), and HTPFileOpen().

Here is the caller graph for this function:

int FileStore ( File ff)

Tag a file for storing.

Parameters
ffThe file to store

Definition at line 511 of file util-file.c.

References FILE_STORE, File_::flags, and SCReturnInt.

Referenced by FileSetRange(), FileStoreAllFiles(), FileStoreAllFilesForTx(), and FileStoreFileById().

Here is the caller graph for this function:

void FileStoreAllFiles ( FileContainer )

Definition at line 1304 of file util-file.c.

References FileStore(), FileContainer_::head, File_::next, and SCEnter.

Referenced by DetectFilestoreRegister().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileStoreAllFilesForTx ( FileContainer ,
uint64_t   
)

Definition at line 1289 of file util-file.c.

References FileStore(), FileContainer_::head, File_::next, SCEnter, and File_::txid.

Referenced by DetectFilestoreRegister().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileStoreFileById ( FileContainer fc,
uint32_t  file_id 
)

flag a file with id "file_id" to be stored.

Parameters
fcfile store
file_idthe file's id

Definition at line 1274 of file util-file.c.

References File_::file_track_id, FileStore(), FileContainer_::head, File_::next, and SCEnter.

Referenced by DetectFilestoreRegister().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t FileTrackedSize ( const File file)

get the size of the file

This doesn't reflect how much of the file we have in memory, just the total size of file so far.

Definition at line 294 of file util-file.c.

References File_::content_inspected, File_::content_stored, FILE_LOGGED, FILE_NOMAGIC, FILE_NOSTORE, FILE_STATE_CLOSED, FILE_STORED, FILE_USE_DETECT, FileDataSize(), File_::flags, MIN, RunModeOutputFiledataEnabled(), RunModeOutputFileEnabled(), File_::sb, SCEnter, SCLogDebug, SCReturnInt, File_::size, File_::state, and StreamingBufferSlideToOffset().

Referenced by DetectFilesizeRegister(), FileSetRange(), JsonBuildFileInfoRecord(), and SMTPParserCleanup().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileTruncateAllOpenFiles ( FileContainer )

Definition at line 1317 of file util-file.c.

References FILE_SHA256, FILE_STATE_OPENED, FILE_TRUNCATED, FileCloseFilePtr(), File_::flags, FileContainer_::head, len, File_::next, SCEnter, and File_::state.

Referenced by AppLayerHtpPrintStats(), and SMTPStateAlloc().

Here is the call graph for this function:

Here is the caller graph for this function:

void FlowFileDisableStoringForTransaction ( struct Flow_ f,
uint64_t  tx_id 
)