Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Controlling ports and connections from perl

by setantae (Scribe)
on Jan 15, 2001 at 16:21 UTC ( [id://51908]=note: print w/replies, xml ) Need Help??


in reply to Contolling ports and connections from perl

Regarding this bit :
``Anyone know of a way to stop a connection if you didn't start it?'',
you may want to look at the source for IP Filter, specifically the keepstate option.

setantae@eidosnet.co.uk|setantae|www.setantae.uklinux.net

  • Comment on Re: Controlling ports and connections from perl

Replies are listed 'Best First'.
Re: Re: Contolling ports and connections from perl
by jepri (Parson) on Jan 15, 2001 at 16:29 UTC
    That is indeed what I would like, but is rather restricted in the number of platforms that it will run on. I didn't make it clear above, but my program runs fine on both MSwindows and Linux, and I'm hoping for a Mac OS X port later in the year. Using something restricted to BSD-style kernels would be a step backwards for me.

    Thx anyway :)

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

      If you want multiplatform process management then the answer to your questions is likely "no".

      The stark fact of the matter is that one of the core differences between platforms is how they manage, control and apply permissions to running processes. Network stacks are even more flaky since a number of platforms have multiple, different IP/network systems that can be installed.

      If you want the fine-grained control you are looking for you will have to get into platform specific code. Consider writing what you are doing as a Module that internally figures out what platform you are running on and calls the proper sub-module that overrides certain methods with platform specific ones. That way you get a single interface around separate platforms.

      --
      $you = new YOU;
      honk() if $you->love(perl)

        Yes, I suspected that was the only real way to do it. I just don't do C though, so it's a quite involved for me to learn. Then there would be the requirement for the user to patch the kernel(!) before using my program... not the best idea for a simple-to-use program.

        Besides, I don't do C so the learning curve would be way to steep.

        But thanks for putting me on the right track, I'll now start looking into setting up a proxy and hijacking the DNS.

        ____________________
        Jeremy
        I didn't believe in evil until I dated it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://51908]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-19 14:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found