[Xorp-hackers] Where is IP address on vif set?
土井 博生
doi at criepi.denken.or.jp
Mon Nov 21 22:05:56 PST 2011
Dear all
I analysis ( or read ) the user configure reading part in XORP source code.
But I have a problem, so I need your help.
I added the debug_msg in fea/ifconfig.cc 184L and 218L to confirm the contents of user_config.
(Please refer the following)
The user_config has no IP address at the 184L (IfConfig::add_interface).
But at the 218L (IfConfig::commit_transaction), user_config has an IP address on vif.
I think the IP address is set between IfConfig::add_interface and IfConfig::commit_transaction.
Although I read the source code carefully, I cannot find the IP address setting part.
So, please tell me where IP address on vif in user_config is set.
Also, I would like to know your programing tool or debugger.
( I tried Eclipse with scons plug-in, but eclipse with scons cannot work property, because of '--verbosity flag error' )
Your suggestion is helpful for me.
Thank you for your kindness.
With best regrads,
Hiroki Doi
I use xorp 1.8.3.
fea/ifconfig.cc 184L
if (!_original_config.find_interface(ifname)) {
IfTreeInterface* ifp = _system_config.find_interface(ifname);
if (ifp) {
_original_config.update_interface(*ifp);
}
}
+ debug_msg("%s\n", user_config().str().c_str());
fea/ifconfig.cc 219L
if (_itm->commit(tid) != true) {
error_msg += c_format("Expired or invalid transaction ID presented\n");
return (XORP_ERROR);
}
+ debug_msg("%s\n", user_config().str().c_str());
RESULT: /var/log/xorp
[ 25027 1321515896411949 +186 fea/ifconfig.cc ] user-config
Interface eth1 { pif_index = 3 } { enabled := true } { discard := false } { unreachable := false } { management = false } { default_system_config = fa
lse }{ mtu := 1500 } { mac := 48:5b:39:82:e8:d } { no_carrier = false } { baudrate := 1000000000 } { flags := 69699 }{ parent-ifname = } { iface-type
= } { vid = } CREATED
VIF eth1 { pif_index = 3 } { enabled := true } { broadcast := true } { loopback := false } { point_to_point := false } { multicast := true } { flags
:= 69699 } CREATED
[ 25027 1321515896412014 +219 fea/ifconfig.cc ] user-config
Interface eth1 { pif_index = 3 } { enabled := true } { discard := false } { unreachable := false } { management = false } { default_system_config = fa
lse }{ mtu := 1500 } { mac := 48:5b:39:82:e8:d } { no_carrier = false } { baudrate := 1000000000 } { flags := 69699 }{ parent-ifname = } { iface-type
= } { vid = } CREATED
VIF eth1 { pif_index = 3 } { enabled := true } { broadcast := true } { loopback := false } { point_to_point := false } { multicast := true } { flags
:= 69699 } CREATED
IPv4Addr 192.168.0.3 { enabled := true } { broadcast := false } { loopback := false } { point_to_point := false } { multicast := false } { prefix_
len := 24 } CREATED
More information about the Xorp-hackers
mailing list