#include "vty.h"
#include "stream.h"
#include "zebra/zserv.h"
+#include "zebra/zapi_msg.h"
+#include "zebra/zebra_ptm.h"
#include "zebra/zebra_ptm_redistribute.h"
#include "zebra/zebra_memory.h"
if (!client->ifinfo)
return 0;
- s = client->obuf;
- stream_reset(s);
+ s = stream_new(ZEBRA_MAX_PACKET_SIZ);
- zserv_create_header(s, cmd, vrf_id);
+ zclient_create_header(s, cmd, vrf_id);
if (ifp)
stream_putl(s, ifp->ifindex);
else
stream_putw_at(s, 0, stream_get_endp(s));
client->if_bfd_cnt++;
- return zebra_server_send_message(client);
+ return zserv_send_message(client, s);
}
void zebra_interface_bfd_update(struct interface *ifp, struct prefix *dp,
struct zserv *client;
for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) {
- /* Supporting for OSPF, BGP and PIM */
- if (client->proto != ZEBRA_ROUTE_OSPF
- && client->proto != ZEBRA_ROUTE_BGP
- && client->proto != ZEBRA_ROUTE_OSPF6
- && client->proto != ZEBRA_ROUTE_PIM)
+ if (!IS_BFD_ENABLED_PROTOCOL(client->proto))
continue;
/* Notify to the protocol daemons. */
{
struct stream *s;
- s = client->obuf;
- stream_reset(s);
+ s = stream_new(ZEBRA_MAX_PACKET_SIZ);
- zserv_create_header(
- s, cmd, VRF_DEFAULT); // Pending: adjust when multi-vrf bfd work
+ zclient_create_header(s, cmd, VRF_DEFAULT);
/* Write packet size. */
stream_putw_at(s, 0, stream_get_endp(s));
client->bfd_peer_replay_cnt++;
- return zebra_server_send_message(client);
+ return zserv_send_message(client, s);
}
void zebra_bfd_peer_replay_req(void)
struct zserv *client;
for (ALL_LIST_ELEMENTS(zebrad.client_list, node, nnode, client)) {
- /* Supporting for BGP */
- if ((client->proto != ZEBRA_ROUTE_BGP)
- && (client->proto != ZEBRA_ROUTE_OSPF)
- && (client->proto != ZEBRA_ROUTE_OSPF6)
- && (client->proto != ZEBRA_ROUTE_PIM))
+ if (!IS_BFD_ENABLED_PROTOCOL(client->proto))
continue;
/* Notify to the protocol daemons. */