suricata
util-print.c File Reference
#include "suricata-common.h"
#include "util-print.h"
#include "util-error.h"
#include "util-debug.h"
Include dependency graph for util-print.c:

Go to the source code of this file.

Macros

#define BUFFER_LENGTH   2048
 
#define BUFFER_LENGTH   2048
 
#define s6_addr16   __u6_addr.__u6_addr16
 

Functions

void PrintBufferRawLineHex (char *nbuf, int *offset, int max_size, uint8_t *buf, uint32_t buflen)
 print a buffer as hex on a single line More...
 
void PrintRawLineHexBuf (char *retbuf, uint32_t retbuflen, uint8_t *buf, uint32_t buflen)
 print a buffer as hex on a single line in to retbuf buffer More...
 
void PrintRawJsonFp (FILE *fp, uint8_t *buf, uint32_t buflen)
 
void PrintRawUriFp (FILE *fp, uint8_t *buf, uint32_t buflen)
 
void PrintRawUriBuf (char *retbuf, uint32_t *offset, uint32_t retbuflen, uint8_t *buf, uint32_t buflen)
 
void PrintRawDataFp (FILE *fp, const uint8_t *buf, uint32_t buflen)
 
void PrintRawDataToBuffer (uint8_t *dst_buf, uint32_t *dst_buf_offset_ptr, uint32_t dst_buf_size, const uint8_t *src_buf, uint32_t src_buf_len)
 
void PrintStringsToBuffer (uint8_t *dst_buf, uint32_t *dst_buf_offset_ptr, uint32_t dst_buf_size, const uint8_t *src_buf, const uint32_t src_buf_len)
 
const char * PrintInet (int af, const void *src, char *dst, socklen_t size)
 

Detailed Description

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

Print utility functions

Definition in file util-print.c.

Macro Definition Documentation

#define BUFFER_LENGTH   2048

Referenced by PrintRawJsonFp(), and PrintRawUriFp().

#define BUFFER_LENGTH   2048
#define s6_addr16   __u6_addr.__u6_addr16

Definition at line 241 of file util-print.c.

Function Documentation

void PrintBufferRawLineHex ( char *  nbuf,
int *  offset,
int  max_size,
uint8_t *  buf,
uint32_t  buflen 
)

print a buffer as hex on a single line

Prints in the format "00 AA BB"

Parameters
nbufbuffer into which the output is written
offsetof where to start writting into the buffer
max_sizethe size of the output buffer
bufbuffer to print from
buflenlength of the input buffer

Definition at line 42 of file util-print.c.

References PrintBufferData.

Referenced by AlertFastLogger().

Here is the caller graph for this function:

const char* PrintInet ( int  af,
const void *  src,
char *  dst,
socklen_t  size 
)
void PrintRawDataToBuffer ( uint8_t *  dst_buf,
uint32_t *  dst_buf_offset_ptr,
uint32_t  dst_buf_size,
const uint8_t *  src_buf,
uint32_t  src_buf_len 
)

Definition at line 175 of file util-print.c.

References PrintBufferData.

void PrintRawJsonFp ( FILE *  fp,
uint8_t *  buf,
uint32_t  buflen 
)

Definition at line 71 of file util-print.c.

References BUFFER_LENGTH, offset, and PrintBufferData.

void PrintRawLineHexBuf ( char *  retbuf,
uint32_t  retbuflen,
uint8_t *  buf,
uint32_t  buflen 
)

print a buffer as hex on a single line in to retbuf buffer

Prints in the format "00 AA BB"

Parameters
retbufpointer to the buffer which will have the result
rebuflenlenght of the buffer
bufbuffer to print from
buflenlength of the input buffer

Definition at line 61 of file util-print.c.

References offset, and PrintBufferData.

void PrintRawUriBuf ( char *  retbuf,
uint32_t *  offset,
uint32_t  retbuflen,
uint8_t *  buf,
uint32_t  buflen 
)

Definition at line 118 of file util-print.c.

References PrintBufferData.

Referenced by LogCustomFormatWriteTimestamp(), and TLSGetIPInformations().

Here is the caller graph for this function:

void PrintRawUriFp ( FILE *  fp,
uint8_t *  buf,
uint32_t  buflen 
)

Definition at line 93 of file util-print.c.

References BUFFER_LENGTH, offset, and PrintBufferData.

Referenced by EngineAnalysisFP(), HtpConfigRestoreBackup(), and PerCentEncodingMatch().

Here is the caller graph for this function:

void PrintStringsToBuffer ( uint8_t *  dst_buf,
uint32_t *  dst_buf_offset_ptr,
uint32_t  dst_buf_size,
const uint8_t *  src_buf,
const uint32_t  src_buf_len 
)

Definition at line 224 of file util-print.c.

References PrintBufferData.

Referenced by OutputJsonRegister().

Here is the caller graph for this function: