}
void
-bfd_show_sessions(struct proto *P, int details)
+bfd_show_sessions(struct proto *P, int details, net_addr addr)
{
byte tbuf[TM_DATETIME_BUFFER_SIZE];
struct bfd_proto *p = (struct bfd_proto *) P;
HASH_WALK(p->session_hash_id, next_id, s)
{
/* FIXME: this is thread-unsafe, but perhaps harmless */
+
+ if (addr.type != 0 && !ipa_in_netX(s->addr, &addr))
+ continue;
if (!details)
{
state = s->loc_state;
struct bfd_session * bfd_find_session_by_id(struct bfd_proto *p, u32 id);
struct bfd_session * bfd_find_session_by_addr(struct bfd_proto *p, ip_addr addr, uint ifindex);
void bfd_session_process_ctl(struct bfd_session *s, u8 flags, u32 old_tx_int, u32 old_rx_int);
-void bfd_show_sessions(struct proto *P, int details);
+void bfd_show_sessions(struct proto *P, int details, net_addr addr);
/* packets.c */
void bfd_send_ctl(struct bfd_proto *p, struct bfd_session *s, int final);
%type <iface> bfd_neigh_iface
%type <a> bfd_neigh_local
%type <i> bfd_neigh_multihop bfd_auth_type
+%type <net> opt_addr
CF_GRAMMAR
cf_error("Multihop neighbor requires specified local address");
};
+opt_addr:
+ /* empty */ {
+ net_addr addr;
+ addr.type = 0;
+ $$ = addr; }
+ | net_ip4_
+ | net_ip6_
+ | IP4 { net_fill_ip4(&($$), $1, IP4_MAX_PREFIX_LENGTH); }
+ | IP6 { net_fill_ip6(&($$), $1, IP6_MAX_PREFIX_LENGTH); }
+
+
CF_CLI_HELP(SHOW BFD, ..., [[Show information about BFD protocol]]);
-CF_CLI(SHOW BFD SESSIONS, optproto, [<name>], [[Show information about BFD sessions]])
-{ PROTO_WALK_CMD($4, &proto_bfd, p) bfd_show_sessions(p, 0); };
+CF_CLI(SHOW BFD SESSIONS, optproto opt_addr, [<name>] [<addr>], [[Show information about BFD sessions]])
+{ PROTO_WALK_CMD($4, &proto_bfd, p) bfd_show_sessions(p, 0, $5); };
-CF_CLI(SHOW BFD SESSIONS ALL, optproto, [<name>], [[Show information about BFD sessions]])
-{ PROTO_WALK_CMD($5, &proto_bfd, p) bfd_show_sessions(p, 1); };
+CF_CLI(SHOW BFD SESSIONS ALL, optproto opt_addr, [<name>] [<addr>], [[Show information about BFD sessions]])
+{ PROTO_WALK_CMD($5, &proto_bfd, p) bfd_show_sessions(p, 1, $6); };
CF_CODE