From: Jamie C. <jca...@we...> - 2002-09-11 01:28:52
|
jam...@te... wrote: > Hi Jamie, > > I need to be able to limit who can turn on and off ip forwarding (Act as > router? question in > the routing and gateways sub module of the net module) while still allowing > them to > add static routes. I thought it would be a trivial change but then I found > that the manual > polymorphism of your net-lib.pl library (-; > > It looks like the routing_input() function is what is responsible for > painting the screen with > the form that: > > - shows all static routes. > - allows the selection of "Act as router?"/ip_forwarding. > > The problem is that this funciton lives in what looks like 14 different > libraries each representing > the way to do things on one specific platform. So if I fix it in the > library redhat-linux-lib.pl, the fix still > needs to be propagated to 13 other platforms, most of which I cannot test. > That being said, > what I need to control really should operate from a forms perspective > exactly the same no > matter what platform I am on. What it really looks like needs to be done > is to architect things > just a little different so that you have a seperate output routine that is > common to all platforms, and then > have each platform have instead a function that gathers the information > into a "standard" hash, and > pass that back to the format routine....sigh. > > This appears to be the right thing to do, but runs the risk of even more > problems at first, and would > call for even better testing on the other platforms. What do you think > Jamie. I am willing to reconstruct > it as mentioned above, but is this a desirable thing for you and do you > have the systems and or > time to test it? I could just make it work the way I want under redhat > linux but it seems to be a desirable > feature for others? What seems amicable to you? Yeah, due to the different way each operating system and version of linux stores routing information and the different details that are stored, there are currently 12 different versions of that function! Some like turbo-linux-lib.pl, msc-linux-lib.pl, mandrake-linux-lib.pl and cobalt-linux-lib.pl are exactly the same as redhat-linux-lib.pl (they are really just symlinks on my development system). Because of the different options each OS offers, the user interface cannot be the same on all of them .. which would make the abstraction that you suggested tough. I know, because I tried it before :( The DNS form on the other hand does do that kind of abstraction, because every OS has basically the same options .. - Jamie |