* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING. If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
return string_hash_make(if_rmap->ifname);
}
-static int if_rmap_hash_cmp(const void *arg1, const void *arg2)
+static bool if_rmap_hash_cmp(const void *arg1, const void *arg2)
{
const struct if_rmap *if_rmap1 = arg1;
const struct if_rmap *if_rmap2 = arg2;
else if (strncmp(argv[idx_in_out]->text, "out", 1) == 0)
type = IF_RMAP_OUT;
else {
- vty_out(vty, "route-map direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out(vty, "route-map direction must be [in|out]\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
if_rmap_set(argv[idx_ifname]->arg, type, argv[idx_rmap_name]->arg);
else if (strncmp(argv[idx_in_out]->arg, "o", 1) == 0)
type = IF_RMAP_OUT;
else {
- vty_out(vty, "route-map direction must be [in|out]%s",
- VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out(vty, "route-map direction must be [in|out]\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
ret = if_rmap_unset(argv[idx_ifname]->arg, type,
argv[idx_routemap_name]->arg);
if (!ret) {
- vty_out(vty, "route-map doesn't exist%s", VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out(vty, "route-map doesn't exist\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
return CMD_SUCCESS;
}
if_rmap = mp->data;
if (if_rmap->routemap[IF_RMAP_IN]) {
- vty_out(vty, " route-map %s in %s%s",
+ vty_out(vty, " route-map %s in %s\n",
if_rmap->routemap[IF_RMAP_IN],
- if_rmap->ifname, VTY_NEWLINE);
+ if_rmap->ifname);
write++;
}
if (if_rmap->routemap[IF_RMAP_OUT]) {
- vty_out(vty, " route-map %s out %s%s",
+ vty_out(vty, " route-map %s out %s\n",
if_rmap->routemap[IF_RMAP_OUT],
- if_rmap->ifname, VTY_NEWLINE);
+ if_rmap->ifname);
write++;
}
}
void if_rmap_init(int node)
{
- ifrmaphash = hash_create(if_rmap_hash_make, if_rmap_hash_cmp);
+ ifrmaphash = hash_create_size(4, if_rmap_hash_make, if_rmap_hash_cmp,
+ "Interface Route-Map Hash");
if (node == RIPNG_NODE) {
} else if (node == RIP_NODE) {
install_element(RIP_NODE, &if_rmap_cmd);