[Click] File operations in Click

Cliff Frey cliff at meraki.com
Thu Jul 17 00:17:08 EDT 2008


You could add a write handler to your element, and write these delays in
(either one at a time, or a bunch at once).

On Wed, Jul 16, 2008 at 8:00 PM, Jelena Mirkovic <mirkovic at isi.edu> wrote:

> Well, Script element is not quite what I want. I want to read a set of
> IPs and delays like this:
>        1.1.1.1 200
>        2.2.2.2 300
> then remember them in the kernel module. When a packet comes from
> 1.1.1.1 I want to impose 200 ms delay, and for 2.2.2.2 source 300 ms
> delay. So I'm afraid some file reading is necessary and I cannot use
> variables from Script.  Or am I missing some other Script
> functionality that may be useful?
>
> Thanks
> -------------------------------------
> Jelena Mirkovic
> Computer Scientist
> USC Information Sciences Institute
> 4676 Admiralty Way, Suite 1001
> Marina del Rey, CA 90292
> 310-448-9170
>
>
> On Jul 16, 2008, at 7:03 PM, Roman Chertov wrote:
>
> > Jelena Mirkovic wrote:
> >> I've been trying to write a kernel module in Click that reads
> >> address  info from a file, then manipulates (drops or forwards)
> >> packets for  the specified addresses. I've had problems with using
> >> fopen -  basically click-install informs me that fopen is unknown
> >> symbol even  though I've included stdio.h in my file. I seem to
> >> remember Linux  kernel has a problem manipulating files. Is there
> >> an easy way to open
> >
> > It is disallowed to use system calls inside the kernel.  It is
> > possible to still use them with some trickery but is best not to do
> > so.
> >
> > Take a look at the Script element; it might be what you are looking
> > for.
> >
> > Roman
> >
> >> and read a file from a Click kernel module?
> >> Thanks
> >> -------------------------------------
> >> Jelena Mirkovic
> >> Computer Scientist
> >> USC Information Sciences Institute
> >> 4676 Admiralty Way, Suite 1001
> >> Marina del Rey, CA 90292
> >> 310-448-9170
> >> _______________________________________________
> >> click mailing list
> >> click at amsterdam.lcs.mit.edu
> >> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list