return CMD_SUCCESS;
}
-DEFPY (bgp_shutdown_msg,
- bgp_shutdown_msg_cmd,
- "bgp shutdown message MSG...",
- BGP_STR
- "Enable administrative shutdown of the BGP instance\n"
- "Add a shutdown message (RFC 8203)\n"
- "Shutdown message\n")
+DEFPY(bgp_shutdown_msg, bgp_shutdown_msg_cmd, "bgp shutdown message MSG...",
+ BGP_STR
+ "Enable administrative shutdown of the BGP instance\n"
+ "Add a shutdown message (RFC 8203)\n"
+ "Shutdown message\n")
{
- char* msgstr = NULL;
+ char *msgstr = NULL;
VTY_DECLVAR_CONTEXT(bgp, bgp);
return CMD_SUCCESS;
}
-DEFPY (bgp_shutdown, bgp_shutdown_cmd,
- "bgp shutdown",
- BGP_STR
- "Enable administrative shutdown of the BGP instance\n")
+DEFPY(bgp_shutdown, bgp_shutdown_cmd, "bgp shutdown",
+ BGP_STR "Enable administrative shutdown of the BGP instance\n")
{
VTY_DECLVAR_CONTEXT(bgp, bgp);
return CMD_SUCCESS;
}
-DEFPY (no_bgp_shutdown,
- no_bgp_shutdown_cmd,
- "no bgp shutdown",
- NO_STR
- BGP_STR
- "Disable administrative shutdown of the BGP instance\n")
+DEFPY(no_bgp_shutdown, no_bgp_shutdown_cmd, "no bgp shutdown",
+ NO_STR BGP_STR "Disable administrative shutdown of the BGP instance\n")
{
VTY_DECLVAR_CONTEXT(bgp, bgp);
"pfxSnt",
(PAF_SUBGRP(paf))->scount);
if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN)
- || CHECK_FLAG(peer->bgp->flags, BGP_FLAG_SHUTDOWN))
+ || CHECK_FLAG(peer->bgp->flags,
+ BGP_FLAG_SHUTDOWN))
json_object_string_add(json_peer, "state",
"Idle (Admin)");
else if (peer->afc_recv[afi][safi])
->scount);
}
} else {
- if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN)
- || CHECK_FLAG(peer->bgp->flags, BGP_FLAG_SHUTDOWN))
+ if (CHECK_FLAG(peer->flags,
+ PEER_FLAG_SHUTDOWN)
+ || CHECK_FLAG(peer->bgp->flags,
+ BGP_FLAG_SHUTDOWN))
vty_out(vty, " Idle (Admin)");
else if (CHECK_FLAG(
peer->sflags,
}
/* Enable global administrative shutdown of all peers of BGP instance */
-void bgp_shutdown_enable(struct bgp *bgp, char *msg)
+void bgp_shutdown_enable(struct bgp *bgp, const char *msg)
{
struct peer *peer;
struct listnode *node;
/* send a RFC 4486 notification message if necessary */
if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status)) {
if (msg)
- bgp_notify_send_with_data(peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN,
- (uint8_t *)(msg),
- strlen(msg));
+ bgp_notify_send_with_data(
+ peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN,
+ (uint8_t *)(msg), strlen(msg));
else
- bgp_notify_send(peer, BGP_NOTIFY_CEASE,
- BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN);
+ bgp_notify_send(
+ peer, BGP_NOTIFY_CEASE,
+ BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN);
}
/* reset start timer to initial value */
#define BGP_FLAG_SHOW_NEXTHOP_HOSTNAME (1 << 26)
/* This flag is set if the instance is in administrative shutdown */
-#define BGP_FLAG_SHUTDOWN (1 << 27)
+#define BGP_FLAG_SHUTDOWN (1 << 27)
enum global_mode GLOBAL_GR_FSM[BGP_GLOBAL_GR_MODE]
[BGP_GLOBAL_GR_EVENT_CMD];
extern struct peer_af *peer_af_find(struct peer *, afi_t, safi_t);
extern int peer_af_delete(struct peer *, afi_t, safi_t);
-extern void bgp_shutdown_enable(struct bgp *bgp, char *msg);
+extern void bgp_shutdown_enable(struct bgp *bgp, const char *msg);
extern void bgp_shutdown_disable(struct bgp *bgp);
extern void bgp_close(void);