File: config_h1.awk

package info (click to toggle)
ntop 3%3A5.0.1%2Bdfsg1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 15,720 kB
  • ctags: 11,480
  • sloc: ansic: 79,804; sh: 21,658; python: 1,948; awk: 1,504; perl: 971; makefile: 745; php: 123; xml: 71; sql: 13; sed: 11
file content (104 lines) | stat: -rwxr-xr-x 2,293 bytes parent folder | download | duplicates (4)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#/* #undef CFG_BIG_ENDIAN */
#
#/* Configuration file directory */
##define CFG_CONFIGFILE_DIR "/usr/share/ntop"
#
/RETSIGTYPE/ { next }
/const/      { next }
/inline/     { next }
/pid_t/      { next }
/size_t/     { next }
/vfork/      { next }
/volatile/   { next }
/PACKAGE_/   { next }
/VERSION/    { next }
/STACK_DIRECTION/ { next }
/CRAY_STACKSEG_END/ { next }
/ENDIAN/     { next }
/CFG_[A-Z]*_DIR/ { next }
/CFG_[A-Z]*_ENDIAN/ { next }
/CFG_NEED_GETDOMAINNAME/ { next }
/BITFLAG_/ { next }
/ETHERTYPE_/ { next }
/ICMP_/ { next }
/LLCSAP_/ { next }
/CONST_LLC_/ { next }
/FLAG_/ { next }
/TCPOPT_/ { next }
/ [CT]_/ { next }
/ __/ { next }
/argument/ { next }
/FALSE/ { next }
/TRUE/ { next }
/IN[A-Z0-9]*SZ/ { next }
/FIXEDSZ/ { next }
/WNOHANG/ { next }
/0xffffffff/ { next }
/IPPROTO_/ { next }
/LOG_AUTHPRIV/ { next }
/CONST_URL_PROHIBITED_CHARACTERS/ { next }
/HTML_OPENSSL_URL/ { next }
/DEFAULT_NTOP_MAPPER_URL/ { next }
/SLL_HDR_LEN/ { next }
/SAP_/ { next }
/PROTOTYPES/ { next }
/CONST_TR_/ { next } 
/CONST_FDDIFC_/ { next }
/CONST_[^_]*_TRACE_/ { next }
/ DLT_/ { next }
/atoi\(/ { next }
$2 ~ /\(/ { next } # Skip true macro defines

$2 == "PACKAGE" { next }

/^$/ { next}

{
  i=1
  if ($1 == "/*") {
    i=2
    if ( ($i != "#undef") && ($i != "#define") ) { next }
    shift
  }

  if (substr($i, 1, 1) != "#") { next }
  if (substr($i, 1, 3) == "#if") { next }

  i++

  if (tolower($i) == $i) { next } 

  field=$i

  if ((index(field, "_DEBUG") > 0) && (index(field, "DEFAULT") == 0)) {
     sortname="z" field
  } else {
     sortname=field
  }

  i++

  if ($i == "") {
      tag = "*"
  } else if ($i == "*/") {
      tag = "*"
  } else if ( ($i == "1") && ( (sortname ~ /ENABLE/) ||
                               (sortname ~ /DISABLE/) ||
                               (sortname ~ /SHOW/) ||
                               (sortname ~ /PRINT/) ||
                               (sortname ~ /MAKE/) ||
                               (sortname ~ /HANDLE/) ||
                               (sortname ~ /DEFAULT/) ||
                               (sortname ~ /DEBUG/) ) ) {
      tag = "*"
  } else if ($i == "NULL") {
      tag = "NULL"
  } else if (substr($i,1,1) == "\"") {
      tag = field
  } else {
      tag = "#" field
  }
  print sortname " " tag

}