This repo is obsolete, please see git://git.code.sf.net/p/dummynet/code@master
[ipfw.git] / planetlab / sample_hook
1 #!/bin/sh
2
3 #
4 # Marta Carbone <marta.carbone@iet.unipi.it>
5 # 2009 - Universita` di Pisa
6 #
7 # This is a sample hook file in charge to collect
8 # statistical information on netconfig usage. It dumps
9 # on a log file slicename, port and the configuration string
10 # used to configure a dummynet experiment.
11 #
12 # Each time a user configure a dummynet port, this file
13 # will be executed.
14 # The following variables will be passed as argument:
15
16 # ${SLICE} ${PORT} ${CONFIG_STRING} 
17 # ${SLICE} The slicename executing the netconfig command
18 # ${PORT} The port to be configured
19 # ${CONFIG_STRING} The configuration string
20 #
21 # Note that this script can get additional information
22 # by executing the ipfw command, e.g.
23 # ipfw list             # list of installed rules
24 # ipfw show             # list of rules and statistical information
25 # ipfw pipe show        # list of pipes
26 #
27 # a complete list of ipfw commands is available at:
28 # http://www.freebsd.org/cgi/man.cgi?query=ipfw&sektion=8
29
30 # logfile
31 LOG_FILE=/tmp/ipfw_hook.log
32
33 echo -e `date` >> ${LOG_FILE}
34 echo "$*" >> ${LOG_FILE}