⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bgp_vty.c

📁 大名鼎鼎的路由器源码。程序分ZEBRA、OSPFRIP等3个包。程序框架采用一个路由协议一个进程的方式
💻 C
📖 第 1 页 / 共 5 页
字号:
    }  bgp_cluster_id_unset (bgp);  return CMD_SUCCESS;}ALIAS (no_bgp_cluster_id,       no_bgp_cluster_id_arg_cmd,       "no bgp cluster-id A.B.C.D",       NO_STR       BGP_STR       "Configure Route-Reflector Cluster-id\n"       "Route-Reflector Cluster-id in IP address format\n");DEFUN (bgp_confederation_identifier,       bgp_confederation_identifier_cmd,       "bgp confederation identifier <1-65535>",       "BGP specific commands\n"       "AS confederation parameters\n"       "AS number\n"       "Set routing domain confederation AS\n"){  struct bgp *bgp;  as_t as;  bgp = vty->index;  VTY_GET_INTEGER ("AS", as, argv[0]);  bgp_confederation_id_set (bgp, as);  return CMD_SUCCESS;}DEFUN (no_bgp_confederation_identifier,       no_bgp_confederation_identifier_cmd,       "no bgp confederation identifier",       NO_STR       "BGP specific commands\n"       "AS confederation parameters\n"       "AS number\n"){  struct bgp *bgp;  as_t as;  bgp = vty->index;  if (argc == 1)    VTY_GET_INTEGER ("AS", as, argv[0]);  bgp_confederation_id_unset (bgp);  return CMD_SUCCESS;}ALIAS (no_bgp_confederation_identifier,       no_bgp_confederation_identifier_arg_cmd,       "no bgp confederation identifier <1-65535>",       NO_STR       "BGP specific commands\n"       "AS confederation parameters\n"       "AS number\n"       "Set routing domain confederation AS\n");DEFUN (bgp_confederation_peers,       bgp_confederation_peers_cmd,       "bgp confederation peers .<1-65535>",       "BGP specific commands\n"       "AS confederation parameters\n"       "Peer ASs in BGP confederation\n"       AS_STR){  struct bgp *bgp;  as_t as;  int i;  bgp = vty->index;  for (i = 0; i < argc; i++)    {      VTY_GET_INTEGER_RANGE ("AS", as, argv[i], 1, 65535);      if (bgp->as == as)	{	  vty_out (vty, "%% Local member-AS not allowed in confed peer list%s",		   VTY_NEWLINE);	  continue;	}      bgp_confederation_peers_add (bgp, as);    }  return CMD_SUCCESS;}DEFUN (no_bgp_confederation_peers,       no_bgp_confederation_peers_cmd,       "no bgp confederation peers .<1-65535>",       NO_STR       "BGP specific commands\n"       "AS confederation parameters\n"       "Peer ASs in BGP confederation\n"       AS_STR){  struct bgp *bgp;  as_t as;  int i;  bgp = vty->index;  for (i = 0; i < argc; i++)    {      VTY_GET_INTEGER_RANGE ("AS", as, argv[i], 1, 65535);            bgp_confederation_peers_remove (bgp, as);    }  return CMD_SUCCESS;}/* BGP timers.  */DEFUN (bgp_timers,       bgp_timers_cmd,       "timers bgp <0-65535> <0-65535>",       "Adjust routing timers\n"       "BGP timers\n"       "Keepalive interval\n"       "Holdtime\n"){  struct bgp *bgp;  unsigned long keepalive = 0;  unsigned long holdtime = 0;  bgp = vty->index;  VTY_GET_INTEGER ("keepalive", keepalive, argv[0]);  VTY_GET_INTEGER ("holdtime", holdtime, argv[1]);  /* Holdtime value check. */  if (holdtime < 3 && holdtime != 0)    {      vty_out (vty, "%% hold time value must be either 0 or greater than 3%s",	       VTY_NEWLINE);      return CMD_WARNING;    }  bgp_timers_set (bgp, keepalive, holdtime);  return CMD_SUCCESS;}DEFUN (no_bgp_timers,       no_bgp_timers_cmd,       "no timers bgp",       NO_STR       "Adjust routing timers\n"       "BGP timers\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_timers_unset (bgp);  return CMD_SUCCESS;}ALIAS (no_bgp_timers,       no_bgp_timers_arg_cmd,       "no timers bgp <0-65535> <0-65535>",       NO_STR       "Adjust routing timers\n"       "BGP timers\n"       "Keepalive interval\n"       "Holdtime\n");DEFUN (bgp_client_to_client_reflection,       bgp_client_to_client_reflection_cmd,       "bgp client-to-client reflection",       "BGP specific commands\n"       "Configure client to client route reflection\n"       "reflection of routes allowed\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_unset (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT);  return CMD_SUCCESS;}DEFUN (no_bgp_client_to_client_reflection,       no_bgp_client_to_client_reflection_cmd,       "no bgp client-to-client reflection",       NO_STR       "BGP specific commands\n"       "Configure client to client route reflection\n"       "reflection of routes allowed\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_set (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT);  return CMD_SUCCESS;}/* "bgp always-compare-med" configuration. */DEFUN (bgp_always_compare_med,       bgp_always_compare_med_cmd,       "bgp always-compare-med",       "BGP specific commands\n"       "Allow comparing MED from different neighbors\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_set (bgp, BGP_FLAG_ALWAYS_COMPARE_MED);  return CMD_SUCCESS;}DEFUN (no_bgp_always_compare_med,       no_bgp_always_compare_med_cmd,       "no bgp always-compare-med",       NO_STR       "BGP specific commands\n"       "Allow comparing MED from different neighbors\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_unset (bgp, BGP_FLAG_ALWAYS_COMPARE_MED);  return CMD_SUCCESS;}/* "bgp deterministic-med" configuration. */DEFUN (bgp_deterministic_med,       bgp_deterministic_med_cmd,       "bgp deterministic-med",       "BGP specific commands\n"       "Pick the best-MED path among paths advertised from the neighboring AS\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_set (bgp, BGP_FLAG_DETERMINISTIC_MED);  return CMD_SUCCESS;}DEFUN (no_bgp_deterministic_med,       no_bgp_deterministic_med_cmd,       "no bgp deterministic-med",       NO_STR       "BGP specific commands\n"       "Pick the best-MED path among paths advertised from the neighboring AS\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_unset (bgp, BGP_FLAG_DETERMINISTIC_MED);  return CMD_SUCCESS;}/* "bgp fast-external-failover" configuration. */DEFUN (bgp_fast_external_failover,       bgp_fast_external_failover_cmd,       "bgp fast-external-failover",       BGP_STR       "Immediately reset session if a link to a directly connected external peer goes down\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_unset (bgp, BGP_FLAG_NO_FAST_EXT_FAILOVER);  return CMD_SUCCESS;}DEFUN (no_bgp_fast_external_failover,       no_bgp_fast_external_failover_cmd,       "no bgp fast-external-failover",       NO_STR       BGP_STR       "Immediately reset session if a link to a directly connected external peer goes down\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_set (bgp, BGP_FLAG_NO_FAST_EXT_FAILOVER);  return CMD_SUCCESS;}/* "bgp enforce-first-as" configuration. */DEFUN (bgp_enforce_first_as,       bgp_enforce_first_as_cmd,       "bgp enforce-first-as",       BGP_STR       "Enforce the first AS for EBGP routes\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_set (bgp, BGP_FLAG_ENFORCE_FIRST_AS);  return CMD_SUCCESS;}DEFUN (no_bgp_enforce_first_as,       no_bgp_enforce_first_as_cmd,       "no bgp enforce-first-as",       NO_STR       BGP_STR       "Enforce the first AS for EBGP routes\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_unset (bgp, BGP_FLAG_ENFORCE_FIRST_AS);  return CMD_SUCCESS;}/* "bgp bestpath compare-routerid" configuration.  */DEFUN (bgp_bestpath_compare_router_id,       bgp_bestpath_compare_router_id_cmd,       "bgp bestpath compare-routerid",       "BGP specific commands\n"       "Change the default bestpath selection\n"       "Compare router-id for identical EBGP paths\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_set (bgp, BGP_FLAG_COMPARE_ROUTER_ID);  return CMD_SUCCESS;}DEFUN (no_bgp_bestpath_compare_router_id,       no_bgp_bestpath_compare_router_id_cmd,       "no bgp bestpath compare-routerid",       NO_STR       "BGP specific commands\n"       "Change the default bestpath selection\n"       "Compare router-id for identical EBGP paths\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_unset (bgp, BGP_FLAG_COMPARE_ROUTER_ID);  return CMD_SUCCESS;}/* "bgp bestpath as-path ignore" configuration.  */DEFUN (bgp_bestpath_aspath_ignore,       bgp_bestpath_aspath_ignore_cmd,       "bgp bestpath as-path ignore",       "BGP specific commands\n"       "Change the default bestpath selection\n"       "AS-path attribute\n"       "Ignore as-path length in selecting a route\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_set (bgp, BGP_FLAG_ASPATH_IGNORE);  return CMD_SUCCESS;}DEFUN (no_bgp_bestpath_aspath_ignore,       no_bgp_bestpath_aspath_ignore_cmd,       "no bgp bestpath as-path ignore",       NO_STR       "BGP specific commands\n"       "Change the default bestpath selection\n"       "AS-path attribute\n"       "Ignore as-path length in selecting a route\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_unset (bgp, BGP_FLAG_ASPATH_IGNORE);  return CMD_SUCCESS;}/* "bgp log-neighbor-changes" configuration.  */DEFUN (bgp_log_neighbor_changes,       bgp_log_neighbor_changes_cmd,       "bgp log-neighbor-changes",       "BGP specific commands\n"       "Log neighbor up/down and reset reason\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_set (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES);  return CMD_SUCCESS;}DEFUN (no_bgp_log_neighbor_changes,       no_bgp_log_neighbor_changes_cmd,       "no bgp log-neighbor-changes",       NO_STR       "BGP specific commands\n"       "Log neighbor up/down and reset reason\n"){  struct bgp *bgp;  bgp = vty->index;  bgp_flag_unset (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES);  return CMD_SUCCESS;}/* "bgp bestpath med" configuration. */DEFUN (bgp_bestpath_med,       bgp_bestpath_med_cmd,       "bgp bestpath med (confed|missing-as-worst)",       "BGP specific commands\n"       "Change the default bestpath selection\n"       "MED attribute\n"       "Compare MED among confederation paths\n"       "Treat missing MED as the least preferred one\n"){  struct bgp *bgp;    bgp = vty->index;  if (strncmp (argv[0], "confed", 1) == 0)    bgp_flag_set (bgp, BGP_FLAG_MED_CONFED);  else    bgp_flag_set (bgp, BGP_FLAG_MED_MISSING_AS_WORST);  return CMD_SUCCESS;}DEFUN (bgp_bestpath_med2,       bgp_bestpath_med2_cmd,       "bgp bestpath med confed missing-as-worst",       "BGP specific commands\n"       "Change the default bestpath selection\n"       "MED attribute\n"       "Compare MED among confederation paths\n"       "Treat missing MED as the least preferred one\n"){  struct bgp *bgp;    bgp = vty->index;  bgp_flag_set (bgp, BGP_FLAG_MED_CONFED);  bgp_flag_set (bgp, BGP_FLAG_MED_MISSING_AS_WORST);  return CMD_SUCCESS;}ALIAS (bgp_bestpath_med2,       bgp_bestpath_med3_cmd,       "bgp bestpath med missing-as-worst confed",       "BGP specific commands\n"       "Change the default bestpath selection\n"       "MED attribute\n"       "Treat missing MED as the least preferred one\n"       "Compare MED among confederation paths\n");DEFUN (no_bgp_bestpath_med,       no_bgp_bestpath_med_cmd,       "no bgp bestpath med (confed|missing-as-worst)",       NO_STR       "BGP specific commands\n"       "Change the default bestpath selection\n"       "MED attribute\n"       "Compare MED among confederation paths\n"       "Treat missing MED as the least preferred one\n"){  struct bgp *bgp;  bgp = vty->index;    if (strncmp (argv[0], "confed", 1) == 0)    bgp_flag_unset (bgp, BGP_FLAG_MED_CONFED);  else    bgp_flag_unset (bgp, BGP_FLAG_MED_MISSING_AS_WORST);  return CMD_SUCCESS;}DEFUN (no_bgp_bestpath_med2,       no_bgp_bestpath_med2_cmd,       "no bgp bestpath med confed missing-as-worst",       NO_STR       "BGP specific commands\n"       "Change the default bestpath selection\n"       "MED attribute\n"       "Compare MED among confederation paths\n"       "Treat missing MED as the least preferred one\n"){  struct bgp *bgp;    bgp = vty->index;  bgp_flag_unset (bgp, BGP_FLAG_MED_CONFED);  bgp_flag_unset (bgp, BGP_FLAG_MED_MISSING_AS_WORST);  return CMD_SUCCESS;}ALIAS (no_bgp_bestpath_med2,       no_bgp_bestpath_med3_cmd,       "no bgp bestpath med missing-as-worst confed",       NO_STR       "BGP specific commands\n"       "Change the default bestpath selection\n"       "MED attribute\n"       "Treat missing MED as the least preferred one\n"       "Compare MED among confederation paths\n");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -