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)  

sshow.c File Reference
#include "config.h"
#include <sys/types.h>
#include <sys/times.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <err.h>
#include <nids.h>
#include <pcap.h>
#include "pcaputil.h"
Include dependency graph for sshow.c:

Go to the source code of this file.

Data Structures

struct  range
 
struct  record
 
struct  history
 
struct  line
 
struct  session
 

Macros

#define HISTORY_SIZE   16
 
#define CLK_TCK   1
 

Functions

static void usage (void)
 
static clock_t add_history (struct session *session, int direction, u_int cipher_size, range *plain_range)
 
static recordget_history (struct session *session, int age)
 
static char * s_saddr (struct tcp_stream *ts)
 
static char * s_daddr (struct tcp_stream *ts)
 
static char * s_range (range *range)
 
static void print_data (struct half_stream *stream, u_int count)
 
static u_int ssh1_plain_size (struct half_stream *stream)
 
static u_int ssh1_cipher_size (struct half_stream *stream)
 
static rangessh1_plain_range (struct half_stream *stream)
 
static rangessh2_plain_range (struct half_stream *stream)
 
static void client_to_server (struct tcp_stream *ts, struct session *session, u_int cipher_size, range *plain_range)
 
static void server_to_client (struct tcp_stream *ts, struct session *session, u_int cipher_size, range *plain_range)
 
static void process_data (struct tcp_stream *ts, struct session *session)
 
static void process_event (struct tcp_stream *ts, struct session **session)
 
static void null_syslog (int type, int errnum, struct ip *iph, void *data)
 
static void cleanup (int signum)
 
int main (int argc, char *argv[])
 

Variables

static int debug = 0
 
static clock_t now
 

Macro Definition Documentation

◆ CLK_TCK

#define CLK_TCK   1

Definition at line 43 of file sshow.c.

◆ HISTORY_SIZE

#define HISTORY_SIZE   16

Definition at line 42 of file sshow.c.

Function Documentation

◆ add_history()

static clock_t add_history ( struct session session,
int  direction,
u_int  cipher_size,
range plain_range 
)
static

◆ cleanup()

static void cleanup ( int  signum)
static

Definition at line 606 of file sshow.c.

Referenced by main().

◆ client_to_server()

static void client_to_server ( struct tcp_stream *  ts,
struct session session,
u_int  cipher_size,
range plain_range 
)
static

◆ get_history()

static record* get_history ( struct session session,
int  age 
)
static

Definition at line 113 of file sshow.c.

References session::history, HISTORY_SIZE, history::index, and history::packets.

Referenced by server_to_client().

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 612 of file sshow.c.

References cleanup(), copy_argv(), debug, errx(), null_syslog(), process_event(), usage(), and warnx().

◆ null_syslog()

static void null_syslog ( int  type,
int  errnum,
struct ip *  iph,
void *  data 
)
static

Definition at line 601 of file sshow.c.

Referenced by main().

◆ print_data()

static void print_data ( struct half_stream *  stream,
u_int  count 
)
static

Definition at line 157 of file sshow.c.

References memcmp().

Referenced by client_to_server(), process_data(), and server_to_client().

◆ process_data()

static void process_data ( struct tcp_stream *  ts,
struct session session 
)
static

◆ process_event()

static void process_event ( struct tcp_stream *  ts,
struct session **  session 
)
static

Definition at line 552 of file sshow.c.

References debug, err(), now, process_data(), s_daddr(), and s_saddr().

Referenced by main().

◆ s_daddr()

static char* s_daddr ( struct tcp_stream *  ts)
static

Definition at line 135 of file sshow.c.

Referenced by client_to_server(), process_data(), process_event(), and server_to_client().

◆ s_range()

static char* s_range ( range range)
static

Definition at line 146 of file sshow.c.

References range::max, and range::min.

Referenced by client_to_server(), and server_to_client().

◆ s_saddr()

static char* s_saddr ( struct tcp_stream *  ts)
static

Definition at line 124 of file sshow.c.

Referenced by client_to_server(), process_data(), process_event(), and server_to_client().

◆ server_to_client()

static void server_to_client ( struct tcp_stream *  ts,
struct session session,
u_int  cipher_size,
range plain_range 
)
static

◆ ssh1_cipher_size()

static u_int ssh1_cipher_size ( struct half_stream *  stream)
static

Definition at line 187 of file sshow.c.

References ssh1_plain_size().

Referenced by process_data().

◆ ssh1_plain_range()

static range* ssh1_plain_range ( struct half_stream *  stream)
static

Definition at line 193 of file sshow.c.

References range::max, range::min, and ssh1_plain_size().

Referenced by process_data().

◆ ssh1_plain_size()

static u_int ssh1_plain_size ( struct half_stream *  stream)
static

Definition at line 176 of file sshow.c.

Referenced by ssh1_cipher_size(), and ssh1_plain_range().

◆ ssh2_plain_range()

static range* ssh2_plain_range ( struct half_stream *  stream)
static

Definition at line 202 of file sshow.c.

References range::max, and range::min.

Referenced by process_data().

◆ usage()

static void usage ( void  )
static

Definition at line 82 of file sshow.c.

Referenced by main().

Variable Documentation

◆ debug

int debug = 0
static

Definition at line 77 of file sshow.c.

Referenced by client_to_server(), main(), process_data(), process_event(), and server_to_client().

◆ now

clock_t now
static

Definition at line 79 of file sshow.c.

Referenced by add_history(), process_event(), server_to_client(), tcp_raw_timeout(), and timestamp().