Quote:
(1) I understand that I can modify the OS to get the needed results.
(2) But I dont know where to start from. I have to work on RH linux.
(3) How are the protocols imlemented in RH linux?
(4) Is the source included in the OS? which are the files to start from?
(5) If I modify them, does it mean that I have to reinstall the kernel or can i just recompile and 'install the protocols ' (whatever that means) ?
(6) Or should I do raw socket programming instead? Which is a better idea?
|
1 : I don't know how much of your results you can get out of it - I thought that some of the ethernet stuff was handed by the network card onboard, rather than the OS on top (I don't have any information to prove or disprove that, it's just a guess), but if I am wrong about that, then yes you can get all the information out. Yes, you can modify the source.
2 : Well, the only part of the OS that will help with that is the kernel - you should look at the tcp/ip part of the kernel, as well as perhaps the driver for your network card. (might be able to get the ethernet stuff out of there)
3 : They are implimented in the net section of the kernel (At least TCP/IP is, I don't know about ethernet) - perhaps you should find a book / guide to kernel hacking to help you with this.
4 : Yes the source should be included. Try the cd it came with. I don't have a lot of experiance with redhat, but it should be in there. It might be a source rpm - .src.rpm
5 : Unless tcp/ip is built as a module (which seems unlikely) then you will need to either
1) Make all the changes, re-compile and re-install the whole kernel
The only problem with this is that you have to re-compile the whole kernel every time you want to change your code.
2) Make all the changes, re-compile as a module, install the kernel,
and when you need to change your code, re-compile your module and use rmmod & insmod to insert the new module
Of course, that makes the assumption that you can compile tcp/ip as a module, which I am not sure you can do. (some things you can, others you can't)
6 : raw socket programming would work except for ethernet. I am pretty sure that the ethernet stuff is taken care of by the time it gets to the application, so that won't help for the ethernet part.
The other thing you may look at is tcpdump - that should allow you to see what is going on, at least at the tcp/ip side of things.