syslog-ng source
loggen_helper.c File Reference
#include "loggen_helper.h"
#include <syslog-ng-config.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <openssl/err.h>
Include dependency graph for loggen_helper.c:

Classes

struct  proxy_hdr_v2
 
union  proxy_addr
 

Macros

#define HEADER_BUF_SIZE   128
 
#define IP_ADDRESS_MAX_LENGTH   15
 
#define IP_PORT_MAX_LENGTH   5
 
#define AI_V4MAPPED   0
 

Functions

int get_debug_level (void)
 
void set_debug_level (int new_debug)
 
struct addrinfo * resolve_address_using_getaddrinfo (int sock_type, const char *target, const char *port, int use_ipv6)
 
int connect_ip_socket (int sock_type, const char *target, const char *port, int use_ipv6)
 
int connect_unix_domain_socket (int sock_type, const char *path)
 
unsigned long time_val_diff_in_usec (struct timeval *t1, struct timeval *t2)
 
void time_val_diff_in_timeval (struct timeval *res, const struct timeval *t1, const struct timeval *t2)
 
double time_val_diff_in_sec (struct timeval *t1, struct timeval *t2)
 
size_t get_now_timestamp (char *stamp, gsize stamp_size)
 
size_t get_now_timestamp_bsd (char *stamp, gsize stamp_size)
 
void format_timezone_offset_with_colon (char *timestamp, int timestamp_size, struct tm *tm)
 
SSL * open_ssl_connection (int sock_fd)
 
void close_ssl_connection (SSL *ssl)
 
int generate_proxy_header_v1 (char *buffer, int buffer_size, int thread_id, const char *proxy_src_ip, const char *proxy_dst_ip, const char *proxy_src_port, const char *proxy_dst_port)
 
int generate_proxy_header_v2 (char *buffer, int buffer_size, int thread_id, const char *proxy_src_ip, const char *proxy_dst_ip, const char *proxy_src_port, const char *proxy_dst_port)
 
int generate_proxy_header (char *buffer, int buffer_size, int thread_id, int proxy_version, const char *proxy_src_ip, const char *proxy_dst_ip, const char *proxy_src_port, const char *proxy_dst_port)
 

Macro Definition Documentation

◆ AI_V4MAPPED

#define AI_V4MAPPED   0

◆ HEADER_BUF_SIZE

#define HEADER_BUF_SIZE   128

◆ IP_ADDRESS_MAX_LENGTH

#define IP_ADDRESS_MAX_LENGTH   15

◆ IP_PORT_MAX_LENGTH

#define IP_PORT_MAX_LENGTH   5

Function Documentation

◆ close_ssl_connection()

void close_ssl_connection ( SSL *  ssl)

◆ connect_ip_socket()

int connect_ip_socket ( int  sock_type,
const char *  target,
const char *  port,
int  use_ipv6 
)

◆ connect_unix_domain_socket()

int connect_unix_domain_socket ( int  sock_type,
const char *  path 
)

◆ format_timezone_offset_with_colon()

void format_timezone_offset_with_colon ( char *  timestamp,
int  timestamp_size,
struct tm *  tm 
)

◆ generate_proxy_header()

int generate_proxy_header ( char *  buffer,
int  buffer_size,
int  thread_id,
int  proxy_version,
const char *  proxy_src_ip,
const char *  proxy_dst_ip,
const char *  proxy_src_port,
const char *  proxy_dst_port 
)

◆ generate_proxy_header_v1()

int generate_proxy_header_v1 ( char *  buffer,
int  buffer_size,
int  thread_id,
const char *  proxy_src_ip,
const char *  proxy_dst_ip,
const char *  proxy_src_port,
const char *  proxy_dst_port 
)

◆ generate_proxy_header_v2()

int generate_proxy_header_v2 ( char *  buffer,
int  buffer_size,
int  thread_id,
const char *  proxy_src_ip,
const char *  proxy_dst_ip,
const char *  proxy_src_port,
const char *  proxy_dst_port 
)

◆ get_debug_level()

int get_debug_level ( void  )

◆ get_now_timestamp()

size_t get_now_timestamp ( char *  stamp,
gsize  stamp_size 
)

◆ get_now_timestamp_bsd()

size_t get_now_timestamp_bsd ( char *  stamp,
gsize  stamp_size 
)

◆ open_ssl_connection()

SSL* open_ssl_connection ( int  sock_fd)

◆ resolve_address_using_getaddrinfo()

struct addrinfo* resolve_address_using_getaddrinfo ( int  sock_type,
const char *  target,
const char *  port,
int  use_ipv6 
)

◆ set_debug_level()

void set_debug_level ( int  new_debug)

◆ time_val_diff_in_sec()

double time_val_diff_in_sec ( struct timeval *  t1,
struct timeval *  t2 
)

◆ time_val_diff_in_timeval()

void time_val_diff_in_timeval ( struct timeval *  res,
const struct timeval *  t1,
const struct timeval *  t2 
)

◆ time_val_diff_in_usec()

unsigned long time_val_diff_in_usec ( struct timeval *  t1,
struct timeval *  t2 
)