I think that your suggestion for having the classes and methods named the same as the XML is a good one, Mario .. I also think that as long as we do this previous to version 1.0 we won't upset too many people .. at 1.0 and above people will expect a level of stability in the API that will exclude major changes like renaming methods and attributes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Mario, we can divide this task up .. you don't have to do it all by yourself :). If you have a moment, divide the list of classes into two and post them here ... and we can both do half ..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sounds good. I am actually going to work on the bug you reported first, so I will post again when I have finished that and you can then let me know what, if anything is left over .. cool? Not trying to take work/fun from you :).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Make sure the files all will compile and then go ahead and check them in :) .. go ahead and change as many of the other classes as you like .. I am still at my 'day' job so I haven't had a chance to do any of them yet .. man are you fast! Nice!
Once all the classes are changed we can regression test .. best to do that by adding tests to the t/ directory unless they require root permissions to run .. if a scan requires root to test it, then better to generate an XML file for it, check that in, and write a test that scans using the scan_from_file() method .. does that make sense?
That way we can test the XML parsing and event handling and each user will be able to run the tests as well without being root (especially since the CPAN testers test the install as a non-root user).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, in this case those two would be the same ... -n 1 means 'execute one arg at a time' ... so in this case the differences are just preference .. I am now used to xargs as for any case other than "-n 1" xargs will usually execute faster than "find -exec" as xarg doesn't exec a new process for each line it is passed.
I usually use fgrep if i am doing fixed string searches as that is faster on some OSes than grep .. namely Solaris :P .. on Linux I think performance will be about the same.
I am in the east cost of the US .. you are in Western Europe, right? It is 8 PM here so it is very late anywhere in Europe .. haha.
So you were able to do change all the modules? Nice job! If you didn't get them all, let me know which you didn't have time for.
Since you were able to do the changes so quickly, we can include all this in the official .7 release!
I will fix the os port bug by Sunday at the latest.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Bug fixed! Tested using examples/osguess.pl. Please try that script yourself when you have the chance .. I also added a Hostname class and a hostnames() member to Host to account for multiple hostnames along with a few other small bugs .. somehow I missed the <hostnames> element before.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think that your suggestion for having the classes and methods named the same as the XML is a good one, Mario .. I also think that as long as we do this previous to version 1.0 we won't upset too many people .. at 1.0 and above people will expect a level of stability in the API that will exclude major changes like renaming methods and attributes.
Ok, I will look into it.
I think this will make things easier for new users.
Mario, we can divide this task up .. you don't have to do it all by yourself :). If you have a moment, divide the list of classes into two and post them here ... and we can both do half ..
Fine :)
I don't think there are many methods to be relabeled, but we have to look through all the files..
I just checked on Service.pm, there is nothing to be done.
I could work on OS* while you look through the other files?
Sounds good. I am actually going to work on the bug you reported first, so I will post again when I have finished that and you can then let me know what, if anything is left over .. cool? Not trying to take work/fun from you :).
Oh, there is plenty of work to be done...
And to be honest, i don't want to fix the bug...
I finished looking over OS/*
So how do we handle cvs.. just checkin, or first do some testing :) ?
Make sure the files all will compile and then go ahead and check them in :) .. go ahead and change as many of the other classes as you like .. I am still at my 'day' job so I haven't had a chance to do any of them yet .. man are you fast! Nice!
Once all the classes are changed we can regression test .. best to do that by adding tests to the t/ directory unless they require root permissions to run .. if a scan requires root to test it, then better to generate an XML file for it, check that in, and write a test that scans using the scan_from_file() method .. does that make sense?
That way we can test the XML parsing and event handling and each user will be able to run the tests as well without being root (especially since the CPAN testers test the install as a non-root user).
This is a little one liner you can use to test all the files for compilation (in case you didn't have one already)
find lib -name \*.pm | xargs -n 1 perl -wc
Hu, time difference.. I should sleep by now...
I only had to change a few lines :)
Nice one liner!
I never understood xargs, i know it is simple, but i never got past xargs < file
I would have done something like:
find lib -name "*pm" -exec perl -wc {} \; 2>&1 |grep -v OK
Actually, in this case those two would be the same ... -n 1 means 'execute one arg at a time' ... so in this case the differences are just preference .. I am now used to xargs as for any case other than "-n 1" xargs will usually execute faster than "find -exec" as xarg doesn't exec a new process for each line it is passed.
I usually use fgrep if i am doing fixed string searches as that is faster on some OSes than grep .. namely Solaris :P .. on Linux I think performance will be about the same.
I am in the east cost of the US .. you are in Western Europe, right? It is 8 PM here so it is very late anywhere in Europe .. haha.
So you were able to do change all the modules? Nice job! If you didn't get them all, let me know which you didn't have time for.
Since you were able to do the changes so quickly, we can include all this in the official .7 release!
I will fix the os port bug by Sunday at the latest.
Hehe, it is 2:20 here...
I just changed the OS modules.
If you fix the bug, i can do the other modules tomorrow.
It is not much work.
That is late :).
Sounds good. Thanks, Mario! Post when you have completed the changes and I will then do an update and fix that one.
Bug fixed! Tested using examples/osguess.pl. Please try that script yourself when you have the chance .. I also added a Hostname class and a hostnames() member to Host to account for multiple hostnames along with a few other small bugs .. somehow I missed the <hostnames> element before.
Great :)
I changed some names.
I tried to keep track of changes, so here is a list.
os/
port_id -> portid
last_boot -> lastboot
port_used -> portused
protocol -> proto
tcp_sequence
tcp_ts_sequence
ip_id_sequence
os.pm
os_guess -> os
os_classes -> osclasses
os_matches -> osmatches
*
number -> portid
address -> addr
type -> addrtype