ekg2
|
#include "ekg2-config.h"
#include <stdio.h>
#include <string.h>
#include <pcap.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ekg/debug.h>
#include <ekg/plugins.h>
#include <ekg/commands.h>
#include <ekg/vars.h>
#include <ekg/userlist.h>
#include <ekg/stuff.h>
#include <ekg/recode.h>
#include <ekg/themes.h>
#include <ekg/queries.h>
#include <ekg/xmalloc.h>
#include <ekg/protocol.h>
#include "sniff_ip.h"
#include "sniff_gg.h"
#include "sniff_dns.h"
#include "sniff_rivchat.h"
#include "sniff_dns.inc"
#include "sniff_gg.inc"
#include "sniff_rivchat.inc"
Struktury danych | |
struct | connection_t |
Definicje | |
#define | _GNU_SOURCE |
#define | SNAPLEN 2000 |
#define | PROMISC 0 |
#define | GET_DEV(s) ((pcap_t *) ((session_t *) s)->priv) |
#define | MAX_BYTES_PER_LINE 16 |
#define | SNIFF_HANDLER(x, type) static int x(session_t *s, const connection_t *hdr, const type *pkt, int len) |
#define | CHECK_LEN(x) |
#define | CHECK_LEN(x) |
#define | RIVCHAT_PACKET_LEN 328 |
#define | WATCHER_PCAP(x, y) |
#define | DEFAULT_FILTER "(tcp and (net 217.17.41.80/28 or net 217.17.45.128/27 or net 85.232.236.0/24 or net 91.197.12.0/22)) or (udp and (port 16127 or port 53))" |
Definicje typów | |
typedef int(* | sniff_handler_t )(session_t *, const connection_t *, const unsigned char *, int) |
Wyliczenia | |
enum | pkt_way_t { SNIFF_OUTGOING = 0, SNIFF_INCOMING } |
Funkcje | |
static int | sniff_theme_init () |
PLUGIN_DEFINE (sniff, PLUGIN_PROTOCOL, sniff_theme_init) | |
static char * | build_code (const unsigned char *code) |
static char * | build_sha1 (const unsigned char *digest) |
static char * | build_hex (uint32_t hex) |
static char * | build_hex2 (uint32_t hex) |
static char * | _inet_ntoa (struct in_addr ip) |
static char * | _inet_ntoa6 (struct in6_addr ip) |
static char * | build_windowip_name (struct in_addr ip) |
static connection_t * | sniff_udp_get (const struct iphdr *ip, const struct udphdr *udp) |
static connection_t * | sniff_tcp_find_connection (const struct iphdr *ip, const struct tcphdr *tcp) |
static void | tcp_print_payload (u_char *payload, size_t len) |
static char * | tcp_print_flags (u_char tcpflag) |
static void | sniff_loop_tcp (session_t *s, int len, const u_char *packet, const struct iphdr *ip, int size_ip) |
static void | sniff_loop_udp (session_t *s, int len, const u_char *packet, const struct iphdr *ip) |
static void | sniff_loop_ip (session_t *s, int len, const u_char *packet) |
static void | sniff_loop_ether (u_char *data, const struct pcap_pkthdr *header, const u_char *packet) |
void | sniff_loop_sll (u_char *data, const struct pcap_pkthdr *header, const u_char *packet) |
WATCHER_PCAP (sniff_pcap_read_EN10MB, sniff_loop_ether) | |
WATCHER_PCAP (sniff_pcap_read_SLL, sniff_loop_sll) | |
WATCHER_PCAP (sniff_pcap_read, sniff_loop_ether) | |
static int | sniff_command_connect (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | sniff_command_disconnect (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | sniff_command_connections (const char *name, const char **params, session_t *session, const char *target, int quiet) |
static int | sniff_session_deinit (void *data, va_list ap) |
static int | sniff_validate_uid (void *data, va_list ap) |
static int | sniff_status_show (void *data, va_list ap) |
static int | sniff_print_version (void *data, va_list ap) |
EXPORT int | sniff_plugin_init (int prio) |
static int | sniff_plugin_destroy () |
Zmienne | |
static list_t | tcp_connections |
static plugins_params_t | sniff_plugin_vars [] |
#define _GNU_SOURCE |
#define CHECK_LEN | ( | x | ) |
#define CHECK_LEN | ( | x | ) |
#define DEFAULT_FILTER "(tcp and (net 217.17.41.80/28 or net 217.17.45.128/27 or net 85.232.236.0/24 or net 91.197.12.0/22)) or (udp and (port 16127 or port 53))" |
#define MAX_BYTES_PER_LINE 16 |
#define PROMISC 0 |
#define RIVCHAT_PACKET_LEN 328 |
#define SNAPLEN 2000 |
#define SNIFF_HANDLER | ( | x, | |
type | |||
) | static int x(session_t *s, const connection_t *hdr, const type *pkt, int len) |
#define WATCHER_PCAP | ( | x, | |
y | |||
) |
typedef int(* sniff_handler_t)(session_t *, const connection_t *, const unsigned char *, int) |
enum pkt_way_t |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
PLUGIN_DEFINE | ( | sniff | , |
PLUGIN_PROTOCOL | , | ||
sniff_theme_init | |||
) |
|
static |
|
static |
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
EXPORT int sniff_plugin_init | ( | int | prio | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
WATCHER_PCAP | ( | sniff_pcap_read_EN10MB | , |
sniff_loop_ether | |||
) |
WATCHER_PCAP | ( | sniff_pcap_read_SLL | , |
sniff_loop_sll | |||
) |
WATCHER_PCAP | ( | sniff_pcap_read | , |
sniff_loop_ether | |||
) |
|
static |
|
static |