Lectures notes for 2010 - KTH

Lectures notes for 2010 - KTH Lectures notes for 2010 - KTH

20.01.2014 Views

print PTMP "$time $RSSId\n"; $count++; print "sourcename is $sourcename; sourcename1 is $sourcename1 \n"; } else { if ($sourcename =~ $sourcename1) { print PTMP "$time $RSSId\n"; } else { print "sourcename is $sourcename, old sourcename is $sourcename1\n"; close PTMP; chmod 0664, ’/tmp/ptmp’; system("mv /tmp/ptmp $sourcename1"); $sourcename1 = $sourcename; &create_tmp_file; print PTMP "$time $RSSId\n"; } } } } close PTMP; chmod 0664, ’/tmp/ptmp’; system("mv /tmp/ptmp $sourcename1"); close DATA_FILE; sub create_tmp_file { # open(PTMP, ">/tmp/ptmptmp$$") || die "Can’t create tmp file $!\n"; # close (PTMP); # $locked = link("/tmp/ptmptmp$$", ’/tmp/ptmp’); # unlink "/tmp/ptmptmp$$"; # $locked || die "Can’t lock temporary file.\n"; open(PTMP, ">/tmp/ptmp") || die "Can’t open tmp file $! for writing\n"; } This script process captured IEEE 802.11 packets to put measurements of the different sources into their own files, based upon the source MAC address. (In this case the program assumes that the file has already been sorted based upon the source MAC address.) Maguire Using a Perl script 1: 85 of 104 maguire@kth.se 2010.03.21 Internetworking/Internetteknik

Choosing which columns to display Figure 24: Set your preferences for the User Interface Maguire Choosing which columns to display 1: 86 of 104 maguire@kth.se 2010.03.21 Internetworking/Internetteknik

Choosing which columns to display<br />

Figure 24: Set your preferences <strong>for</strong> the User Interface<br />

Maguire Choosing which columns to display 1: 86 of 104<br />

maguire@kth.se <strong>2010</strong>.03.21 Internetworking/Internetteknik

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!