File: icmplog.h

package info (click to toggle)
jail 1:1.5-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 156 kB
  • ctags: 66
  • sloc: ansic: 481; makefile: 74; sh: 25
file content (63 lines) | stat: -rw-r--r-- 1,599 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
 * $Id: icmplog.h,v 1.1.1.1 1999/04/09 20:49:04 ams Exp $
 * Copyright 1998 ams@wiw.org (Abhijit Menon-Sen)
 */

#include "common.h"

#include <netinet/ip_icmp.h>

#define MAX_ICMP 18

char *version = "icmplog " VERSION ", ams@wiw.org";
char *cfgfile = ICMPLOG_CONF;

/* default log level */
short int lvl = LOG_WARNING;

/* default logging facility */
short int fac = LOG_DAEMON;

/* ICMP packet */
typedef struct {
    struct iphdr ip;
    struct icmphdr icmp;
    char data[0];
} icmppkt;

/* level at which each packet is logged */
short int levels[256];

typedef struct {
    char *name;
    int type;
} tname;

/* configuration file type keywords */
tname names[] = { { "echoreply", 0 },
                  { "destunreach", 3 },
                  { "quench", 4 },
                  { "redirect", 5 },
                  { "echo", 8 },
                  { "timeout", 11 },
                  { "paramprob", 12 },
                  { "timereq", 13 },
                  { "timerep", 14 },
                  { "inforeq", 15 },
                  { "inforep", 16 }
                };


/* ICMP packet type names (RFC 792) */
char *types[256] = { "echo reply", NULL, NULL,
                     "destination unreachable",
                     "source quench",
                     "redirect", NULL, NULL,
                     "echo", NULL, NULL,
                     "time exceeded",
                     "parameter problem",
                     "timestamp request",
                     "timestamp reply",
                     "info request",
                     "info reply"
                   };