21 December 2002

Finished off side, a little ditty that took an hour or two. It takes a filter arguement, and two file names. It then runs the two files through the filter (one at a time), and then displays the output of each beside each other. Therefore, the command:

./side "/home/mikal/opensource-stable/mi/i - < %s"
   ../shdns/sample-response ../shdns/shdns-response  | less

Takes two DNS packets, and displays them after they have been pretty printed. The output looks like this:

/home/mikal/opensource-stable/mi/i - < ../shdns/sample-response        | /home/mikal/opensource-stable/mi/i - < ../shdns/shdns-response
                                                                       |
0                 135       0x87       0207                            | 0                 135       0x87       0207
1                 210       0xD2       0322                            | 1                 210       0xD2       0322
2                 133       0x85       0205                            | 2                  10        0xA        012
3                 128       0x80       0200                            | 3                  56       0x38        070       '8'
4                   0        0x0         00                            | 4                   0        0x0         00
5                   1        0x1         01                            | 5                   0        0x0         00
6                   0        0x0         00                            | 6                   1        0x1         01
7                   1        0x1         01                            | 7                   0        0x0         00
8                   0        0x0         00                            | 8                   1        0x1         01
9                   1        0x1         01                            | 9                   0        0x0         00
10                  0        0x0         00                            | 10                  0        0x0         00
11                  0        0x0         00                            | 11                  0        0x0         00
12                  3        0x3         03                            | 12                  0        0x0         00
13                119       0x77       0167       'w'                  | 13                  3        0x3         03
14                119       0x77       0167       'w'                  | 14                119       0x77       0167       'w'
15                119       0x77       0167       'w'                  | 15                119       0x77       0167       'w'
16                  7        0x7         07                            | 16                119       0x77       0167       'w'
17                115       0x73       0163       's'                  | 17                  7        0x7         07
18                116       0x74       0164       't'                  | 18                115       0x73       0163       's'
19                105       0x69       0151       'i'                  | 19                116       0x74       0164       't'
20                108       0x6C       0154       'l'                  | 20                105       0x69       0151       'i'
21                108       0x6C       0154       'l'                  | 21                108       0x6C       0154       'l'
22                104       0x68       0150       'h'                  | 22                108       0x6C       0154       'l'
23                113       0x71       0161       'q'                  | 23                104       0x68       0150       'h'
24                  3        0x3         03                            | 24                113       0x71       0161       'q'
25                 99       0x63       0143       'c'                  | 25                  3        0x3         03
26                111       0x6F       0157       'o'                  | 26                 99       0x63       0143       'c'
27                109       0x6D       0155       'm'                  | 27                111       0x6F       0157       'o'
28                  0        0x0         00                            | 28                109       0x6D       0155       'm'
29                  0        0x0         00                            | 29                  1        0x1         01
30                  1        0x1         01                            | 30                  3        0x3         03
31                  0        0x0         00                            | 31                119       0x77       0167       'w'
32                  1        0x1         01                            | 32                119       0x77       0167       'w'
33                192       0xC0       0300                            | 33                119       0x77       0167       'w'
[snip]

It handles line wrapping and stuff like that, but it is not a visual diff. It might one day be, who knows?

You can get the code from here.