zebra_routemap.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. /* zebra routemap.
  2. * Copyright (C) 2006 IBM Corporation
  3. *
  4. * This file is part of GNU Zebra.
  5. *
  6. * GNU Zebra is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2, or (at your option) any
  9. * later version.
  10. *
  11. * GNU Zebra is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GNU Zebra; see the file COPYING. If not, write to the Free
  18. * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  19. * 02111-1307, USA.
  20. */
  21. #include <zebra.h>
  22. #include "memory.h"
  23. #include "prefix.h"
  24. #include "rib.h"
  25. #include "routemap.h"
  26. #include "command.h"
  27. #include "filter.h"
  28. #include "plist.h"
  29. #include "vrf.h"
  30. #include "zebra/zserv.h"
  31. /* Add zebra route map rule */
  32. static int
  33. zebra_route_match_add(struct vty *vty, struct route_map_index *index,
  34. const char *command, const char *arg)
  35. {
  36. int ret;
  37. ret = route_map_add_match (index, command, arg);
  38. if (ret)
  39. {
  40. switch (ret)
  41. {
  42. case RMAP_RULE_MISSING:
  43. vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
  44. return CMD_WARNING;
  45. case RMAP_COMPILE_ERROR:
  46. vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
  47. return CMD_WARNING;
  48. }
  49. }
  50. return CMD_SUCCESS;
  51. }
  52. /* Delete zebra route map rule. */
  53. static int
  54. zebra_route_match_delete (struct vty *vty, struct route_map_index *index,
  55. const char *command, const char *arg)
  56. {
  57. int ret;
  58. ret = route_map_delete_match (index, command, arg);
  59. if (ret)
  60. {
  61. switch (ret)
  62. {
  63. case RMAP_RULE_MISSING:
  64. vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
  65. return CMD_WARNING;
  66. case RMAP_COMPILE_ERROR:
  67. vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
  68. return CMD_WARNING;
  69. }
  70. }
  71. return CMD_SUCCESS;
  72. }
  73. /* Add zebra route map rule. */
  74. static int
  75. zebra_route_set_add (struct vty *vty, struct route_map_index *index,
  76. const char *command, const char *arg)
  77. {
  78. int ret;
  79. ret = route_map_add_set (index, command, arg);
  80. if (ret)
  81. {
  82. switch (ret)
  83. {
  84. case RMAP_RULE_MISSING:
  85. vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
  86. return CMD_WARNING;
  87. case RMAP_COMPILE_ERROR:
  88. vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
  89. return CMD_WARNING;
  90. }
  91. }
  92. return CMD_SUCCESS;
  93. }
  94. /* Delete zebra route map rule. */
  95. static int
  96. zebra_route_set_delete (struct vty *vty, struct route_map_index *index,
  97. const char *command, const char *arg)
  98. {
  99. int ret;
  100. ret = route_map_delete_set (index, command, arg);
  101. if (ret)
  102. {
  103. switch (ret)
  104. {
  105. case RMAP_RULE_MISSING:
  106. vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE);
  107. return CMD_WARNING;
  108. case RMAP_COMPILE_ERROR:
  109. vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE);
  110. return CMD_WARNING;
  111. }
  112. }
  113. return CMD_SUCCESS;
  114. }
  115. /* `match interface IFNAME' */
  116. /* Match function return 1 if match is success else return zero. */
  117. static route_map_result_t
  118. route_match_interface (void *rule, struct prefix *prefix,
  119. route_map_object_t type, void *object)
  120. {
  121. struct nexthop_vrfid *nh_vrf;
  122. struct nexthop *nexthop;
  123. char *ifname = rule;
  124. ifindex_t ifindex;
  125. if (type == RMAP_ZEBRA)
  126. {
  127. if (strcasecmp(ifname, "any") == 0)
  128. return RMAP_MATCH;
  129. nh_vrf = object;
  130. if (!nh_vrf)
  131. return RMAP_NOMATCH;
  132. ifindex = ifname2ifindex_vrf (ifname, nh_vrf->vrf_id);
  133. if (ifindex == 0)
  134. return RMAP_NOMATCH;
  135. nexthop = nh_vrf->nexthop;
  136. if (!nexthop)
  137. return RMAP_NOMATCH;
  138. if (nexthop->ifindex == ifindex)
  139. return RMAP_MATCH;
  140. }
  141. return RMAP_NOMATCH;
  142. }
  143. /* Route map `match interface' match statement. `arg' is IFNAME value */
  144. static void *
  145. route_match_interface_compile (const char *arg)
  146. {
  147. return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
  148. }
  149. /* Free route map's compiled `match interface' value. */
  150. static void
  151. route_match_interface_free (void *rule)
  152. {
  153. XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
  154. }
  155. /* Route map commands for interface matching */
  156. struct route_map_rule_cmd route_match_interface_cmd =
  157. {
  158. "interface",
  159. route_match_interface,
  160. route_match_interface_compile,
  161. route_match_interface_free
  162. };
  163. DEFUN (match_interface,
  164. match_interface_cmd,
  165. "match interface WORD",
  166. MATCH_STR
  167. "match first hop interface of route\n"
  168. "Interface name\n")
  169. {
  170. return zebra_route_match_add (vty, vty->index, "interface", argv[0]);
  171. }
  172. DEFUN (no_match_interface,
  173. no_match_interface_cmd,
  174. "no match interface",
  175. NO_STR
  176. MATCH_STR
  177. "Match first hop interface of route\n")
  178. {
  179. if (argc == 0)
  180. return zebra_route_match_delete (vty, vty->index, "interface", NULL);
  181. return zebra_route_match_delete (vty, vty->index, "interface", argv[0]);
  182. }
  183. ALIAS (no_match_interface,
  184. no_match_interface_val_cmd,
  185. "no match interface WORD",
  186. NO_STR
  187. MATCH_STR
  188. "Match first hop interface of route\n"
  189. "Interface name\n")
  190. DEFUN (match_ip_next_hop,
  191. match_ip_next_hop_cmd,
  192. "match ip next-hop (<1-199>|<1300-2699>|WORD)",
  193. MATCH_STR
  194. IP_STR
  195. "Match next-hop address of route\n"
  196. "IP access-list number\n"
  197. "IP access-list number (expanded range)\n"
  198. "IP Access-list name\n")
  199. {
  200. return zebra_route_match_add (vty, vty->index, "ip next-hop", argv[0]);
  201. }
  202. DEFUN (no_match_ip_next_hop,
  203. no_match_ip_next_hop_cmd,
  204. "no match ip next-hop",
  205. NO_STR
  206. MATCH_STR
  207. IP_STR
  208. "Match next-hop address of route\n")
  209. {
  210. if (argc == 0)
  211. return zebra_route_match_delete (vty, vty->index, "ip next-hop", NULL);
  212. return zebra_route_match_delete (vty, vty->index, "ip next-hop", argv[0]);
  213. }
  214. ALIAS (no_match_ip_next_hop,
  215. no_match_ip_next_hop_val_cmd,
  216. "no match ip next-hop (<1-199>|<1300-2699>|WORD)",
  217. NO_STR
  218. MATCH_STR
  219. IP_STR
  220. "Match next-hop address of route\n"
  221. "IP access-list number\n"
  222. "IP access-list number (expanded range)\n"
  223. "IP Access-list name\n")
  224. DEFUN (match_ip_next_hop_prefix_list,
  225. match_ip_next_hop_prefix_list_cmd,
  226. "match ip next-hop prefix-list WORD",
  227. MATCH_STR
  228. IP_STR
  229. "Match next-hop address of route\n"
  230. "Match entries of prefix-lists\n"
  231. "IP prefix-list name\n")
  232. {
  233. return zebra_route_match_add (vty, vty->index, "ip next-hop prefix-list", argv[0]);
  234. }
  235. DEFUN (no_match_ip_next_hop_prefix_list,
  236. no_match_ip_next_hop_prefix_list_cmd,
  237. "no match ip next-hop prefix-list",
  238. NO_STR
  239. MATCH_STR
  240. IP_STR
  241. "Match next-hop address of route\n"
  242. "Match entries of prefix-lists\n")
  243. {
  244. if (argc == 0)
  245. return zebra_route_match_delete (vty, vty->index, "ip next-hop prefix-list", NULL);
  246. return zebra_route_match_delete (vty, vty->index, "ip next-hop prefix-list", argv[0]);
  247. }
  248. ALIAS (no_match_ip_next_hop_prefix_list,
  249. no_match_ip_next_hop_prefix_list_val_cmd,
  250. "no match ip next-hop prefix-list WORD",
  251. NO_STR
  252. MATCH_STR
  253. IP_STR
  254. "Match next-hop address of route\n"
  255. "Match entries of prefix-lists\n"
  256. "IP prefix-list name\n")
  257. DEFUN (match_ip_address,
  258. match_ip_address_cmd,
  259. "match ip address (<1-199>|<1300-2699>|WORD)",
  260. MATCH_STR
  261. IP_STR
  262. "Match address of route\n"
  263. "IP access-list number\n"
  264. "IP access-list number (expanded range)\n"
  265. "IP Access-list name\n")
  266. {
  267. return zebra_route_match_add (vty, vty->index, "ip address", argv[0]);
  268. }
  269. DEFUN (no_match_ip_address,
  270. no_match_ip_address_cmd,
  271. "no match ip address",
  272. NO_STR
  273. MATCH_STR
  274. IP_STR
  275. "Match address of route\n")
  276. {
  277. if (argc == 0)
  278. return zebra_route_match_delete (vty, vty->index, "ip address", NULL);
  279. return zebra_route_match_delete (vty, vty->index, "ip address", argv[0]);
  280. }
  281. ALIAS (no_match_ip_address,
  282. no_match_ip_address_val_cmd,
  283. "no match ip address (<1-199>|<1300-2699>|WORD)",
  284. NO_STR
  285. MATCH_STR
  286. IP_STR
  287. "Match address of route\n"
  288. "IP access-list number\n"
  289. "IP access-list number (expanded range)\n"
  290. "IP Access-list name\n")
  291. DEFUN (match_ip_address_prefix_list,
  292. match_ip_address_prefix_list_cmd,
  293. "match ip address prefix-list WORD",
  294. MATCH_STR
  295. IP_STR
  296. "Match address of route\n"
  297. "Match entries of prefix-lists\n"
  298. "IP prefix-list name\n")
  299. {
  300. return zebra_route_match_add (vty, vty->index, "ip address prefix-list", argv[0]);
  301. }
  302. DEFUN (no_match_ip_address_prefix_list,
  303. no_match_ip_address_prefix_list_cmd,
  304. "no match ip address prefix-list",
  305. NO_STR
  306. MATCH_STR
  307. IP_STR
  308. "Match address of route\n"
  309. "Match entries of prefix-lists\n")
  310. {
  311. if (argc == 0)
  312. return zebra_route_match_delete (vty, vty->index, "ip address prefix-list", NULL);
  313. return zebra_route_match_delete (vty, vty->index, "ip address prefix-list", argv[0]);
  314. }
  315. ALIAS (no_match_ip_address_prefix_list,
  316. no_match_ip_address_prefix_list_val_cmd,
  317. "no match ip address prefix-list WORD",
  318. NO_STR
  319. MATCH_STR
  320. IP_STR
  321. "Match address of route\n"
  322. "Match entries of prefix-lists\n"
  323. "IP prefix-list name\n")
  324. /* set functions */
  325. DEFUN (set_src,
  326. set_src_cmd,
  327. "set src A.B.C.D",
  328. SET_STR
  329. "src address for route\n"
  330. "src address\n")
  331. {
  332. struct in_addr src;
  333. struct interface *pif = NULL;
  334. vrf_iter_t iter;
  335. if (inet_pton(AF_INET, argv[0], &src) <= 0)
  336. {
  337. vty_out (vty, "%% not a local address%s", VTY_NEWLINE);
  338. return CMD_WARNING;
  339. }
  340. for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
  341. if ((pif = if_lookup_exact_address_vrf (src, vrf_iter2id (iter))) != NULL)
  342. break;
  343. if (!pif)
  344. {
  345. vty_out (vty, "%% not a local address%s", VTY_NEWLINE);
  346. return CMD_WARNING;
  347. }
  348. return zebra_route_set_add (vty, vty->index, "src", argv[0]);
  349. }
  350. DEFUN (no_set_src,
  351. no_set_src_cmd,
  352. "no set src",
  353. NO_STR
  354. SET_STR
  355. "Source address for route\n")
  356. {
  357. if (argc == 0)
  358. return zebra_route_set_delete (vty, vty->index, "src", NULL);
  359. return zebra_route_set_delete (vty, vty->index, "src", argv[0]);
  360. }
  361. ALIAS (no_set_src,
  362. no_set_src_val_cmd,
  363. "no set src (A.B.C.D)",
  364. NO_STR
  365. SET_STR
  366. "src address for route\n"
  367. "src address\n")
  368. /*XXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
  369. /* `match ip next-hop IP_ACCESS_LIST' */
  370. /* Match function return 1 if match is success else return zero. */
  371. static route_map_result_t
  372. route_match_ip_next_hop (void *rule, struct prefix *prefix,
  373. route_map_object_t type, void *object)
  374. {
  375. struct access_list *alist;
  376. struct nexthop *nexthop;
  377. struct prefix_ipv4 p;
  378. if (type == RMAP_ZEBRA)
  379. {
  380. nexthop = object;
  381. switch (nexthop->type) {
  382. case NEXTHOP_TYPE_IFINDEX:
  383. case NEXTHOP_TYPE_IFNAME:
  384. /* Interface routes can't match ip next-hop */
  385. return RMAP_NOMATCH;
  386. case NEXTHOP_TYPE_IPV4_IFINDEX:
  387. case NEXTHOP_TYPE_IPV4_IFNAME:
  388. case NEXTHOP_TYPE_IPV4:
  389. p.family = AF_INET;
  390. p.prefix = nexthop->gate.ipv4;
  391. p.prefixlen = IPV4_MAX_BITLEN;
  392. break;
  393. default:
  394. return RMAP_NOMATCH;
  395. }
  396. alist = access_list_lookup (AFI_IP, (char *) rule);
  397. if (alist == NULL)
  398. return RMAP_NOMATCH;
  399. return (access_list_apply (alist, &p) == FILTER_DENY ?
  400. RMAP_NOMATCH : RMAP_MATCH);
  401. }
  402. return RMAP_NOMATCH;
  403. }
  404. /* Route map `ip next-hop' match statement. `arg' should be
  405. access-list name. */
  406. static void *
  407. route_match_ip_next_hop_compile (const char *arg)
  408. {
  409. return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
  410. }
  411. /* Free route map's compiled `. */
  412. static void
  413. route_match_ip_next_hop_free (void *rule)
  414. {
  415. XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
  416. }
  417. /* Route map commands for ip next-hop matching. */
  418. static struct route_map_rule_cmd route_match_ip_next_hop_cmd =
  419. {
  420. "ip next-hop",
  421. route_match_ip_next_hop,
  422. route_match_ip_next_hop_compile,
  423. route_match_ip_next_hop_free
  424. };
  425. /* `match ip next-hop prefix-list PREFIX_LIST' */
  426. static route_map_result_t
  427. route_match_ip_next_hop_prefix_list (void *rule, struct prefix *prefix,
  428. route_map_object_t type, void *object)
  429. {
  430. struct prefix_list *plist;
  431. struct nexthop *nexthop;
  432. struct prefix_ipv4 p;
  433. if (type == RMAP_ZEBRA)
  434. {
  435. nexthop = object;
  436. switch (nexthop->type) {
  437. case NEXTHOP_TYPE_IFINDEX:
  438. case NEXTHOP_TYPE_IFNAME:
  439. /* Interface routes can't match ip next-hop */
  440. return RMAP_NOMATCH;
  441. case NEXTHOP_TYPE_IPV4_IFINDEX:
  442. case NEXTHOP_TYPE_IPV4_IFNAME:
  443. case NEXTHOP_TYPE_IPV4:
  444. p.family = AF_INET;
  445. p.prefix = nexthop->gate.ipv4;
  446. p.prefixlen = IPV4_MAX_BITLEN;
  447. break;
  448. default:
  449. return RMAP_NOMATCH;
  450. }
  451. plist = prefix_list_lookup (AFI_IP, (char *) rule);
  452. if (plist == NULL)
  453. return RMAP_NOMATCH;
  454. return (prefix_list_apply (plist, &p) == PREFIX_DENY ?
  455. RMAP_NOMATCH : RMAP_MATCH);
  456. }
  457. return RMAP_NOMATCH;
  458. }
  459. static void *
  460. route_match_ip_next_hop_prefix_list_compile (const char *arg)
  461. {
  462. return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
  463. }
  464. static void
  465. route_match_ip_next_hop_prefix_list_free (void *rule)
  466. {
  467. XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
  468. }
  469. static struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd =
  470. {
  471. "ip next-hop prefix-list",
  472. route_match_ip_next_hop_prefix_list,
  473. route_match_ip_next_hop_prefix_list_compile,
  474. route_match_ip_next_hop_prefix_list_free
  475. };
  476. /* `match ip address IP_ACCESS_LIST' */
  477. /* Match function should return 1 if match is success else return
  478. zero. */
  479. static route_map_result_t
  480. route_match_ip_address (void *rule, struct prefix *prefix,
  481. route_map_object_t type, void *object)
  482. {
  483. struct access_list *alist;
  484. if (type == RMAP_ZEBRA)
  485. {
  486. alist = access_list_lookup (AFI_IP, (char *) rule);
  487. if (alist == NULL)
  488. return RMAP_NOMATCH;
  489. return (access_list_apply (alist, prefix) == FILTER_DENY ?
  490. RMAP_NOMATCH : RMAP_MATCH);
  491. }
  492. return RMAP_NOMATCH;
  493. }
  494. /* Route map `ip address' match statement. `arg' should be
  495. access-list name. */
  496. static void *
  497. route_match_ip_address_compile (const char *arg)
  498. {
  499. return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
  500. }
  501. /* Free route map's compiled `ip address' value. */
  502. static void
  503. route_match_ip_address_free (void *rule)
  504. {
  505. XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
  506. }
  507. /* Route map commands for ip address matching. */
  508. static struct route_map_rule_cmd route_match_ip_address_cmd =
  509. {
  510. "ip address",
  511. route_match_ip_address,
  512. route_match_ip_address_compile,
  513. route_match_ip_address_free
  514. };
  515. /* `match ip address prefix-list PREFIX_LIST' */
  516. static route_map_result_t
  517. route_match_ip_address_prefix_list (void *rule, struct prefix *prefix,
  518. route_map_object_t type, void *object)
  519. {
  520. struct prefix_list *plist;
  521. if (type == RMAP_ZEBRA)
  522. {
  523. plist = prefix_list_lookup (AFI_IP, (char *) rule);
  524. if (plist == NULL)
  525. return RMAP_NOMATCH;
  526. return (prefix_list_apply (plist, prefix) == PREFIX_DENY ?
  527. RMAP_NOMATCH : RMAP_MATCH);
  528. }
  529. return RMAP_NOMATCH;
  530. }
  531. static void *
  532. route_match_ip_address_prefix_list_compile (const char *arg)
  533. {
  534. return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
  535. }
  536. static void
  537. route_match_ip_address_prefix_list_free (void *rule)
  538. {
  539. XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
  540. }
  541. static struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd =
  542. {
  543. "ip address prefix-list",
  544. route_match_ip_address_prefix_list,
  545. route_match_ip_address_prefix_list_compile,
  546. route_match_ip_address_prefix_list_free
  547. };
  548. /* `set src A.B.C.D' */
  549. /* Set src. */
  550. static route_map_result_t
  551. route_set_src (void *rule, struct prefix *prefix,
  552. route_map_object_t type, void *object)
  553. {
  554. if (type == RMAP_ZEBRA)
  555. {
  556. struct nexthop *nexthop;
  557. nexthop = object;
  558. nexthop->src = *(union g_addr *)rule;
  559. }
  560. return RMAP_OKAY;
  561. }
  562. /* set src compilation. */
  563. static void *
  564. route_set_src_compile (const char *arg)
  565. {
  566. union g_addr src, *psrc;
  567. if (inet_pton(AF_INET, arg, &src.ipv4) != 1
  568. #ifdef HAVE_IPV6
  569. && inet_pton(AF_INET6, arg, &src.ipv6) != 1
  570. #endif /* HAVE_IPV6 */
  571. )
  572. return NULL;
  573. psrc = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (union g_addr));
  574. *psrc = src;
  575. return psrc;
  576. }
  577. /* Free route map's compiled `set src' value. */
  578. static void
  579. route_set_src_free (void *rule)
  580. {
  581. XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
  582. }
  583. /* Set src rule structure. */
  584. static struct route_map_rule_cmd route_set_src_cmd =
  585. {
  586. "src",
  587. route_set_src,
  588. route_set_src_compile,
  589. route_set_src_free,
  590. };
  591. void
  592. zebra_route_map_init ()
  593. {
  594. route_map_init ();
  595. route_map_init_vty ();
  596. route_map_install_match (&route_match_interface_cmd);
  597. route_map_install_match (&route_match_ip_next_hop_cmd);
  598. route_map_install_match (&route_match_ip_next_hop_prefix_list_cmd);
  599. route_map_install_match (&route_match_ip_address_cmd);
  600. route_map_install_match (&route_match_ip_address_prefix_list_cmd);
  601. /* */
  602. route_map_install_set (&route_set_src_cmd);
  603. /* */
  604. install_element (RMAP_NODE, &match_interface_cmd);
  605. install_element (RMAP_NODE, &no_match_interface_cmd);
  606. install_element (RMAP_NODE, &no_match_interface_val_cmd);
  607. install_element (RMAP_NODE, &match_ip_next_hop_cmd);
  608. install_element (RMAP_NODE, &no_match_ip_next_hop_cmd);
  609. install_element (RMAP_NODE, &no_match_ip_next_hop_val_cmd);
  610. install_element (RMAP_NODE, &match_ip_next_hop_prefix_list_cmd);
  611. install_element (RMAP_NODE, &no_match_ip_next_hop_prefix_list_cmd);
  612. install_element (RMAP_NODE, &no_match_ip_next_hop_prefix_list_val_cmd);
  613. install_element (RMAP_NODE, &match_ip_address_cmd);
  614. install_element (RMAP_NODE, &no_match_ip_address_cmd);
  615. install_element (RMAP_NODE, &no_match_ip_address_val_cmd);
  616. install_element (RMAP_NODE, &match_ip_address_prefix_list_cmd);
  617. install_element (RMAP_NODE, &no_match_ip_address_prefix_list_cmd);
  618. install_element (RMAP_NODE, &no_match_ip_address_prefix_list_val_cmd);
  619. /* */
  620. install_element (RMAP_NODE, &set_src_cmd);
  621. install_element (RMAP_NODE, &no_set_src_cmd);
  622. }