Core
[DES-SERT Library]

EXTERNAL / PUBLIC. More...

Collaboration diagram for Core:

Defines

#define DESSERT_FRAMEID_MAX   ((uint64_t)-1)
 type for local unique packet identification
#define DESSERT_OPT_DAEMONIZE   0x0100
 flag for dessert_init - daemonize when calling disables logging to STDERR
#define DESSERT_OPT_NODAEMONIZE   0x0200
 flag for dessert_init - do not daemonize when calling

Functions

int dessert_init (const char *proto, int version, uint16_t opts)
 Initializes dessert framework and sets up logging.
int dessert_pid (char *pidfile)
 Write pid to file.
int dessert_run (void)
 main loop - wait until dessert_exit() is called or killed
void dessert_exit (void)
 Causes dessert_run() to break out of the main loop.

Variables

char dessert_proto [DESSERT_PROTO_STRLEN+1]
 protocol string used in dessert_msg frames
u_int8_t dessert_ver
 version int used in dessert_msg frames
u_int8_t dessert_l25_defsrc [ETHER_ADDR_LEN]
 default src address used for local generated dessert_msg frames
u_char ether_broadcast [ETHER_ADDR_LEN]
 constant holding ethernet broadcast address after dessert_init
u_char ether_null [ETHER_ADDR_LEN]
 constant holding ethernet null address after dessert_init
pthread_rwlock_t dessert_cfglock
 the config funnel

Detailed Description

EXTERNAL / PUBLIC.


Function Documentation

int dessert_init ( const char *  proto,
int  version,
uint16_t  opts 
)

Initializes dessert framework and sets up logging.

  • *proto 4 char string for protocol name
  • version version number of protocol
  • opts
    See also:
    DESSERT_OPT_*
    Returns:
    DESSERT_OK on success, DESSERT_ERR otherwise
int dessert_pid ( char *  pidfile  ) 

Write pid to file.

Write the process id to a file.

Parameters:
pidfile filename of pid file
Returns:
DESSERT_OK if pid written and file closed, else DESSERT_ERR
int dessert_run ( void   ) 

main loop - wait until dessert_exit() is called or killed

Returns:
arg to dessert_exit