"Fossies" - the Fresh Open Source Software Archive

Member "arpwatch-NG1.7/contrib/d.awk" (21 Jan 2007, 315 Bytes) of archive /linux/misc/old/arpwatch-NG1.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) (G)AWK source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 # DECnet hacking
    2 
    3 BEGIN {
    4     n = 0
    5     sdecnet = "aa:0:4:"
    6     ldecnet = length(sdecnet)
    7 }
    8 
    9 {
   10     ++n
   11     e[n] = $1
   12     h[n] = $2
   13     if (sdecnet == substr($1, 1, ldecnet))
   14         decnet[$2] = 1
   15 }
   16 
   17 END {
   18     for (i = 1; i <= n; ++i) {
   19         if (decnet[h[i]] && sdecnet != substr(e[i], 1, ldecnet))
   20             h[i] = h[i] "-ip"
   21         print e[i] "\t" h[i]
   22     }
   23 }