Pulling this out from an old script ages back...

read code to understand what is being done..very very simple..

#!/usr/bin/perl

while (<>){
        if ( $_ =~ /^\t/ ) {
                s/\t//g;
                chop;
                printf "\t%-40s\t",$_;
                @line=split;
                while ($word=shift(@line) ) {
                        $bytea=pack("H2",substr($word,0,2));
                        if ( ord($bytea) < 32 || ord($bytea) > 126 ) {
                                printf ".",$bytea;
                        } else {
                                printf "%s",$bytea;
                        }
                        $byteb=pack("H2",substr($word,2,2));
                        if ( ord($byteb) < 32 || ord($byteb) > 126 ) {
                                printf ".",$byteb;
                        } else {
                                printf "%s",$byteb;
                        }
                }
                printf "\n";
        } else {
                print;
        }
}

exit(0);


>
>
>   hi,
>      by using the command "tcpdump -x" you can get the raw information
about
>   the packets in hexadecimal format .
>     can anybody tell me how to interpret it from that format.
>   the information regarding the packets is given by tcpdump , but i would
>   like to know how it is interpreted from the raw data.
>
>   Gaurav.Rajput
>   <[EMAIL PROTECTED]>
>
>
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to [EMAIL PROTECTED]
>

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to