dsniff  2.4b2
About: A collection of tools for network auditing
  Fossies Dox: dsniff-2.4b2.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

trigger.c File Reference
#include "config.h"
#include <sys/types.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <err.h>
#include <libnet.h>
#include <nids.h>
#include "decode.h"
#include "magic.h"
#include "options.h"
#include "pathnames.h"
#include "record.h"
#include "tcp_raw.h"
#include "trigger.h"
Include dependency graph for trigger.c:

Go to the source code of this file.

Data Structures

struct  trigger
 

Functions

static int trigger_compare (const void *a, const void *b)
 
int trigger_set_ip (int num, char *name)
 
int trigger_set_udp (int num, char *name)
 
int trigger_set_tcp (int num, char *name)
 
int trigger_set_rpc (int num, char *name)
 
static int trigger_set (char *proto, int num, char *name)
 
static struct triggertrigger_set_magic (int proto, int num, u_char *buf, int len)
 
void trigger_dump (void)
 
void trigger_ip (struct libnet_ipv4_hdr *ip)
 
void trigger_udp (struct libnet_ipv4_hdr *ip)
 
static void trigger_tcp_half (struct tuple4 *addr, struct half_stream *hs, struct trigger *t)
 
void trigger_tcp (struct tcp_stream *ts, void **conn_save)
 
void trigger_tcp_raw (struct libnet_ipv4_hdr *ip)
 
static void trigger_tcp_raw_callback (u_int32_t src, u_int32_t dst, u_short sport, u_short dport, u_char *buf, int len)
 
void trigger_tcp_raw_timeout (int signal)
 
void trigger_rpc (int program, int proto, int port)
 
void trigger_init_magic (char *filename)
 
void trigger_init_list (char *list)
 
void trigger_init_services (char *services)
 

Variables

static struct trigger ip_triggers [32]
 
static struct trigger udp_triggers [512]
 
static struct trigger tcp_triggers [512]
 
static struct trigger rpc_triggers [32]
 
static u_int ip_cnt = 0
 
static u_int udp_cnt = 0
 
static u_int tcp_cnt = 0
 
static u_int rpc_cnt = 0
 
static char obuf [4096]
 

Function Documentation

◆ trigger_compare()

static int trigger_compare ( const void *  a,
const void *  b 
)
static

◆ trigger_dump()

void trigger_dump ( void  )

◆ trigger_init_list()

void trigger_init_list ( char *  list)

Definition at line 553 of file trigger.c.

References errx(), strsep(), and trigger_set().

Referenced by main().

◆ trigger_init_magic()

void trigger_init_magic ( char *  filename)

Definition at line 547 of file trigger.c.

References magic_init().

Referenced by main().

◆ trigger_init_services()

void trigger_init_services ( char *  services)

Definition at line 567 of file trigger.c.

References errx(), and trigger_set().

Referenced by main().

◆ trigger_ip()

void trigger_ip ( struct libnet_ipv4_hdr *  ip)

◆ trigger_rpc()

void trigger_rpc ( int  program,
int  proto,
int  port 
)

◆ trigger_set()

static int trigger_set ( char *  proto,
int  num,
char *  name 
)
static

◆ trigger_set_ip()

int trigger_set_ip ( int  num,
char *  name 
)

◆ trigger_set_magic()

static struct trigger* trigger_set_magic ( int  proto,
int  num,
u_char *  buf,
int  len 
)
static

◆ trigger_set_rpc()

int trigger_set_rpc ( int  num,
char *  name 
)

◆ trigger_set_tcp()

int trigger_set_tcp ( int  num,
char *  name 
)

◆ trigger_set_udp()

int trigger_set_udp ( int  num,
char *  name 
)

◆ trigger_tcp()

void trigger_tcp ( struct tcp_stream *  ts,
void **  conn_save 
)

Definition at line 388 of file trigger.c.

References trigger::num, Opt_magic, Opt_snaplen, tcp_cnt, tcp_triggers, trigger_compare(), and trigger_tcp_half().

Referenced by main().

◆ trigger_tcp_half()

static void trigger_tcp_half ( struct tuple4 *  addr,
struct half_stream *  hs,
struct trigger t 
)
static

◆ trigger_tcp_raw()

void trigger_tcp_raw ( struct libnet_ipv4_hdr *  ip)

◆ trigger_tcp_raw_callback()

static void trigger_tcp_raw_callback ( u_int32_t  src,
u_int32_t  dst,
u_short  sport,
u_short  dport,
u_char *  buf,
int  len 
)
static

◆ trigger_tcp_raw_timeout()

void trigger_tcp_raw_timeout ( int  signal)

Definition at line 520 of file trigger.c.

References tcp_raw_timeout(), trigger_tcp_raw_callback(), and TRIGGER_TCP_RAW_TIMEOUT.

Referenced by main().

◆ trigger_udp()

void trigger_udp ( struct libnet_ipv4_hdr *  ip)

Variable Documentation

◆ ip_cnt

u_int ip_cnt = 0
static

Definition at line 38 of file trigger.c.

Referenced by trigger_dump(), trigger_ip(), and trigger_set_ip().

◆ ip_triggers

struct trigger ip_triggers[32]
static

Definition at line 33 of file trigger.c.

Referenced by trigger_dump(), trigger_ip(), and trigger_set_ip().

◆ obuf

◆ rpc_cnt

u_int rpc_cnt = 0
static

Definition at line 41 of file trigger.c.

Referenced by trigger_dump(), trigger_rpc(), and trigger_set_rpc().

◆ rpc_triggers

struct trigger rpc_triggers[32]
static

Definition at line 36 of file trigger.c.

Referenced by trigger_dump(), trigger_rpc(), and trigger_set_rpc().

◆ tcp_cnt

u_int tcp_cnt = 0
static

◆ tcp_triggers

struct trigger tcp_triggers[512]
static

◆ udp_cnt

u_int udp_cnt = 0
static

Definition at line 39 of file trigger.c.

Referenced by trigger_dump(), trigger_set_magic(), trigger_set_udp(), and trigger_udp().

◆ udp_triggers

struct trigger udp_triggers[512]
static

Definition at line 34 of file trigger.c.

Referenced by trigger_dump(), trigger_set_magic(), trigger_set_udp(), and trigger_udp().