C:/Anonymizer/anonymizer0_3_3.cpp File Reference

#include <pcap.h>
#include <net/ethernet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <netinet/tcp.h>
#include <netinet/ip_icmp.h>
#include "Codifier.h"

Include dependency graph for anonymizer0_3_3.cpp:

Go to the source code of this file.

Classes

struct  options
struct  pseudo1

Defines

#define PACKET_SIZE   65535

Functions

void sec_to_min (long seconds, double usec)
pcap_t * pcap_open_live (const char *device, int snaplen, int promisc, int to_ms, char *errbuf)
pcap_t * pcap_open_offline (const char *input, char *errbuf)
int pcap_findalldevs (pcap_if_t **alldevsp, char *errbuf)
pcap_dumper_t * pcap_dump_open (pcap_t *descr, const char *output)
void pcap_dump (u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
void pcap_dump_close (pcap_dumper_t *p)
void pcap_close (pcap_t *p)
const u_char * pcap_next (pcap_t *p, struct pcap_pkthdr *h)
int pcap_datalink (pcap_t *p)
options readOptions (int argcc, char **argv, int *count)
void processIP (const u_char *datipkt, struct pcap_pkthdr hdr, pcap_dumper_t *descrOUT, options o, Codifier &)
void processARP (const u_char *datipkt, struct pcap_pkthdr hdr, pcap_dumper_t *descrOUT, options o, Codifier &codificatore)
void processUDP (const u_char *datipkt, struct pcap_pkthdr hdr, pcap_dumper_t *descrOUT, options o)
void processTCP (const u_char *datipkt, struct pcap_pkthdr hdr, pcap_dumper_t *descrOUT, options o)
void processICMP (const u_char *datipkt, struct pcap_pkthdr hdr, pcap_dumper_t *descrOUT, options o, Codifier &codificatore)
int handle_ip (const struct ip *ip, int *lev4)
int Checksum (const u_char *Buff, int BufLen)
int checksumTCPUDP (const struct in_addr src, const struct in_addr dst, const u_int8_t protocol, const u_int16_t length, u_char *pkth)
void showHelp ()
int main (int argc, char **argv)

Variables

int pktprocessed
int pktanonymized
int pktdropped


Define Documentation

#define PACKET_SIZE   65535
 

Definition at line 33 of file anonymizer0_3_3.cpp.

Referenced by main().


Function Documentation

int Checksum const u_char *  Buff,
int  BufLen
 

Definition at line 1002 of file anonymizer0_3_3.cpp.

Referenced by processICMP(), processIP(), processTCP(), and processUDP().

int checksumTCPUDP const struct in_addr  src,
const struct in_addr  dst,
const u_int8_t  protocol,
const u_int16_t  length,
u_char *  pkth
 

Definition at line 1023 of file anonymizer0_3_3.cpp.

References pseudo1::dst, pseudo1::prot, pseudo1::src, pseudo1::transplen, and pseudo1::zeros.

Referenced by processTCP(), and processUDP().

int handle_ip const struct ip *  ip,
int *  lev4
 

Definition at line 996 of file anonymizer0_3_3.cpp.

Referenced by processICMP(), processIP(), processTCP(), and processUDP().

int main int  argc,
char **  argv
 

Definition at line 82 of file anonymizer0_3_3.cpp.

References options::cutPayload, options::dimIPaddr, options::dimPayload, options::invalidOption, options::live, PACKET_SIZE, pcap_datalink(), pcap_dump_open(), pcap_findalldevs(), pcap_next(), pcap_open_live(), pktanonymized, pktdropped, pktprocessed, options::prefix, readOptions(), showHelp(), and options::verbose.

Here is the call graph for this function:

void pcap_close pcap_t *  p  ) 
 

int pcap_datalink pcap_t *  p  ) 
 

Referenced by main().

void pcap_dump u_char *  user,
const struct pcap_pkthdr *  h,
const u_char *  sp
 

Referenced by processARP(), processICMP(), processIP(), processTCP(), and processUDP().

void pcap_dump_close pcap_dumper_t *  p  ) 
 

pcap_dumper_t* pcap_dump_open pcap_t *  descr,
const char *  output
 

Referenced by main().

int pcap_findalldevs pcap_if_t **  alldevsp,
char *  errbuf
 

Referenced by main().

const u_char* pcap_next pcap_t *  p,
struct pcap_pkthdr *  h
 

Referenced by main().

pcap_t* pcap_open_live const char *  device,
int  snaplen,
int  promisc,
int  to_ms,
char *  errbuf
 

Referenced by main().

pcap_t* pcap_open_offline const char *  input,
char *  errbuf
 

void processARP const u_char *  datipkt,
struct pcap_pkthdr  hdr,
pcap_dumper_t *  descrOUT,
options  o,
Codifier codificatore
 

Definition at line 529 of file anonymizer0_3_3.cpp.

References Codifier::Codifica(), options::dimIPaddr, pcap_dump(), and options::prefix.

Here is the call graph for this function:

void processICMP const u_char *  datipkt,
struct pcap_pkthdr  hdr,
pcap_dumper_t *  descrOUT,
options  o,
Codifier codificatore
 

Definition at line 801 of file anonymizer0_3_3.cpp.

References Checksum(), Codifier::Codifica(), options::cutPayload, options::dimIPaddr, options::dimPayload, handle_ip(), pcap_dump(), and options::prefix.

Referenced by processIP().

Here is the call graph for this function:

void processIP const u_char *  datipkt,
struct pcap_pkthdr  hdr,
pcap_dumper_t *  descrOUT,
options  o,
Codifier
 

Definition at line 566 of file anonymizer0_3_3.cpp.

References Checksum(), Codifier::Codifica(), options::cutPayload, options::dimIPaddr, options::dimPayload, handle_ip(), pcap_dump(), pktanonymized, pktdropped, options::prefix, processICMP(), processTCP(), processUDP(), and options::verbose.

Here is the call graph for this function:

void processTCP const u_char *  datipkt,
struct pcap_pkthdr  hdr,
pcap_dumper_t *  descrOUT,
options  o
 

Definition at line 740 of file anonymizer0_3_3.cpp.

References Checksum(), checksumTCPUDP(), options::cutPayload, options::dimPayload, handle_ip(), pcap_dump(), and options::verbose.

Referenced by processIP().

Here is the call graph for this function:

void processUDP const u_char *  datipkt,
struct pcap_pkthdr  hdr,
pcap_dumper_t *  descrOUT,
options  o
 

Definition at line 668 of file anonymizer0_3_3.cpp.

References Checksum(), checksumTCPUDP(), options::cutPayload, options::dimPayload, handle_ip(), and pcap_dump().

Referenced by processIP().

Here is the call graph for this function:

options readOptions int  argcc,
char **  argv,
int *  count
 

Definition at line 372 of file anonymizer0_3_3.cpp.

References options::cutPayload, options::dimIPaddr, options::dimPayload, options::invalidOption, options::live, options::prefix, showHelp(), and options::verbose.

Referenced by main().

Here is the call graph for this function:

void sec_to_min long  seconds,
double  usec
 

Definition at line 337 of file anonymizer0_3_3.cpp.

void showHelp  ) 
 

Definition at line 355 of file anonymizer0_3_3.cpp.

Referenced by main(), and readOptions().


Variable Documentation

int pktanonymized
 

Definition at line 79 of file anonymizer0_3_3.cpp.

Referenced by main(), and processIP().

int pktdropped
 

Definition at line 79 of file anonymizer0_3_3.cpp.

Referenced by main(), and processIP().

int pktprocessed
 

Definition at line 79 of file anonymizer0_3_3.cpp.

Referenced by main().


Generated on Mon Feb 13 22:40:53 2006 for Anonymizer by  doxygen 1.4.6-NO