[quagga-dev 3579] Re: How to send ICMP packet from ripd? & How does ripd set default metric?

Paul Jakma paul at clubi.ie
Wed Aug 10 17:51:59 BST 2005


Hi,

On Tue, 9 Aug 2005, huanjun liu wrote:

> Hi.

> I am trying to send ICMP packets from rip daemon to grab round trip 
> time to peers. My problem is that, I am able to create 
> "socket(AF_INET, SOCK_RAW, 1)" in rip_main.c but fail to put it in 
> ripd.c.

Why are you trying to do this in ripd? It doesn't seem sensible ;).

> The "rip_send_packet()" in ripd.c uses "socket(AF_INET, SOCK_DGRAM, 
> 0)". Does it imply that I can't generate ICMP traffic from ripd.c ?

Not from that socket, it's for IP datagrammes. You need (i think) a 
raw, IPPROTO_ICMP socket.

> And another question is that how ripd sets default metric 1 to 
> directly connected networks. I read rip_init() but counld go 
> further. How does it link to other subroutines?

It calls setup stuff mostly. The main fun occurs in 
rip_main.c::main():

 	vty_read_config (config_file, config_default);

That will execute any commands, like the command to activate RIP on 
an interface, which would setup timers, IO threads, etc.. which are 
then run from lib/thread.c as required.

regards,
-- 
Paul Jakma	paul at clubi.ie	paul at jakma.org	Key ID: 64A2FF6A
Fortune:
"Is it really you, Fuzz, or is it Memorex, or is it radiation sickness?"
-- Sonic Disruptors comics



More information about the Quagga-dev mailing list