From 90a9fdb668d64fd225973ab1e4bdcfd9bb9d97c5 Mon Sep 17 00:00:00 2001 From: marta Date: Mon, 2 Nov 2009 15:26:56 +0000 Subject: [PATCH] Fix calls. --- dummynet/ipfw2_mod.c | 2 +- sample_hook | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100755 sample_hook diff --git a/dummynet/ipfw2_mod.c b/dummynet/ipfw2_mod.c index 8910cbc..26fb5d9 100644 --- a/dummynet/ipfw2_mod.c +++ b/dummynet/ipfw2_mod.c @@ -483,7 +483,7 @@ linux_lookup(const int proto, const __be32 saddr, const __be16 sport, sk = (dir) ? inet_lookup(_OPT_NET_ARG &tcp_hashinfo, daddr, dport, saddr, sport, // matches outgoing for server sockets - net_iif(skb)) : + inet_iif(skb)) : inet_lookup(_OPT_NET_ARG &tcp_hashinfo, saddr, sport, daddr, dport, // matches incoming for server sockets skb->dev->ifindex); diff --git a/sample_hook b/sample_hook new file mode 100755 index 0000000..b47c8de --- /dev/null +++ b/sample_hook @@ -0,0 +1,34 @@ +#!/bin/sh + +# +# Marta Carbone +# 2009 - Universita` di Pisa +# +# This is a sample hook file in charge to collect +# statistical information on netconfig usage. It dumps +# on a log file slicename, port and the configuration string +# used to configure a dummynet experiment. +# +# Each time a user configure a dummynet port, this file +# will be executed. +# The following variables will be passed as argument: +# +# ${SLICE} ${PORT} ${CONFIG_STRING} +# ${SLICE} The slicename executing the netconfig command +# ${PORT} The port to be configured +# ${CONFIG_STRING} The configuration string +# +# Note that this script can get additional information +# by executing the ipfw command, e.g. +# ipfw list # list of installed rules +# ipfw show # list of rules and statistical information +# ipfw pipe show # list of pipes +# +# a complete list of ipfw commands is available at: +# http://www.freebsd.org/cgi/man.cgi?query=ipfw&sektion=8 + +# logfile +LOG_FILE=/tmp/ipfw_hook.log + +echo -e `date` >> ${LOG_FILE} +echo "$*" >> ${LOG_FILE} -- 2.43.0