From bms_fbsd at users.sourceforge.net Tue Sep 1 04:53:35 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Tue, 01 Sep 2009 11:53:35 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11527] trunk/xorp/pim/xrl_pim_node.cc Message-ID: Revision: 11527 http://xorp.svn.sourceforge.net/xorp/?rev=11527&view=rev Author: bms_fbsd Date: 2009-09-01 11:53:35 +0000 (Tue, 01 Sep 2009) Log Message: ----------- In PIM's XRL target handler for incoming MLD6IGMP RPC calls, log the VIF name for add/delete membership operations. Submitted by: Ben Greear (with fixups) Modified Paths: -------------- trunk/xorp/pim/xrl_pim_node.cc Modified: trunk/xorp/pim/xrl_pim_node.cc =================================================================== --- trunk/xorp/pim/xrl_pim_node.cc 2009-08-31 13:21:20 UTC (rev 11526) +++ trunk/xorp/pim/xrl_pim_node.cc 2009-09-01 11:53:35 UTC (rev 11527) @@ -3567,7 +3567,7 @@ XrlPimNode::mld6igmp_client_0_1_add_membership4( // Input values, const string& , // xrl_sender_name, - const string& , // vif_name, + const string& vif_name, const uint32_t& vif_index, const IPv4& source, const IPv4& group) @@ -3585,8 +3585,12 @@ if (PimNode::add_membership(vif_index, IPvX(source), IPvX(group)) != XORP_OK) { - error_msg = c_format("Failed to add membership for (%s, %s)", - cstring(source), cstring(group)); + error_msg = c_format("Failed to add membership for (%s, %s)" + "on vif %s: %s", + cstring(source), + cstring(group), + vif_name.c_str(), + error_msg.c_str()); return XrlCmdError::COMMAND_FAILED(error_msg); } @@ -3597,7 +3601,7 @@ XrlPimNode::mld6igmp_client_0_1_add_membership6( // Input values, const string& , // xrl_sender_name, - const string& , // vif_name, + const string& vif_name, const uint32_t& vif_index, const IPv6& source, const IPv6& group) @@ -3615,8 +3619,12 @@ if (PimNode::add_membership(vif_index, IPvX(source), IPvX(group)) != XORP_OK) { - error_msg = c_format("Failed to add membership for (%s, %s)", - cstring(source), cstring(group)); + error_msg = c_format("Failed to add membership for (%s, %s)" + "on vif %s: %s", + cstring(source), + cstring(group), + vif_name.c_str(), + error_msg.c_str()); return XrlCmdError::COMMAND_FAILED(error_msg); } @@ -3627,7 +3635,7 @@ XrlPimNode::mld6igmp_client_0_1_delete_membership4( // Input values, const string& , // xrl_sender_name, - const string& , // vif_name, + const string& vif_name, const uint32_t& vif_index, const IPv4& source, const IPv4& group) @@ -3645,8 +3653,12 @@ if (PimNode::delete_membership(vif_index, IPvX(source), IPvX(group)) != XORP_OK) { - error_msg = c_format("Failed to delete membership for (%s, %s)", - cstring(source), cstring(group)); + error_msg = c_format("Failed to delete membership for (%s, %s)" + "on vif %s: %s", + cstring(source), + cstring(group), + vif_name.c_str(), + error_msg.c_str()); return XrlCmdError::COMMAND_FAILED(error_msg); } @@ -3658,7 +3670,7 @@ XrlPimNode::mld6igmp_client_0_1_delete_membership6( // Input values, const string& , // xrl_sender_name, - const string& , // vif_name, + const string& vif_name, const uint32_t& vif_index, const IPv6& source, const IPv6& group) @@ -3676,8 +3688,12 @@ if (PimNode::delete_membership(vif_index, IPvX(source), IPvX(group)) != XORP_OK) { - error_msg = c_format("Failed to delete membership for (%s, %s)", - cstring(source), cstring(group)); + error_msg = c_format("Failed to delete membership for (%s, %s)" + "on vif %s: %s", + cstring(source), + cstring(group), + vif_name.c_str(), + error_msg.c_str()); return XrlCmdError::COMMAND_FAILED(error_msg); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Tue Sep 1 05:05:04 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Tue, 01 Sep 2009 12:05:04 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11528] trunk/xorp/pim/pim_vif.cc Message-ID: Revision: 11528 http://xorp.svn.sourceforge.net/xorp/?rev=11528&view=rev Author: bms_fbsd Date: 2009-09-01 12:05:04 +0000 (Tue, 01 Sep 2009) Log Message: ----------- In PimVif::pim_send(), add debug_msg() for the case where an illegal message type is being sent on the register vif, and for the case where a send is being attempted when the interface is marked down or pending down. Submitted by: Ben Greear (with fixups) Modified Paths: -------------- trunk/xorp/pim/pim_vif.cc Modified: trunk/xorp/pim/pim_vif.cc =================================================================== --- trunk/xorp/pim/pim_vif.cc 2009-09-01 11:53:35 UTC (rev 11527) +++ trunk/xorp/pim/pim_vif.cc 2009-09-01 12:05:04 UTC (rev 11528) @@ -577,8 +577,10 @@ int ttl = MINTTL; bool ip_internet_control = true; // XXX: might be overwritten below - if (! (is_up() || is_pending_down())) + if (! (is_up() || is_pending_down())) { + debug_msg("Vif %s is currently down\n", name().c_str()); return (XORP_ERROR); + } // // Some of the messages should never be send via the PIM Register vif @@ -591,6 +593,8 @@ case PIM_ASSERT: case PIM_GRAFT: case PIM_GRAFT_ACK: + debug_msg("Invalid message type %d on register vif\n", + message_type); return (XORP_ERROR); // Those messages are not allowed case PIM_REGISTER: case PIM_REGISTER_STOP: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Tue Sep 1 05:55:38 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Tue, 01 Sep 2009 12:55:38 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11529] trunk/xorp Message-ID: Revision: 11529 http://xorp.svn.sourceforge.net/xorp/?rev=11529&view=rev Author: bms_fbsd Date: 2009-09-01 12:55:38 +0000 (Tue, 01 Sep 2009) Log Message: ----------- When reconfiguring bootstrap router zones in XORP's PIM implementation, calling stop() followed by start() will blow away the Elected-BSR state if the XORP router is the elected BSR for a given multicast zone. Add an explicit apply_bsr_changes method to PIM's XRL RPC interface, but do not instruct the Router Manager to use it yet, as this change still requires more rigorous testing in the field. Users are encouraged to test this change by uncommenting the %update change in PIM's template file which will be committed in a forthcoming revision. Submitted by: Samuel Lucas Vaz de Mello, Pavlin Radoslavov (with fixups) Modified Paths: -------------- trunk/xorp/pim/pim_bsr.cc trunk/xorp/pim/pim_bsr.hh trunk/xorp/pim/pim_node.hh trunk/xorp/pim/xrl_pim_node.cc trunk/xorp/pim/xrl_pim_node.hh trunk/xorp/xrl/interfaces/pim.xif Modified: trunk/xorp/pim/pim_bsr.cc =================================================================== --- trunk/xorp/pim/pim_bsr.cc 2009-09-01 12:05:04 UTC (rev 11528) +++ trunk/xorp/pim/pim_bsr.cc 2009-09-01 12:55:38 UTC (rev 11529) @@ -316,6 +316,121 @@ XLOG_INFO("Bootstrap mechanism disabled"); } +int +PimBsr::apply_bsr_changes(string& error_msg) +{ + list::iterator iter; + list del_list; + + if (! is_enabled()) + return (XORP_OK); + + // + // Preserve any elected BSR zones + // + for (iter = _active_bsr_zone_list.begin(); + iter != _active_bsr_zone_list.end(); iter++) { + BsrZone* tmp_zone = *iter; + // If the BSR zone is not elected BSR, just remove it + if (tmp_zone->bsr_zone_state() != BsrZone::STATE_ELECTED_BSR) { + del_list.push_back(tmp_zone); + } else { + // + // It is an Elected BSR. We will keep the BSR zone in the list + // but remove all Cand RPs. Some of them may have been deleted. + // The Cand RPs that were not deleted will be added again below. + // + delete_pointers_list(tmp_zone->bsr_group_prefix_list()); + } + } + + for (iter = del_list.begin(); iter != del_list.end(); ++iter) { + _active_bsr_zone_list.remove(*iter); + } + delete_pointers_list(del_list); + + // + // Clean up any deleted zone + // + for (iter = _active_bsr_zone_list.begin(); + iter != _active_bsr_zone_list.end(); ++iter) { + BsrZone *active_bsr_zone = *iter; + if (active_bsr_zone->bsr_zone_state() == BsrZone::STATE_ELECTED_BSR) { + BsrZone *config_bsr_zone; + config_bsr_zone = find_config_bsr_zone(active_bsr_zone->zone_id()); + if (config_bsr_zone == NULL) { + // Zone removed from config + del_list.push_back(active_bsr_zone); + continue; + } + + // + // Zone is no longer BSR candidate (i.e., removed from Cand-BSR but + // still has some Cand-RP state). + // + // Remove it too, as the Cand-RP state is re-added below + if (! config_bsr_zone->i_am_candidate_bsr()) { + del_list.push_back(active_bsr_zone); + continue; + } + } + } + + // + // Delete the vanished items + // + for (iter = del_list.begin(); iter != del_list.end(); ++iter) { + BsrZone *active_bsr_zone = *iter; + _active_bsr_zone_list.remove(active_bsr_zone); + } + delete_pointers_list(del_list); + + // + // Activate all configured BSR zones + // + for (iter = _config_bsr_zone_list.begin(); + iter != _config_bsr_zone_list.end(); + ++iter) { + BsrZone *config_bsr_zone = *iter; + + if (config_bsr_zone->i_am_candidate_bsr()) { + if (add_active_bsr_zone(*config_bsr_zone, error_msg) == NULL) { + XLOG_ERROR("Cannot add configured Bootstrap zone %s: %s", + cstring(config_bsr_zone->zone_id()), + error_msg.c_str()); + stop(); + return (XORP_ERROR); + } + } + config_bsr_zone->start_candidate_rp_advertise_timer(); + } + + // + // When restarting we want to keep any previously enabled BSR. + // Set it to PENDING and expire the bsr_timer immediately. + // As soon as the timer runs, it puts the zone back in the ELECTED + // state and run the needed actions (calculate RP-Set and send a + // BSR Message with the new RP-Set). + // + for (iter = _active_bsr_zone_list.begin(); + iter != _active_bsr_zone_list.end(); + ++iter) { + BsrZone *active_bsr_zone = *iter; + if (active_bsr_zone->bsr_zone_state() == BsrZone::STATE_ELECTED_BSR) { + if (active_bsr_zone->i_am_candidate_bsr()) { + // zone was not changed + active_bsr_zone->set_bsr_zone_state(BsrZone::STATE_PENDING_BSR); + } else { + // zone is no longer Cand-BSR, but contains Cand-RPs + active_bsr_zone->set_bsr_zone_state(BsrZone::STATE_ACCEPT_ANY); + } + active_bsr_zone->expire_bsr_timer(); + } + } + + return (XORP_OK); +} + // Unicast the Bootstrap message(s) to a (new) neighbor int PimBsr::unicast_pim_bootstrap(PimVif *pim_vif, const IPvX& nbr_addr) const Modified: trunk/xorp/pim/pim_bsr.hh =================================================================== --- trunk/xorp/pim/pim_bsr.hh 2009-09-01 12:05:04 UTC (rev 11528) +++ trunk/xorp/pim/pim_bsr.hh 2009-09-01 12:55:38 UTC (rev 11529) @@ -93,6 +93,14 @@ */ void disable(); + /** + * Apply BSR configuration changes. + * + * @param error_msg the error message (if error). + * @return XORP_OK on success, otherwise XORP_ERROR. + */ + int apply_bsr_changes(string& error_msg); + PimNode& pim_node() const { return (_pim_node); } int unicast_pim_bootstrap(PimVif *pim_vif, Modified: trunk/xorp/pim/pim_node.hh =================================================================== --- trunk/xorp/pim/pim_node.hh 2009-09-01 12:05:04 UTC (rev 11528) +++ trunk/xorp/pim/pim_node.hh 2009-09-01 12:55:38 UTC (rev 11529) @@ -872,7 +872,17 @@ * @return XORP_OK on success, otherwise XORP_ERROR. */ int stop_bsr() { return (pim_bsr().stop()); } - + + /** + * Apply BSR configuration changes. + * + * @param error_msg the error message (if error). + * @return XORP_OK on success, otherwise XORP_ERROR. + */ + int apply_bsr_changes(string& error_msg) { + return (pim_bsr().apply_bsr_changes(error_msg)); + } + // // Configuration methods // Modified: trunk/xorp/pim/xrl_pim_node.cc =================================================================== --- trunk/xorp/pim/xrl_pim_node.cc 2009-09-01 12:05:04 UTC (rev 11528) +++ trunk/xorp/pim/xrl_pim_node.cc 2009-09-01 12:55:38 UTC (rev 11529) @@ -3946,6 +3946,17 @@ return XrlCmdError::OKAY(); } +XrlCmdError +XrlPimNode::pim_0_1_apply_bsr_changes() +{ + string error_msg; + + if (PimNode::apply_bsr_changes(error_msg) != XORP_OK) + return XrlCmdError::COMMAND_FAILED(error_msg); + + return XrlCmdError::OKAY(); +} + // // PIM configuration // Modified: trunk/xorp/pim/xrl_pim_node.hh =================================================================== --- trunk/xorp/pim/xrl_pim_node.hh 2009-09-01 12:05:04 UTC (rev 11528) +++ trunk/xorp/pim/xrl_pim_node.hh 2009-09-01 12:55:38 UTC (rev 11529) @@ -709,6 +709,11 @@ XrlCmdError pim_0_1_stop_bsr(); /** + * Apply BSR configuration changes. + */ + XrlCmdError pim_0_1_apply_bsr_changes(); + + /** * Add/delete scope zone. * * @param scope_zone_id the ID of the configured zone. Modified: trunk/xorp/xrl/interfaces/pim.xif =================================================================== --- trunk/xorp/xrl/interfaces/pim.xif 2009-09-01 12:05:04 UTC (rev 11528) +++ trunk/xorp/xrl/interfaces/pim.xif 2009-09-01 12:55:38 UTC (rev 11529) @@ -59,6 +59,11 @@ stop_bsr /** + * Apply BSR configuration changes. + */ + apply_bsr_changes + + /** * Add/delete scope zone. * * @param scope_zone_id the ID of the configured zone. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Tue Sep 1 06:00:50 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Tue, 01 Sep 2009 13:00:50 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11530] trunk/xorp/etc/templates Message-ID: Revision: 11530 http://xorp.svn.sourceforge.net/xorp/?rev=11530&view=rev Author: bms_fbsd Date: 2009-09-01 13:00:50 +0000 (Tue, 01 Sep 2009) Log Message: ----------- Add commented-out reference to the new PIM apply_bsr_changes RPC method, to the template files for PIM-SM. Users are encouraged to test this change by commenting out the %update template commands which just bounce the PIM-SM BSR state, and uncommenting the apply_bsr_changes %update command. Submitted by: Samuel Lucas Vaz de Mello, Pavlin Radoslavov (with fixups) Modified Paths: -------------- trunk/xorp/etc/templates/pimsm4.tp trunk/xorp/etc/templates/pimsm6.tp Modified: trunk/xorp/etc/templates/pimsm4.tp =================================================================== --- trunk/xorp/etc/templates/pimsm4.tp 2009-09-01 12:55:38 UTC (rev 11529) +++ trunk/xorp/etc/templates/pimsm4.tp 2009-09-01 13:00:50 UTC (rev 11530) @@ -209,8 +209,15 @@ %help: short "Configure the IPv4 Bootstrap mechanism"; %activate: xrl "$(pimsm4.targetname)/pim/0.1/stop_bsr"; %activate: xrl "$(pimsm4.targetname)/pim/0.1/start_bsr"; + /* + * To test runtime BSR reconfiguration, comment out the two + * lines below, and uncomment the apply_bsr_changes line. + */ %update: xrl "$(pimsm4.targetname)/pim/0.1/stop_bsr"; %update: xrl "$(pimsm4.targetname)/pim/0.1/start_bsr"; + /* + %update: xrl "$(pimsm4.targetname)/pim/0.1/apply_bsr_changes"; + */ %delete: xrl "$(pimsm4.targetname)/pim/0.1/stop_bsr"; disable { Modified: trunk/xorp/etc/templates/pimsm6.tp =================================================================== --- trunk/xorp/etc/templates/pimsm6.tp 2009-09-01 12:55:38 UTC (rev 11529) +++ trunk/xorp/etc/templates/pimsm6.tp 2009-09-01 13:00:50 UTC (rev 11530) @@ -209,8 +209,15 @@ %help: short "Configure the IPv6 Bootstrap mechanism"; %activate: xrl "$(pimsm6.targetname)/pim/0.1/stop_bsr"; %activate: xrl "$(pimsm6.targetname)/pim/0.1/start_bsr"; + /* + * To test runtime BSR reconfiguration, comment out the two + * lines below, and uncomment the apply_bsr_changes line. + */ %update: xrl "$(pimsm6.targetname)/pim/0.1/stop_bsr"; %update: xrl "$(pimsm6.targetname)/pim/0.1/start_bsr"; + /* + %update: xrl "$(pimsm6.targetname)/pim/0.1/apply_bsr_changes"; + */ %delete: xrl "$(pimsm6.targetname)/pim/0.1/stop_bsr"; disable { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From greearb at candelatech.com Tue Sep 1 10:57:41 2009 From: greearb at candelatech.com (Ben Greear) Date: Tue, 01 Sep 2009 10:57:41 -0700 Subject: [Xorp-cvs] SF.net SVN: xorp:[11530] trunk/xorp/etc/templates In-Reply-To: References: Message-ID: <4A9D6095.3080209@candelatech.com> bms_fbsd at users.sourceforge.net wrote: > Revision: 11530 > http://xorp.svn.sourceforge.net/xorp/?rev=11530&view=rev > Author: bms_fbsd > Date: 2009-09-01 13:00:50 +0000 (Tue, 01 Sep 2009) > > Log Message: > ----------- > Add commented-out reference to the new PIM apply_bsr_changes RPC method, > to the template files for PIM-SM. > > Users are encouraged to test this change by commenting out the %update > template commands which just bounce the PIM-SM BSR state, and uncommenting > the apply_bsr_changes %update command. > > Submitted by: Samuel Lucas Vaz de Mello, Pavlin Radoslavov (with fixups) > If you want other users to test this, then just add it full-on into the code and do your best to encourage people to use it. Otherwise, I think you'll have virtually zero coverage of out-side testing. Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From bms_fbsd at users.sourceforge.net Wed Sep 2 08:17:23 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Wed, 02 Sep 2009 15:17:23 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11531] trunk/xorp/bgp/tools Message-ID: Revision: 11531 http://xorp.svn.sourceforge.net/xorp/?rev=11531&view=rev Author: bms_fbsd Date: 2009-09-02 15:17:22 +0000 (Wed, 02 Sep 2009) Log Message: ----------- Minor changes to wording of BGP status messages, when BGP is not running or no peerings configured. Bugzilla URL: http://bugzilla.xorp.net/show_bug.cgi?id=625 Submitted by: Justin Fletcher (with changes) Modified Paths: -------------- trunk/xorp/bgp/tools/print_peer.cc trunk/xorp/bgp/tools/print_routes.cc Modified: trunk/xorp/bgp/tools/print_peer.cc =================================================================== --- trunk/xorp/bgp/tools/print_peer.cc 2009-09-01 13:00:50 UTC (rev 11530) +++ trunk/xorp/bgp/tools/print_peer.cc 2009-09-02 15:17:22 UTC (rev 11531) @@ -75,7 +75,7 @@ if (e != XrlError::OKAY()) { //fprintf(stderr, "Failed to get peer list start\n"); if (_prev_no_bgp == false) - printf("\n\nNo BGP Exists\n"); + printf("\n\nBGP is not running or may not be configured\n"); _prev_no_bgp = true; _done = true; return; @@ -83,7 +83,7 @@ _prev_no_bgp = false; if (*more == false) { if (_prev_no_peers == false) - printf("\n\nNo Peerings Exist\n"); + printf("\n\nNo BGP peers are configured\n"); _prev_no_peers = true; _done = true; return; Modified: trunk/xorp/bgp/tools/print_routes.cc =================================================================== --- trunk/xorp/bgp/tools/print_routes.cc 2009-09-01 13:00:50 UTC (rev 11530) +++ trunk/xorp/bgp/tools/print_routes.cc 2009-09-02 15:17:22 UTC (rev 11531) @@ -124,7 +124,7 @@ if (e != XrlError::OKAY()) { //fprintf(stderr, "Failed to get peer list start\n"); if (_prev_no_bgp == false) - printf("\n\nNo BGP Exists\n"); + printf("\n\nBGP is not running or may not be configured\n"); _prev_no_bgp = true; _done = true; return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Wed Sep 2 09:49:23 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Wed, 02 Sep 2009 16:49:23 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11532] trunk/xorp/rtrmgr/master_conf_tree.cc Message-ID: Revision: 11532 http://xorp.svn.sourceforge.net/xorp/?rev=11532&view=rev Author: bms_fbsd Date: 2009-09-02 16:49:23 +0000 (Wed, 02 Sep 2009) Log Message: ----------- Add useful metadata to the XORP configuration file header. Preserve backwards compatibility only for overwriting pre-1.7 config files. Bugzilla URL: http://bugzilla.xorp.net/show_bug.cgi?id=53 Submitted by: Kristian Larsson (with fixups) Modified Paths: -------------- trunk/xorp/rtrmgr/master_conf_tree.cc Modified: trunk/xorp/rtrmgr/master_conf_tree.cc =================================================================== --- trunk/xorp/rtrmgr/master_conf_tree.cc 2009-09-02 15:17:22 UTC (rev 11531) +++ trunk/xorp/rtrmgr/master_conf_tree.cc 2009-09-02 16:49:23 UTC (rev 11532) @@ -29,6 +29,9 @@ #ifdef HAVE_GRP_H #include #endif +#ifdef HAVE_PWD_H +#include +#endif #ifdef HAVE_SYS_STAT_H #include @@ -65,6 +68,9 @@ #endif +#define XORP_CONFIG_FORMAT_VERSION "1.1" +#define XORP_CONFIG_XORP_VERSION "1.7-WIP" + // // The strings that are used to add and delete a load or save file, to // access the content of the loaded file, etc. @@ -837,7 +843,10 @@ umask(orig_mask); return false; } - if (strncmp(line, "/*XORP", 6) != 0) { + // Check for pre-1.7 config file header first. + if ((strncmp(&line[0], "/*", 2) != 0) && + ((strncmp(&line[2], "XORP", 4) != 0) || + (strncmp(&line[2], " XORP", 5) != 0))) { error_msg = c_format("File %s exists, but it is not an " "existing XORP config file.\n", full_filename.c_str()); @@ -875,8 +884,43 @@ return false; } + // Prepare values for the file header +#ifdef HOST_OS_WINDOWS + string username("root"); +#else + struct passwd *pwent = getpwuid(user_id); + string username; + if (pwent == NULL) + username = c_format("UID:%u", XORP_UINT_CAST(user_id)); + else + username = pwent->pw_name; +#endif + + char hbuf[MAXHOSTNAMELEN]; + if (gethostname(hbuf, sizeof(hbuf)) < 0) { +#ifdef HOST_OS_WINDOWS + XLOG_FATAL("gethostname() failed: %d", WSAGetLastError()); +#else + XLOG_FATAL("gethostname() failed: %s", strerror(errno)); +#endif + } + hbuf[sizeof(hbuf) - 1] = '\0'; + // Write the file header - string header = "/*XORP Configuration File, v1.0*/\n"; + string header = "/* XORP configuration file"; + header += "\n *"; + header += "\n * Configuration format: "; + header += XORP_CONFIG_FORMAT_VERSION; + header += "\n * XORP version: "; + header += XORP_CONFIG_XORP_VERSION; + header += "\n * Date: "; + header += xlog_localtime2string(); + header += "\n * Host: "; + header += hbuf; + header += "\n * User: "; + header += username; + header += "\n */\n\n"; + size_t bytes; bytes = fwrite(header.c_str(), sizeof(char), header.size(), file); if (bytes < header.size()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Wed Sep 2 14:55:39 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Wed, 02 Sep 2009 21:55:39 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11533] trunk/xorp/libxorp/callback.cc Message-ID: Revision: 11533 http://xorp.svn.sourceforge.net/xorp/?rev=11533&view=rev Author: bms_fbsd Date: 2009-09-02 21:55:36 +0000 (Wed, 02 Sep 2009) Log Message: ----------- Update comments. Modified Paths: -------------- trunk/xorp/libxorp/callback.cc Modified: trunk/xorp/libxorp/callback.cc =================================================================== --- trunk/xorp/libxorp/callback.cc 2009-09-02 16:49:23 UTC (rev 11532) +++ trunk/xorp/libxorp/callback.cc 2009-09-02 21:55:36 UTC (rev 11533) @@ -25,8 +25,7 @@ #include "libxorp/xorp.h" /* - * This code is only compiled if DEBUG_CALLBACKS is defined in - * config.h via 'configure --enable-callback-debug'. All callback + * This code is only compiled if DEBUG_CALLBACKS is defined. All callback * debugging entails is watching that individual callbacks do not take * too long in their dispatch method. Since XORP is event and timer * driven taking anything more than a few seconds is potentially bad. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Wed Sep 2 15:24:46 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Wed, 02 Sep 2009 22:24:46 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11534] trunk/xorp/rib/rt_tab_log.cc Message-ID: Revision: 11534 http://xorp.svn.sourceforge.net/xorp/?rev=11534&view=rev Author: bms_fbsd Date: 2009-09-02 22:24:45 +0000 (Wed, 02 Sep 2009) Log Message: ----------- Allow DEBUG_LOGGING to be defined on the command line, when compiling this file. Modified Paths: -------------- trunk/xorp/rib/rt_tab_log.cc Modified: trunk/xorp/rib/rt_tab_log.cc =================================================================== --- trunk/xorp/rib/rt_tab_log.cc 2009-09-02 21:55:36 UTC (rev 11533) +++ trunk/xorp/rib/rt_tab_log.cc 2009-09-02 22:24:45 UTC (rev 11534) @@ -228,7 +228,10 @@ // ---------------------------------------------------------------------------- +#ifndef DEBUG_LOGGING #define DEBUG_LOGGING +#endif + #include "libxorp/debug.h" template This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Wed Sep 2 15:26:47 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Wed, 02 Sep 2009 22:26:47 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11535] trunk/xorp/SConstruct Message-ID: Revision: 11535 http://xorp.svn.sourceforge.net/xorp/?rev=11535&view=rev Author: bms_fbsd Date: 2009-09-02 22:26:47 +0000 (Wed, 02 Sep 2009) Log Message: ----------- Add support for new SCons build-time options: debug_fn, debug_cb, debug_msg, debug_stl. All of these default to off. debug_stl will allow C++ STL debugging for the GNU STL port to be enabled. Print installation prefix and other flags also while we're at it. Modified Paths: -------------- trunk/xorp/SConstruct Modified: trunk/xorp/SConstruct =================================================================== --- trunk/xorp/SConstruct 2009-09-02 22:24:45 UTC (rev 11534) +++ trunk/xorp/SConstruct 2009-09-02 22:26:47 UTC (rev 11535) @@ -56,7 +56,10 @@ vars.AddVariables( BoolVariable('shared', 'build with shared libraries', False), BoolVariable('strip', 'strip executables and libraries when installed', False), - + BoolVariable('debug_stl', 'Build with checked STL operations', False), + BoolVariable('debug_msg', 'Build with debug messages', False), + BoolVariable('debug_fn', 'Build with function names in debug_msg output', False), + BoolVariable('debug_cb', 'Build with callback debugging', False), ) build_arch = os.uname()[4].lower() @@ -76,12 +79,15 @@ sourcedir=Dir(".").abspath builddir=Dir(ARGUMENTS.get('builddir', '#obj/' + host_arch+'-'+host_os+'-'+rel)).abspath +prefix = ARGUMENTS.get('prefix', '/usr/local/xorp') + print 'Cross build: ', cross print 'Architecture: ', host_arch print 'Operating System: ', host_os print 'Release: ', rel print 'Source path: ', sourcedir print 'Build path: ', builddir +print 'Install path: ', prefix env = Environment( TOOLS = ['default', 'autotest', 'clntgen', 'tgtgen', @@ -107,6 +113,13 @@ env['SHAREDLIBS'] = "defined" print 'Shared libraries: ', env.has_key('SHAREDLIBS') +print 'Debug STL: ', env['debug_stl'] +# XXX Enabling debug messages for the whole tree may not be what you want, +# as it can lead to premature timeouts. +print 'Debug messages: ', env['debug_msg'] +print 'Debug function names: ', env['debug_fn'] +print 'Debug callbacks: ', env['debug_cb'] + env['CONFIGURELOG'] = str(builddir) + os.sep + 'config.log' env['CONFIGUREDIR'] = str(builddir) + os.sep + '.sconf_temp' @@ -161,7 +174,6 @@ # follow freebsd hier(5) unless we've got better suggestions- # what is equivalent ref for red hat / debian based systems? -prefix = ARGUMENTS.get('prefix', '/usr/local/xorp') env['prefix'] = prefix exec_prefix = ARGUMENTS.get('exec_prefix', '$prefix') env['exec_prefix'] = exec_prefix @@ -283,6 +295,38 @@ '-ftemplate-depth-25' ]) +# XXX For GNU STL only at this time. +if env['debug_stl']: + env.AppendUnique(CXXFLAGS = [ + '-D_GLIBCXX_DEBUG', + '-D_GLIBCXX_DEBUG_PEDANTIC', + ]) + +# XXX DEBUG_LOGGING_GLOBAL current a no-op. +if env['debug_msg']: + env.AppendUnique(CFLAGS = [ + '-DDEBUG_LOGGING', + ]) + env.AppendUnique(CXXFLAGS = [ + '-DDEBUG_LOGGING', + ]) + +if env['debug_fn']: + env.AppendUnique(CFLAGS = [ + '-DDEBUG_PRINT_FUNCTION_NAME', + ]) + env.AppendUnique(CXXFLAGS = [ + '-DDEBUG_PRINT_FUNCTION_NAME', + ]) + +if env['debug_cb']: + env.AppendUnique(CFLAGS = [ + '-DDEBUG_CALLBACKS', + ]) + env.AppendUnique(CXXFLAGS = [ + '-DDEBUG_CALLBACKS', + ]) + env.AppendUnique(RPATH = [ '$libdir', ]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Wed Sep 2 15:29:15 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Wed, 02 Sep 2009 22:29:15 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11536] trunk/xorp/SConstruct Message-ID: Revision: 11536 http://xorp.svn.sourceforge.net/xorp/?rev=11536&view=rev Author: bms_fbsd Date: 2009-09-02 22:29:14 +0000 (Wed, 02 Sep 2009) Log Message: ----------- Update comments. Modified Paths: -------------- trunk/xorp/SConstruct Modified: trunk/xorp/SConstruct =================================================================== --- trunk/xorp/SConstruct 2009-09-02 22:26:47 UTC (rev 11535) +++ trunk/xorp/SConstruct 2009-09-02 22:29:14 UTC (rev 11536) @@ -24,8 +24,6 @@ # TODO Add separate toolchain test for C99 varargs macros. # TODO Add separate toolchain test for GNU varargs macros. # TODO Fix default include/lib paths, pass in from environment. -# TODO Pass in DEBUG_CALLBACKS DEBUG_LOGGING_GLOBAL DEBUG_PRINT_FUNCTION_NAME -# from command line easily. # TODO Merge scons-unfamiliar syntactic sugar from YHC's sconsfiles. # TODO support non-gnu strip # TODO support static *and* shared library build in same tree/run This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Wed Sep 2 17:59:36 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Thu, 03 Sep 2009 00:59:36 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11537] trunk/xorp/libxorp/xlog.c Message-ID: Revision: 11537 http://xorp.svn.sourceforge.net/xorp/?rev=11537&view=rev Author: bms_fbsd Date: 2009-09-03 00:59:35 +0000 (Thu, 03 Sep 2009) Log Message: ----------- In callback handler for XLOG syslog output, pass facility to syslog(). To facilitate this, cast facility using C99 types (intptr_t) before adding the xlog callback. In callback, cast back using C99 integer types. Use a int8_t for the array index in xlog_parse_syslog_spec(), this should optimize to an index register on x86. Bugzilla URL: http://bugzilla.xorp.net/show_bug.cgi?id=1084 Reported by: Jose Calhariz Modified Paths: -------------- trunk/xorp/libxorp/xlog.c Modified: trunk/xorp/libxorp/xlog.c =================================================================== --- trunk/xorp/libxorp/xlog.c 2009-09-02 22:29:14 UTC (rev 11536) +++ trunk/xorp/libxorp/xlog.c 2009-09-03 00:59:35 UTC (rev 11537) @@ -1283,7 +1283,7 @@ #if defined(HAVE_SYSLOG_H) && defined(HAVE_SYSLOG) typedef struct _code { const char *c_name; - int c_val; + int32_t c_val; } SYSLOG_CODE; static SYSLOG_CODE prioritynames[] = { @@ -1319,7 +1319,7 @@ { NULL, -1, } }; -static int +static int32_t xlog_level_to_syslog_priority(xlog_level_t xloglevel) { @@ -1349,12 +1349,12 @@ static int xlog_syslog_output_func(void *obj, xlog_level_t level, const char *msg) { - int priority = xlog_level_to_syslog_priority(level); + int32_t facility = (intptr_t)obj; + int32_t priority = xlog_level_to_syslog_priority(level); - syslog(priority, "%s", msg); + syslog(facility|priority, "%s", msg); return (0); - UNUSED(obj); } /* @@ -1363,7 +1363,9 @@ static int xlog_parse_syslog_spec(const char *syslogspec, int *facility, int *priority) { - int i, retval, xfacility, xpriority; + int retval; + int8_t i; + int32_t xfacility, xpriority; char *facname, *priname, *tmpspec; SYSLOG_CODE* sc; @@ -1415,14 +1417,14 @@ int xlog_add_syslog_output(const char *syslogspec) { - int facility = -1; - int priority = -1; + int32_t facility = -1; + int32_t priority = -1; if (-1 == xlog_parse_syslog_spec(syslogspec, &facility, &priority)) return (-1); openlog("xorp", LOG_PID | LOG_NDELAY | LOG_CONS, facility); - xlog_add_output_func(xlog_syslog_output_func, NULL); + xlog_add_output_func(xlog_syslog_output_func, (void *)(intptr_t)facility); return (0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Wed Sep 2 18:03:16 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Thu, 03 Sep 2009 01:03:16 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11538] trunk/xorp/bgp/socket.cc Message-ID: Revision: 11538 http://xorp.svn.sourceforge.net/xorp/?rev=11538&view=rev Author: bms_fbsd Date: 2009-09-03 01:03:15 +0000 (Thu, 03 Sep 2009) Log Message: ----------- Comment out a paranoid assertion which existed to catch socket recycling problems with BGP under Windows. Reported by: Tafi Makamure Modified Paths: -------------- trunk/xorp/bgp/socket.cc Modified: trunk/xorp/bgp/socket.cc =================================================================== --- trunk/xorp/bgp/socket.cc 2009-09-03 00:59:35 UTC (rev 11537) +++ trunk/xorp/bgp/socket.cc 2009-09-03 01:03:15 UTC (rev 11538) @@ -197,7 +197,9 @@ get_remote_host()); // Assert that socket doesn't already exist, as we are about to create it. - XLOG_ASSERT(!get_sock().is_valid()); + // XXX: This paranoid assertion existed to catch socket recycling + // issues on the Windows platform; commented out for now. + //XLOG_ASSERT(!get_sock().is_valid()); size_t len; create_socket(get_local_socket(len), COMM_SOCK_BLOCKING); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Wed Sep 2 18:21:02 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Thu, 03 Sep 2009 01:21:02 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11539] trunk/xorp/ospf/lsa.hh Message-ID: Revision: 11539 http://xorp.svn.sourceforge.net/xorp/?rev=11539&view=rev Author: bms_fbsd Date: 2009-09-03 01:21:01 +0000 (Thu, 03 Sep 2009) Log Message: ----------- Correct the minimum length of an AS-External-LSA in OSPFv3. As per RFC 2740 section A.4.1, if the PrefixLength is 0, i.e. a default route is being advertised, the Address Prefix itself may be completely elided from the on-wire encoding. An illustration of this may be found in section A.4.7. Bugzilla URL: http://bugzilla.xorp.net/show_bug.cgi?id=1059 Submitted by: Petr Lampa Modified Paths: -------------- trunk/xorp/ospf/lsa.hh Modified: trunk/xorp/ospf/lsa.hh =================================================================== --- trunk/xorp/ospf/lsa.hh 2009-09-03 01:03:15 UTC (rev 11538) +++ trunk/xorp/ospf/lsa.hh 2009-09-03 01:21:01 UTC (rev 11539) @@ -1663,7 +1663,7 @@ return 16; break; case OspfTypes::V3: - return 12; + return 8; break; } XLOG_UNREACHABLE(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Wed Sep 2 19:32:36 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Thu, 03 Sep 2009 02:32:36 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11540] trunk/xorp/etc/templates/bgp.tp Message-ID: Revision: 11540 http://xorp.svn.sourceforge.net/xorp/?rev=11540&view=rev Author: bms_fbsd Date: 2009-09-03 02:32:36 +0000 (Thu, 03 Sep 2009) Log Message: ----------- Do not restrict the remote AS range to ASN16, by commenting %allow-range out. NOTE WELL: Native ASN32 peering is not guaranteed to work. Bugzilla URL: http://bugzilla.xorp.net/show_bug.cgi?id=964 Submitted by: stu at spacehopper dot org Modified Paths: -------------- trunk/xorp/etc/templates/bgp.tp Modified: trunk/xorp/etc/templates/bgp.tp =================================================================== --- trunk/xorp/etc/templates/bgp.tp 2009-09-03 01:21:01 UTC (rev 11539) +++ trunk/xorp/etc/templates/bgp.tp 2009-09-03 02:32:36 UTC (rev 11540) @@ -285,8 +285,7 @@ */ as { - %allow-range: $(@) "1" "65535" %help: "The peer AS number"; - + /*%allow-range: $(@) "1" "65535" %help: "The peer AS number";*/ %set: xrl "$(bgp.targetname)/bgp/0.3/set_peer_as?local_ip:txt=$(peer. at .local-ip)&local_port:u32=$(peer. at .local-port)&peer_ip:txt=$(peer.@)&peer_port:u32=$(peer. at .peer-port)&peer_as:txt=$(@)"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Thu Sep 3 08:10:06 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Thu, 03 Sep 2009 15:10:06 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11541] trunk/xorp/SConstruct Message-ID: Revision: 11541 http://xorp.svn.sourceforge.net/xorp/?rev=11541&view=rev Author: bms_fbsd Date: 2009-09-03 15:10:06 +0000 (Thu, 03 Sep 2009) Log Message: ----------- Import missing dependency machinery from Thrift branch Modified Paths: -------------- trunk/xorp/SConstruct Modified: trunk/xorp/SConstruct =================================================================== --- trunk/xorp/SConstruct 2009-09-03 02:32:36 UTC (rev 11540) +++ trunk/xorp/SConstruct 2009-09-03 15:10:06 UTC (rev 11541) @@ -206,6 +206,10 @@ ########## start configure magic if not env.GetOption('clean') and not env.GetOption('help'): + + env['MISSING_DEPS'] = [] + env['SKIPPED_DEPS'] = [] + from config.endian import CheckEndianness from config.member import CheckTypeMember from config.sysctl import CheckSysctl @@ -255,6 +259,16 @@ # Note: hard-coded paths pushed down to rtrmgr/util.cc environment. + # Print warnings about missing/skipped dependencies. + if env['MISSING_DEPS']: + print '\nRequired dependencies not found, exiting:\n - %s' % '\n - '.join(env['MISSING_DEPS']) + if env['SKIPPED_DEPS']: + print 'Optional dependencies not found:\n - %s' % '\n - '.join(env['SKIPPED_DEPS']) + Exit(1) + + if env['SKIPPED_DEPS']: + print 'Optional dependencies not found:\n - %s' % '\n - '.join(env['SKIPPED_DEPS']) + conf.Finish() ########## end configure magic This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Thu Sep 3 08:13:15 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Thu, 03 Sep 2009 15:13:15 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11542] trunk/xorp Message-ID: Revision: 11542 http://xorp.svn.sourceforge.net/xorp/?rev=11542&view=rev Author: bms_fbsd Date: 2009-09-03 15:13:14 +0000 (Thu, 03 Sep 2009) Log Message: ----------- Import first cut of Boost library/include detection from Thrift branch Modified Paths: -------------- trunk/xorp/SConstruct Added Paths: ----------- trunk/xorp/site_scons/config/boost.py Modified: trunk/xorp/SConstruct =================================================================== --- trunk/xorp/SConstruct 2009-09-03 15:10:06 UTC (rev 11541) +++ trunk/xorp/SConstruct 2009-09-03 15:13:14 UTC (rev 11542) @@ -213,11 +213,14 @@ from config.endian import CheckEndianness from config.member import CheckTypeMember from config.sysctl import CheckSysctl + from config.boost import CheckBoost, CheckBoostLibrary my_custom_tests = { - 'CheckEndianness' : CheckEndianness, - 'CheckTypeMember' : CheckTypeMember, - 'CheckSysctl' : CheckSysctl + 'CheckBoost' : CheckBoost, + 'CheckBoostLibrary' : CheckBoostLibrary, + 'CheckEndianness' : CheckEndianness, + 'CheckTypeMember' : CheckTypeMember, + 'CheckSysctl' : CheckSysctl } conf = env.Configure(config_h = str(builddir) + '/xorp_config.h', @@ -253,6 +256,20 @@ conf.Define('CPP_SUPPORTS_C99_VA_ARGS') conf.Define('CPP_SUPPORTS_GNU_VA_ARGS') + # Boost + #env['boost_suffix'] = "-mt" # Not for FreeBSD + #conf.CheckBoost(require_version='1.39') + #conf.CheckBoostLibrary('system') + #conf.CheckBoostLibrary('date_time') + #conf.CheckBoostLibrary('iostreams') + + # Additional Boost libraries + #conf.CheckBoostLibrary('filesystem') + #conf.CheckBoostLibrary('program_options') + #conf.CheckBoostLibrary('regex') + #conf.CheckBoostLibrary('signals') + #conf.CheckBoostLibrary('thread') + # Big ball of mud. from config.allconfig import DoAllConfig DoAllConfig(env, conf, host_os) Added: trunk/xorp/site_scons/config/boost.py =================================================================== --- trunk/xorp/site_scons/config/boost.py (rev 0) +++ trunk/xorp/site_scons/config/boost.py 2009-09-03 15:13:14 UTC (rev 11542) @@ -0,0 +1,113 @@ +#!/usr/bin/env python +# +# vim:set sts=4 ts=8 syntax=python: +# +# Copyright (c) 2009 XORP, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, Version 2, June +# 1991 as published by the Free Software Foundation. Redistribution +# and/or modification of this program under the terms of any other +# version of the GNU General Public License is not permitted. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details, +# see the GNU General Public License, Version 2, a copy of which can be +# found in the XORP LICENSE.gpl file. +# +# XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA; +# http://xorp.net + +# $Id$ + +# Boost configure checks derived from Mapnik/Wesnoth (LGPL/GPL2) + +import sys + +def _CheckBoostLib(context, boost_lib): + env = context.env + boost_headers = { + # library basename : include file + "date_time" : "date_time.hpp", + "filesystem" : "filesystem.hpp", + "iostreams" : "iostreams/constants.hpp", + "program_options" : "program_options.hpp", + "regex" : "regex/config.hpp", + "signals" : "signal.hpp", + "system" : "system/config.hpp", + "thread" : "thread.hpp", + } + + header_name = boost_headers.get(boost_lib, boost_lib + ".hpp") + libname = "boost_" + boost_lib + env.get("boost_suffix", "") + + # XXX prepending to global environment LIBS + env.PrependUnique(LIBS = [libname]) + + test_program = """ + #include + \n""" % header_name + + test_program += """ + int main() + { + } + \n""" + if context.TryLink(test_program, ".cpp"): + return True + return False + +def CheckBoostLibrary(context, boost_lib): + """Check for a Boost library. + XXX Assumes CPPPATH and LIBPATH contain boost path somewhere.""" + context.Message("Checking for Boost %s library... " % boost_lib) + check_result = _CheckBoostLib(context, boost_lib) + # Try again with mt variant if no boost_suffix specified + if not check_result and not context.env.get("boost_suffix"): + context.env["boost_suffix"] = "-mt" + check_result = _CheckBoostLib(context, boost_lib) + if check_result: + context.Result("yes") + else: + context.Result("no") + return check_result + +def CheckBoost(context, require_version = None): + """ Check for Boost itself, by checking for version.hpp. + A version may or may not be specified. + XXX Assumes CPPPATH and LIBPATH contain boost path somewhere.""" + + check_result = False + if require_version: + context.Message("Checking for Boost version >= %s... " % \ + require_version) + else: + context.Message("Checking for Boost... ") + + test_program = "#include \n" + if require_version: + version = require_version.split(".", 2) + major = int(version[0]) + minor = int(version[1]) + try: + sub_minor = int(version[2]) + except (ValueError, IndexError): + sub_minor = 0 + test_program += """ + #if BOOST_VERSION < %d + #error Boost version is too old! + #endif + """ % (major * 100000 + minor * 100 + sub_minor) + test_program += """ + int main() + { + } + """ + if context.TryCompile(test_program, ".cpp"): + check_result = True + if check_result: + context.Result("yes") + else: + context.Result("no") + return check_result This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From johntconklin at users.sourceforge.net Tue Sep 15 11:05:40 2009 From: johntconklin at users.sourceforge.net (johntconklin at users.sourceforge.net) Date: Tue, 15 Sep 2009 18:05:40 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11543] trunk/xorp/SConstruct Message-ID: Revision: 11543 http://xorp.svn.sourceforge.net/xorp/?rev=11543&view=rev Author: johntconklin Date: 2009-09-15 18:05:40 +0000 (Tue, 15 Sep 2009) Log Message: ----------- Ensure SCons is at least version 1.2 Modified Paths: -------------- trunk/xorp/SConstruct Modified: trunk/xorp/SConstruct =================================================================== --- trunk/xorp/SConstruct 2009-09-03 15:13:14 UTC (rev 11542) +++ trunk/xorp/SConstruct 2009-09-15 18:05:40 UTC (rev 11543) @@ -30,6 +30,8 @@ # TODO disambiguate arch specification cross-platform # TODO conditionalize new directory layout here +EnsureSConsVersion(1, 2) + Help(""" cross=true if you are doing a cross build. Default is false. arch={i686} to identify the target architecture. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From johntconklin at users.sourceforge.net Tue Sep 15 11:09:15 2009 From: johntconklin at users.sourceforge.net (johntconklin at users.sourceforge.net) Date: Tue, 15 Sep 2009 18:09:15 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11544] trunk/xorp/SConstruct Message-ID: Revision: 11544 http://xorp.svn.sourceforge.net/xorp/?rev=11544&view=rev Author: johntconklin Date: 2009-09-15 18:09:15 +0000 (Tue, 15 Sep 2009) Log Message: ----------- Ensure we're running with at least Python 2.3. The XRL generator classes use the optparse class, which were added in 2.3. Modified Paths: -------------- trunk/xorp/SConstruct Modified: trunk/xorp/SConstruct =================================================================== --- trunk/xorp/SConstruct 2009-09-15 18:05:40 UTC (rev 11543) +++ trunk/xorp/SConstruct 2009-09-15 18:09:15 UTC (rev 11544) @@ -30,6 +30,7 @@ # TODO disambiguate arch specification cross-platform # TODO conditionalize new directory layout here +EnsurePythonVersion(2, 3) EnsureSConsVersion(1, 2) Help(""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From johntconklin at users.sourceforge.net Tue Sep 15 11:43:57 2009 From: johntconklin at users.sourceforge.net (johntconklin at users.sourceforge.net) Date: Tue, 15 Sep 2009 18:43:57 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11545] trunk/xorp/SConstruct Message-ID: Revision: 11545 http://xorp.svn.sourceforge.net/xorp/?rev=11545&view=rev Author: johntconklin Date: 2009-09-15 18:43:57 +0000 (Tue, 15 Sep 2009) Log Message: ----------- Mechanism to override CC and CXX on the command line. I've placed this after the default tools have set the defaults (so we're careful not to change them if no command line arguments have been passed), but before the scons configuration feature tests are run (so the proper tools are used in that context). Modified Paths: -------------- trunk/xorp/SConstruct Modified: trunk/xorp/SConstruct =================================================================== --- trunk/xorp/SConstruct 2009-09-15 18:09:15 UTC (rev 11544) +++ trunk/xorp/SConstruct 2009-09-15 18:43:57 UTC (rev 11545) @@ -105,6 +105,15 @@ env['DESTDIR'] = ARGUMENTS.get('DESTDIR', '') +# Provide mechanism to override CC, CXX, etc. +if ARGUMENTS.get('CC', None): + env['CC'] = ARGUMENTS.get('CC') +print 'CC: ', env['CC'] + +if ARGUMENTS.get('CXX', None): + env['CXX'] = ARGUMENTS.get('CXX') +print 'CXX: ', env['CXX'] + if env['strip']: env['strip'] = True env['STRIP'] = "strip" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From johntconklin at users.sourceforge.net Tue Sep 15 14:26:52 2009 From: johntconklin at users.sourceforge.net (johntconklin at users.sourceforge.net) Date: Tue, 15 Sep 2009 21:26:52 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11546] trunk/xorp/SConstruct Message-ID: Revision: 11546 http://xorp.svn.sourceforge.net/xorp/?rev=11546&view=rev Author: johntconklin Date: 2009-09-15 21:26:52 +0000 (Tue, 15 Sep 2009) Log Message: ----------- Mechanism to override STRIP on the command line. Modified Paths: -------------- trunk/xorp/SConstruct Modified: trunk/xorp/SConstruct =================================================================== --- trunk/xorp/SConstruct 2009-09-15 18:43:57 UTC (rev 11545) +++ trunk/xorp/SConstruct 2009-09-15 21:26:52 UTC (rev 11546) @@ -114,9 +114,11 @@ env['CXX'] = ARGUMENTS.get('CXX') print 'CXX: ', env['CXX'] +env['STRIP'] = ARGUMENTS.get('STRIP', 'strip') +print 'STRIP: ', env['STRIP'] + if env['strip']: env['strip'] = True - env['STRIP'] = "strip" print 'Strip binaries: ', env.has_key('strip') if env['shared']: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From johntconklin at users.sourceforge.net Tue Sep 15 16:55:10 2009 From: johntconklin at users.sourceforge.net (johntconklin at users.sourceforge.net) Date: Tue, 15 Sep 2009 23:55:10 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11547] trunk/xorp/site_scons/config/allconfig.py Message-ID: Revision: 11547 http://xorp.svn.sourceforge.net/xorp/?rev=11547&view=rev Author: johntconklin Date: 2009-09-15 23:55:09 +0000 (Tue, 15 Sep 2009) Log Message: ----------- Change header file feature test for to use a dynamic list of prerequisite header files, based on what is provided by the host. This doesn't completely test the header as it was performed using autoconf/make, as that requires some changes in SCons itself. See the TODO for details. Modified Paths: -------------- trunk/xorp/site_scons/config/allconfig.py Modified: trunk/xorp/site_scons/config/allconfig.py =================================================================== --- trunk/xorp/site_scons/config/allconfig.py 2009-09-15 21:26:52 UTC (rev 11546) +++ trunk/xorp/site_scons/config/allconfig.py 2009-09-15 23:55:09 UTC (rev 11547) @@ -507,8 +507,24 @@ if has_net_ip_mroute_ip_mroute_h: prereq_mroute_h = prereq_net_ip_mroute_ip_mroute_h mroute_h = net_ip_mroute_ip_mroute_h - - prereq_linux_mroute_h = ['sys/types.h', 'sys/socket.h', 'netinet/in.h', 'linux/types.h'] + + # Header file might need , , + # , and/or + # + # TODO: The autoconf feature test for this contained a hack to exclude + # that might be included by , because + # might conflict with that was included + # earlier. This is currently difficult to replicate in SCons, as + # you can't pass arbitrary code that is prepended to the test. + prereq_linux_mroute_h = [] + if has_sys_types_h: + prereq_linux_mroute_h.append('sys/types.h') + if has_sys_socket_h: + prereq_linux_mroute_h.append('sys/socket.h') + if has_netinet_in_h: + prereq_linux_mroute_h.append('netinet/in.h') + if has_linux_types_h: + prereq_linux_mroute_h.append('linux/types.h') linux_mroute_h = 'linux/mroute.h' has_linux_mroute_h = conf.CheckHeader(prereq_linux_mroute_h + [ linux_mroute_h ]) if has_linux_mroute_h: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Mon Sep 21 10:28:51 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Mon, 21 Sep 2009 17:28:51 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11548] trunk/xorp/static_routes/SConscript Message-ID: Revision: 11548 http://xorp.svn.sourceforge.net/xorp/?rev=11548&view=rev Author: bms_fbsd Date: 2009-09-21 17:28:51 +0000 (Mon, 21 Sep 2009) Log Message: ----------- Drop unneeded library from link line. Modified Paths: -------------- trunk/xorp/static_routes/SConscript Modified: trunk/xorp/static_routes/SConscript =================================================================== --- trunk/xorp/static_routes/SConscript 2009-09-15 23:55:09 UTC (rev 11547) +++ trunk/xorp/static_routes/SConscript 2009-09-21 17:28:51 UTC (rev 11548) @@ -47,7 +47,6 @@ 'feaclient', 'feaifmgrmirrorxif', 'feaifmgrreplicatorxif', - 'fearawlinkxif', 'findereventnotifierxif', 'feaifmgrmirrorbase', 'staticroutesbase', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Mon Sep 21 10:44:01 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Mon, 21 Sep 2009 17:44:01 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11549] trunk/xorp/libxipc/SConscript Message-ID: Revision: 11549 http://xorp.svn.sourceforge.net/xorp/?rev=11549&view=rev Author: bms_fbsd Date: 2009-09-21 17:44:01 +0000 (Mon, 21 Sep 2009) Log Message: ----------- Add comment that some files are only needed for UDP transport of XRLs (which we normally don't use, because it's lossy). Modified Paths: -------------- trunk/xorp/libxipc/SConscript Modified: trunk/xorp/libxipc/SConscript =================================================================== --- trunk/xorp/libxipc/SConscript 2009-09-21 17:28:51 UTC (rev 11548) +++ trunk/xorp/libxipc/SConscript 2009-09-21 17:44:01 UTC (rev 11549) @@ -54,7 +54,7 @@ 'finder_msgs.cc', 'finder_tcp.cc', 'finder_tcp_messenger.cc', - 'header.cc', + 'header.cc', # only for udp 'hmac.cc', 'hmac_md5.c', 'permits.cc', @@ -80,7 +80,7 @@ 'xrl_router.cc', 'xrl_std_router.cc', 'xrl_tokens.cc', - 'xuid.cc', + 'xuid.cc', # only for udp ] # deal with shared objects This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Mon Sep 21 10:44:48 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Mon, 21 Sep 2009 17:44:48 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11550] trunk/xorp/libxipc Message-ID: Revision: 11550 http://xorp.svn.sourceforge.net/xorp/?rev=11550&view=rev Author: bms_fbsd Date: 2009-09-21 17:44:48 +0000 (Mon, 21 Sep 2009) Log Message: ----------- eliminate unneeded #include Modified Paths: -------------- trunk/xorp/libxipc/xrl_pf_kill.cc trunk/xorp/libxipc/xrl_pf_stcp.cc Modified: trunk/xorp/libxipc/xrl_pf_kill.cc =================================================================== --- trunk/xorp/libxipc/xrl_pf_kill.cc 2009-09-21 17:44:01 UTC (rev 11549) +++ trunk/xorp/libxipc/xrl_pf_kill.cc 2009-09-21 17:44:48 UTC (rev 11550) @@ -39,7 +39,6 @@ #include #endif -#include "header.hh" #include "xrl_error.hh" #include "xrl_pf_kill.hh" #include "xrl_dispatcher.hh" Modified: trunk/xorp/libxipc/xrl_pf_stcp.cc =================================================================== --- trunk/xorp/libxipc/xrl_pf_stcp.cc 2009-09-21 17:44:01 UTC (rev 11549) +++ trunk/xorp/libxipc/xrl_pf_stcp.cc 2009-09-21 17:44:48 UTC (rev 11550) @@ -48,7 +48,6 @@ #include "libcomm/comm_api.h" #include "sockutil.hh" -#include "header.hh" #include "xrl.hh" #include "xrl_error.hh" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Mon Sep 21 15:48:30 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Mon, 21 Sep 2009 22:48:30 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11551] trunk/xorp/libcomm Message-ID: Revision: 11551 http://xorp.svn.sourceforge.net/xorp/?rev=11551&view=rev Author: bms_fbsd Date: 2009-09-21 22:48:30 +0000 (Mon, 21 Sep 2009) Log Message: ----------- Add libcomm wrappers for SO_KEEPALIVE and SO_LINGER options. Modified Paths: -------------- trunk/xorp/libcomm/comm_api.h trunk/xorp/libcomm/comm_sock.c trunk/xorp/libcomm/comm_user.c Modified: trunk/xorp/libcomm/comm_api.h =================================================================== --- trunk/xorp/libcomm/comm_api.h 2009-09-21 17:44:48 UTC (rev 11550) +++ trunk/xorp/libcomm/comm_api.h 2009-09-21 22:48:30 UTC (rev 11551) @@ -160,6 +160,20 @@ extern int comm_bindtodevice_present(void); /** + * Test whether the underlying system has SO_LINGER support. + * + * @return XORP_OK on success, otherwise XORP_ERROR. + */ +extern int comm_linger_present(void); + +/** + * Test whether the underlying system has SO_KEEPALIVE support. + * + * @return XORP_OK on success, otherwise XORP_ERROR. + */ +extern int comm_keepalive_present(void); + +/** * Test whether the underlying system has IP_ONESBCAST support. * * @return XORP_OK on success, otherwise XORP_ERROR. @@ -786,6 +800,24 @@ extern int comm_set_nodelay(xsock_t sock, int val); /** + * Set/reset the SO_LINGER option on a socket. + * + * @param sock the socket whose option we want to set/reset. + * @param val if non-zero, the option will be set, otherwise will be reset. + * @return XORP_OK on success, otherwise XORP_ERROR. + */ +extern int comm_set_linger(xsock_t sock, int enabled, int secs); + +/** + * Set/reset the SO_KEEPALIVE option on a socket. + * + * @param sock the socket whose option we want to set/reset. + * @param val if non-zero, the option will be set, otherwise will be reset. + * @return XORP_OK on success, otherwise XORP_ERROR. + */ +extern int comm_set_keepalive(xsock_t sock, int val); + +/** * Set/reset the SO_REUSEADDR option on a socket. * * Note: If the OS doesn't support this option, then XORP_ERROR is returned. Modified: trunk/xorp/libcomm/comm_sock.c =================================================================== --- trunk/xorp/libcomm/comm_sock.c 2009-09-21 17:44:48 UTC (rev 11550) +++ trunk/xorp/libcomm/comm_sock.c 2009-09-21 22:48:30 UTC (rev 11551) @@ -848,6 +848,59 @@ } int +comm_set_linger(xsock_t sock, int enabled, int secs) +{ +#ifdef SO_LINGER + struct linger l; + + l.l_onoff = enabled; + l.l_linger = secs; + if (setsockopt(sock, SOL_SOCKET, SO_LINGER, + XORP_SOCKOPT_CAST(&l), sizeof(l)) < 0) { + _comm_set_serrno(); + XLOG_ERROR("Error %s SO_LINGER %ds on socket %d: %s", + (enabled)? "set": "reset", secs, sock, + comm_get_error_str(comm_get_last_error())); + return (XORP_ERROR); + } + + return (XORP_OK); + +#else /* ! SO_LINGER */ + UNUSED(sock); + UNUSED(enabled); + UNUSED(secs); + XLOG_WARNING("SO_LINGER Undefined!"); + + return (XORP_ERROR); +#endif /* ! SO_LINGER */ +} + +int +comm_set_keepalive(xsock_t sock, int val) +{ +#ifdef SO_KEEPALIVE + if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, + XORP_SOCKOPT_CAST(&val), sizeof(val)) < 0) { + _comm_set_serrno(); + XLOG_ERROR("Error %s SO_KEEPALIVE on socket %d: %s", + (val)? "set": "reset", sock, + comm_get_error_str(comm_get_last_error())); + return (XORP_ERROR); + } + + return (XORP_OK); + +#else /* ! SO_KEEPALIVE */ + UNUSED(sock); + UNUSED(val); + XLOG_WARNING("SO_KEEPALIVE Undefined!"); + + return (XORP_ERROR); +#endif /* ! SO_KEEPALIVE */ +} + +int comm_set_reuseaddr(xsock_t sock, int val) { #ifdef SO_REUSEADDR Modified: trunk/xorp/libcomm/comm_user.c =================================================================== --- trunk/xorp/libcomm/comm_user.c 2009-09-21 17:44:48 UTC (rev 11550) +++ trunk/xorp/libcomm/comm_user.c 2009-09-21 22:48:30 UTC (rev 11551) @@ -153,6 +153,26 @@ } int +comm_keepalive_present(void) +{ +#ifdef SO_KEEPALIVE + return XORP_OK; +#else + return XORP_ERROR; +#endif +} + +int +comm_linger_present(void) +{ +#ifdef SO_LINGER + return XORP_OK; +#else + return XORP_ERROR; +#endif +} + +int comm_onesbcast_present(void) { #ifdef IP_ONESBCAST This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Mon Sep 21 15:53:57 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Mon, 21 Sep 2009 22:53:57 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11552] trunk/xorp/libcomm Message-ID: Revision: 11552 http://xorp.svn.sourceforge.net/xorp/?rev=11552&view=rev Author: bms_fbsd Date: 2009-09-21 22:53:57 +0000 (Mon, 21 Sep 2009) Log Message: ----------- Add libcomm wrapper for TCP_NOPUSH. Modified Paths: -------------- trunk/xorp/libcomm/comm_api.h trunk/xorp/libcomm/comm_sock.c trunk/xorp/libcomm/comm_user.c Modified: trunk/xorp/libcomm/comm_api.h =================================================================== --- trunk/xorp/libcomm/comm_api.h 2009-09-21 22:48:30 UTC (rev 11551) +++ trunk/xorp/libcomm/comm_api.h 2009-09-21 22:53:57 UTC (rev 11552) @@ -188,6 +188,13 @@ extern int comm_tos_present(void); /** + * Test whether the underlying system has TCP_NOPUSH support. + * + * @return XORP_OK on success, otherwise XORP_ERROR. + */ +extern int comm_nopush_present(void); + +/** * Test whether the underlying system has IP_TTL support. * * @return XORP_OK on success, otherwise XORP_ERROR. @@ -800,6 +807,15 @@ extern int comm_set_nodelay(xsock_t sock, int val); /** + * Set/reset the TCP_NOPUSH option on a TCP socket. + * + * @param sock the socket whose option we want to set/reset. + * @param val if non-zero, the option will be set, otherwise will be reset. + * @return XORP_OK on success, otherwise XORP_ERROR. + */ +extern int comm_set_nopush(xsock_t sock, int val); + +/** * Set/reset the SO_LINGER option on a socket. * * @param sock the socket whose option we want to set/reset. Modified: trunk/xorp/libcomm/comm_sock.c =================================================================== --- trunk/xorp/libcomm/comm_sock.c 2009-09-21 22:48:30 UTC (rev 11551) +++ trunk/xorp/libcomm/comm_sock.c 2009-09-21 22:53:57 UTC (rev 11552) @@ -1018,6 +1018,30 @@ } int +comm_set_nopush(xsock_t sock, int val) +{ +#ifdef TCP_NOPUSH /* XXX: Defined in across Free/Net/OpenBSD */ + if (setsockopt(sock, IPPROTO_TCP, TCP_NOPUSH, + XORP_SOCKOPT_CAST(&val), sizeof(val)) < 0) { + _comm_set_serrno(); + XLOG_ERROR("Error %s TCP_NOPUSH on socket %d: %s", + (val)? "set": "reset", sock, + comm_get_error_str(comm_get_last_error())); + return (XORP_ERROR); + } + + return (XORP_OK); + +#else /* ! TCP_NOPUSH */ + UNUSED(sock); + UNUSED(val); + XLOG_WARNING("TCP_NOPUSH Undefined!"); + + return (XORP_ERROR); +#endif /* ! TCP_NOPUSH */ +} + +int comm_set_tos(xsock_t sock, int val) { #ifdef IP_TOS Modified: trunk/xorp/libcomm/comm_user.c =================================================================== --- trunk/xorp/libcomm/comm_user.c 2009-09-21 22:48:30 UTC (rev 11551) +++ trunk/xorp/libcomm/comm_user.c 2009-09-21 22:53:57 UTC (rev 11552) @@ -193,6 +193,16 @@ } int +comm_nopush_present(void) +{ +#ifdef TCP_NOPUSH + return XORP_OK; +#else + return XORP_ERROR; +#endif +} + +int comm_unicast_ttl_present(void) { #ifdef IP_TTL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Tue Sep 22 09:40:52 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Tue, 22 Sep 2009 16:40:52 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11553] trunk/xorp/libcomm Message-ID: Revision: 11553 http://xorp.svn.sourceforge.net/xorp/?rev=11553&view=rev Author: bms_fbsd Date: 2009-09-22 16:40:51 +0000 (Tue, 22 Sep 2009) Log Message: ----------- Add a SO_NOSIGPIPE wrapper to libcomm, for use on the BSDs. On Linux, we should be using MSG_NOSIGNAL where possible (already). Disabling SIGPIPE signal disposition in the I/O paths is measurably faster (there's no tedious detour through the kernel signal code), and simplifies C++ error handling. Modified Paths: -------------- trunk/xorp/libcomm/comm_api.h trunk/xorp/libcomm/comm_sock.c trunk/xorp/libcomm/comm_user.c Modified: trunk/xorp/libcomm/comm_api.h =================================================================== --- trunk/xorp/libcomm/comm_api.h 2009-09-21 22:53:57 UTC (rev 11552) +++ trunk/xorp/libcomm/comm_api.h 2009-09-22 16:40:51 UTC (rev 11553) @@ -174,6 +174,13 @@ extern int comm_keepalive_present(void); /** + * Test whether the underlying system has SO_NOSIGPIPE support. + * + * @return XORP_OK on success, otherwise XORP_ERROR. + */ +extern int comm_nosigpipe_present(void); + +/** * Test whether the underlying system has IP_ONESBCAST support. * * @return XORP_OK on success, otherwise XORP_ERROR. @@ -834,6 +841,15 @@ extern int comm_set_keepalive(xsock_t sock, int val); /** + * Set/reset the SO_NOSIGPIPE option on a socket. + * + * @param sock the socket whose option we want to set/reset. + * @param val if non-zero, the option will be set, otherwise will be reset. + * @return XORP_OK on success, otherwise XORP_ERROR. + */ +extern int comm_set_nosigpipe(xsock_t sock, int val); + +/** * Set/reset the SO_REUSEADDR option on a socket. * * Note: If the OS doesn't support this option, then XORP_ERROR is returned. Modified: trunk/xorp/libcomm/comm_sock.c =================================================================== --- trunk/xorp/libcomm/comm_sock.c 2009-09-21 22:53:57 UTC (rev 11552) +++ trunk/xorp/libcomm/comm_sock.c 2009-09-22 16:40:51 UTC (rev 11553) @@ -901,6 +901,29 @@ } int +comm_set_nosigpipe(xsock_t sock, int val) +{ +#ifdef SO_NOSIGPIPE + if (setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, + XORP_SOCKOPT_CAST(&val), sizeof(val)) < 0) { + _comm_set_serrno(); + XLOG_ERROR("Error %s SO_NOSIGPIPE on socket %d: %s", + (val)? "set": "reset", sock, + comm_get_error_str(comm_get_last_error())); + return (XORP_ERROR); + } + + return (XORP_OK); +#else /* ! SO_NOSIGPIPE */ + UNUSED(sock); + UNUSED(val); + XLOG_WARNING("SO_NOSIGPIPE Undefined!"); + + return (XORP_ERROR); +#endif /* ! SO_NOSIGPIPE */ +} + +int comm_set_reuseaddr(xsock_t sock, int val) { #ifdef SO_REUSEADDR Modified: trunk/xorp/libcomm/comm_user.c =================================================================== --- trunk/xorp/libcomm/comm_user.c 2009-09-21 22:53:57 UTC (rev 11552) +++ trunk/xorp/libcomm/comm_user.c 2009-09-22 16:40:51 UTC (rev 11553) @@ -173,6 +173,16 @@ } int +comm_nosigpipe_present(void) +{ +#ifdef SO_NOSIGPIPE + return XORP_OK; +#else + return XORP_ERROR; +#endif +} + +int comm_onesbcast_present(void) { #ifdef IP_ONESBCAST This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Tue Sep 22 09:42:45 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Tue, 22 Sep 2009 16:42:45 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11554] trunk/xorp/libxipc/finder.cc Message-ID: Revision: 11554 http://xorp.svn.sourceforge.net/xorp/?rev=11554&view=rev Author: bms_fbsd Date: 2009-09-22 16:42:45 +0000 (Tue, 22 Sep 2009) Log Message: ----------- Put Finder's internal consistency checks under a compile-time define, FINDER_CONSISTENCY_CHECKS. We have had no reports of problems with this code in several *years*. It is a potentially expensive set of checks for large numbers of XRL classes/targets during process startup. Modified Paths: -------------- trunk/xorp/libxipc/finder.cc Modified: trunk/xorp/libxipc/finder.cc =================================================================== --- trunk/xorp/libxipc/finder.cc 2009-09-22 16:40:51 UTC (rev 11553) +++ trunk/xorp/libxipc/finder.cc 2009-09-22 16:42:45 UTC (rev 11554) @@ -19,8 +19,6 @@ // XORP, Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA; // http://xorp.net - - #include #include "finder_module.h" @@ -295,6 +293,7 @@ const Finder::TargetTable& targets) { +#ifdef FINDER_CONSISTENCY_CHECKS typedef Finder::ClassTable ClassTable; typedef Finder::TargetTable TargetTable; @@ -341,6 +340,12 @@ } } } + +#else // ! FINDER_CONSISTENCY_CHECKS + return; + UNUSED(classes); + UNUSED(targets); +#endif // FINDER_CONSISTENCY_CHECKS } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Thu Sep 24 13:13:36 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Thu, 24 Sep 2009 20:13:36 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11555] trunk/xorp/libxipc Message-ID: Revision: 11555 http://xorp.svn.sourceforge.net/xorp/?rev=11555&view=rev Author: bms_fbsd Date: 2009-09-24 20:13:33 +0000 (Thu, 24 Sep 2009) Log Message: ----------- Comment out the XRL 'kill', 'inproc', and 'udp' transports from the build. They are not used in current XORP deployments, and may be removed at a later date. Modified Paths: -------------- trunk/xorp/libxipc/SConscript trunk/xorp/libxipc/xrl_pf_factory.cc trunk/xorp/libxipc/xrl_std_router.cc Modified: trunk/xorp/libxipc/SConscript =================================================================== --- trunk/xorp/libxipc/SConscript 2009-09-22 16:42:45 UTC (rev 11554) +++ trunk/xorp/libxipc/SConscript 2009-09-24 20:13:33 UTC (rev 11555) @@ -54,7 +54,7 @@ 'finder_msgs.cc', 'finder_tcp.cc', 'finder_tcp_messenger.cc', - 'header.cc', # only for udp + #'header.cc', # only for udp 'hmac.cc', 'hmac_md5.c', 'permits.cc', @@ -71,16 +71,16 @@ 'xrl_parser_input.cc', 'xrl_pf.cc', 'xrl_pf_factory.cc', - 'xrl_pf_inproc.cc', - 'xrl_pf_kill.cc', + #'xrl_pf_inproc.cc', # not used in production build + #'xrl_pf_kill.cc', # not used in production build 'xrl_pf_stcp.cc', 'xrl_pf_stcp_ph.cc', - 'xrl_pf_sudp.cc', + #'xrl_pf_sudp.cc', # not used in production build 'xrl_pf_unix.cc', 'xrl_router.cc', 'xrl_std_router.cc', 'xrl_tokens.cc', - 'xuid.cc', # only for udp + #'xuid.cc', # only for udp ] # deal with shared objects Modified: trunk/xorp/libxipc/xrl_pf_factory.cc =================================================================== --- trunk/xorp/libxipc/xrl_pf_factory.cc 2009-09-22 16:42:45 UTC (rev 11554) +++ trunk/xorp/libxipc/xrl_pf_factory.cc 2009-09-24 20:13:33 UTC (rev 11555) @@ -30,10 +30,10 @@ #include #include "xrl_pf_factory.hh" -#include "xrl_pf_inproc.hh" -#include "xrl_pf_sudp.hh" +//#include "xrl_pf_inproc.hh" +//#include "xrl_pf_sudp.hh" #include "xrl_pf_stcp.hh" -#include "xrl_pf_kill.hh" +//#include "xrl_pf_kill.hh" #include "xrl_pf_unix.hh" @@ -49,15 +49,22 @@ debug_msg("instantiating sender pf = \"%s\", addr = \"%s\"\n", protocol, address); try { +#if 0 if (strcmp(XrlPFSUDPSender::protocol_name(), protocol) == 0) { return new XrlPFSUDPSender(eventloop, address); - } else if (strcmp(XrlPFSTCPSender::protocol_name(), protocol) == 0) { + } else +#endif + if (strcmp(XrlPFSTCPSender::protocol_name(), protocol) == 0) { return new XrlPFSTCPSender(eventloop, address); - } else if (strcmp(XrlPFInProcSender::protocol_name(), protocol) == 0) { + } +#if 0 + else if (strcmp(XrlPFInProcSender::protocol_name(), protocol) == 0) { return new XrlPFInProcSender(eventloop, address); } else if (strcmp(XrlPFKillSender::protocol_name(), protocol) == 0) { return new XrlPFKillSender(eventloop, address); - } else if (strcmp(XrlPFUNIXSender::protocol_name(), protocol) == 0) + } else +#endif + if (strcmp(XrlPFUNIXSender::protocol_name(), protocol) == 0) return new XrlPFUNIXSender(eventloop, address); } catch (XorpException& e) { XLOG_ERROR("XrlPFSenderFactory::create failed: %s\n", e.str().c_str()); Modified: trunk/xorp/libxipc/xrl_std_router.cc =================================================================== --- trunk/xorp/libxipc/xrl_std_router.cc 2009-09-22 16:42:45 UTC (rev 11554) +++ trunk/xorp/libxipc/xrl_std_router.cc 2009-09-24 20:13:33 UTC (rev 11555) @@ -23,9 +23,9 @@ #include "xrl_module.h" #include "xrl_std_router.hh" -#include "xrl_pf_inproc.hh" +//#include "xrl_pf_inproc.hh" #include "xrl_pf_stcp.hh" -#include "xrl_pf_sudp.hh" +//#include "xrl_pf_sudp.hh" #include "xrl_pf_unix.hh" #include "libxorp/xlog.h" @@ -39,11 +39,13 @@ if (pf != NULL) { switch (pf[0]) { +#if 0 case 'i': return new XrlPFInProcListener(_e, this); case 'u': return new XrlPFSUDPListener(_e, this); +#endif case 'x': XLOG_ASSERT(_unix == NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Fri Sep 25 11:08:21 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Fri, 25 Sep 2009 18:08:21 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11556] trunk/xorp/libxipc/SConscript Message-ID: Revision: 11556 http://xorp.svn.sourceforge.net/xorp/?rev=11556&view=rev Author: bms_fbsd Date: 2009-09-25 18:08:21 +0000 (Fri, 25 Sep 2009) Log Message: ----------- xuid is used by the FEA. Modified Paths: -------------- trunk/xorp/libxipc/SConscript Modified: trunk/xorp/libxipc/SConscript =================================================================== --- trunk/xorp/libxipc/SConscript 2009-09-24 20:13:33 UTC (rev 11555) +++ trunk/xorp/libxipc/SConscript 2009-09-25 18:08:21 UTC (rev 11556) @@ -80,7 +80,7 @@ 'xrl_router.cc', 'xrl_std_router.cc', 'xrl_tokens.cc', - #'xuid.cc', # only for udp + 'xuid.cc', # only for udp (and fea tcpudp mgr) ] # deal with shared objects This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From johntconklin at users.sourceforge.net Mon Sep 28 23:29:39 2009 From: johntconklin at users.sourceforge.net (johntconklin at users.sourceforge.net) Date: Tue, 29 Sep 2009 06:29:39 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11557] trunk/xorp/SConstruct Message-ID: Revision: 11557 http://xorp.svn.sourceforge.net/xorp/?rev=11557&view=rev Author: johntconklin Date: 2009-09-29 06:29:39 +0000 (Tue, 29 Sep 2009) Log Message: ----------- Ben Greer reports that SCons 0.98.4 works, so relax the EnsureSConsVersion check accordingly. Modified Paths: -------------- trunk/xorp/SConstruct Modified: trunk/xorp/SConstruct =================================================================== --- trunk/xorp/SConstruct 2009-09-25 18:08:21 UTC (rev 11556) +++ trunk/xorp/SConstruct 2009-09-29 06:29:39 UTC (rev 11557) @@ -30,9 +30,15 @@ # TODO disambiguate arch specification cross-platform # TODO conditionalize new directory layout here +# The XRL tgt-gen and clnt-gen scripts use Python 2.3+'s optparse +# class. EnsurePythonVersion(2, 3) -EnsureSConsVersion(1, 2) +# SCons 0.98.4 is the earliest release that we have tested. Earlier +# ones may work. If so, please submit a Trac issue so the check can +# be relaxed. +EnsureSConsVersion(0, 98, 4) + Help(""" cross=true if you are doing a cross build. Default is false. arch={i686} to identify the target architecture. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From johntconklin at users.sourceforge.net Tue Sep 29 06:49:43 2009 From: johntconklin at users.sourceforge.net (johntconklin at users.sourceforge.net) Date: Tue, 29 Sep 2009 13:49:43 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11558] trunk/xorp/SConstruct Message-ID: Revision: 11558 http://xorp.svn.sourceforge.net/xorp/?rev=11558&view=rev Author: johntconklin Date: 2009-09-29 13:49:42 +0000 (Tue, 29 Sep 2009) Log Message: ----------- Place the .sconsign.dblite file in ${BUILDDIR}. Note only does this enables a read-only ${SRCDIR}, it allows multiple builds for different hosts/targets to occur at the same time with the same sources using the same sources. Modified Paths: -------------- trunk/xorp/SConstruct Modified: trunk/xorp/SConstruct =================================================================== --- trunk/xorp/SConstruct 2009-09-29 06:29:39 UTC (rev 11557) +++ trunk/xorp/SConstruct 2009-09-29 13:49:42 UTC (rev 11558) @@ -86,6 +86,8 @@ sourcedir=Dir(".").abspath builddir=Dir(ARGUMENTS.get('builddir', '#obj/' + host_arch+'-'+host_os+'-'+rel)).abspath +SConsignFile(builddir + '/.sconsign') + prefix = ARGUMENTS.get('prefix', '/usr/local/xorp') print 'Cross build: ', cross This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From johntconklin at users.sourceforge.net Wed Sep 30 07:17:01 2009 From: johntconklin at users.sourceforge.net (johntconklin at users.sourceforge.net) Date: Wed, 30 Sep 2009 14:17:01 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11559] trunk/xorp/SConstruct Message-ID: Revision: 11559 http://xorp.svn.sourceforge.net/xorp/?rev=11559&view=rev Author: johntconklin Date: 2009-09-30 14:17:01 +0000 (Wed, 30 Sep 2009) Log Message: ----------- Check boolean value of env['strip'] in InstallProgram and InstallLibrary functions instead of just checking whether the 'strip' key is present in the environment. Remove the second check whether the 'STRIP' key is present, as is now set unconditionally. Modified Paths: -------------- trunk/xorp/SConstruct Modified: trunk/xorp/SConstruct =================================================================== --- trunk/xorp/SConstruct 2009-09-29 13:49:42 UTC (rev 11558) +++ trunk/xorp/SConstruct 2009-09-30 14:17:01 UTC (rev 11559) @@ -153,7 +153,7 @@ obj = env.Install(dest, files) for i in obj: env.AddPostAction(i, env.Chmod(str(i), perm)) - if env.has_key('strip') and env.has_key('STRIP'): + if env['strip']: env.AddPostAction(i, Action("$STRIP $TARGET")) return obj SConsEnvironment.InstallProgram = InstallProgram @@ -175,7 +175,7 @@ obj = env.Install(dest, files) for i in obj: env.AddPostAction(i, env.Chmod(str(i), perm)) - if env.has_key('strip') and env.has_key('STRIP'): + if env['strip']: env.AddPostAction(i, Action("$STRIP --strip-unneeded $TARGET")) return obj SConsEnvironment.InstallLibrary = InstallLibrary This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Wed Sep 30 15:15:31 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Wed, 30 Sep 2009 22:15:31 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11560] trunk/xorp/contrib/olsr/external.cc Message-ID: Revision: 11560 http://xorp.svn.sourceforge.net/xorp/?rev=11560&view=rev Author: bms_fbsd Date: 2009-09-30 22:15:31 +0000 (Wed, 30 Sep 2009) Log Message: ----------- fix typo in trace message Modified Paths: -------------- trunk/xorp/contrib/olsr/external.cc Modified: trunk/xorp/contrib/olsr/external.cc =================================================================== --- trunk/xorp/contrib/olsr/external.cc 2009-09-30 14:17:01 UTC (rev 11559) +++ trunk/xorp/contrib/olsr/external.cc 2009-09-30 22:15:31 UTC (rev 11560) @@ -623,11 +623,11 @@ // 12.5, 1: Sender must be in symmetric 1-hop neighborhood. if (! _nh.is_sym_neighbor_addr(remote_addr)) { - debug_msg("Rejecting TC message from %s via non-neighbor %s\n", + debug_msg("Rejecting HNA message from %s via non-neighbor %s\n", cstring(msg->origin()), cstring(remote_addr)); XLOG_TRACE(_olsr.trace()._input_errors, - "Rejecting TC message from %s via non-neighbor %s", + "Rejecting HNA message from %s via non-neighbor %s", cstring(msg->origin()), cstring(remote_addr)); return true; // consumed but invalid. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bms_fbsd at users.sourceforge.net Wed Sep 30 16:40:53 2009 From: bms_fbsd at users.sourceforge.net (bms_fbsd at users.sourceforge.net) Date: Wed, 30 Sep 2009 23:40:53 +0000 Subject: [Xorp-cvs] SF.net SVN: xorp:[11561] trunk/xorp/contrib/olsr/external.cc Message-ID: Revision: 11561 http://xorp.svn.sourceforge.net/xorp/?rev=11561&view=rev Author: bms_fbsd Date: 2009-09-30 23:40:52 +0000 (Wed, 30 Sep 2009) Log Message: ----------- Actually increment iterator when processing multiple incoming HNA entries. jj is invalidated when erased, but we break right away on a match, so this is OK. Submitted by: Ben Greear Modified Paths: -------------- trunk/xorp/contrib/olsr/external.cc Modified: trunk/xorp/contrib/olsr/external.cc =================================================================== --- trunk/xorp/contrib/olsr/external.cc 2009-09-30 22:15:31 UTC (rev 11560) +++ trunk/xorp/contrib/olsr/external.cc 2009-09-30 23:40:52 UTC (rev 11561) @@ -242,9 +242,9 @@ ExternalDestInMap::iterator> rd = _routes_in_by_dest.equal_range(er->dest()); ExternalDestInMap::iterator jj; - for (jj = rd.first; jj != rd.second; ) { + for (jj = rd.first; jj != rd.second; jj++) { if ((*jj).second == erid) { - _routes_in_by_dest.erase(jj); + _routes_in_by_dest.erase(jj); // jj now invalidated; break. break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.