diff options
author | Satheesh Kumar K <sathk@cumulusnetworks.com> | 2019-11-12 10:41:04 +0100 |
---|---|---|
committer | Satheesh Kumar K <sathk@cumulusnetworks.com> | 2019-11-14 07:47:32 +0100 |
commit | 67fa73f29a2a059fb01d8fc7009161f21e1b05da (patch) | |
tree | c2fb737745e0b7e487160e2e3a510866a5e33a28 /zebra/zebra_mlag.h | |
parent | lib,mlag : Defining MLAG Proto file (diff) | |
download | frr-67fa73f29a2a059fb01d8fc7009161f21e1b05da.tar.xz frr-67fa73f29a2a059fb01d8fc7009161f21e1b05da.zip |
Zebra: ADD Protobuf Encoding & Decoding for MLAG Messages
1. add the Mlag ProtoBuf Lib to Zebra Compilation
2. Encode the messages with protobuf before writing to MLAG
3. Decode the MLAG Messages using protobuf and write to clients
based on their subscrption.
Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_mlag.h')
-rw-r--r-- | zebra/zebra_mlag.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/zebra/zebra_mlag.h b/zebra/zebra_mlag.h index 6506089af..6f7ef8319 100644 --- a/zebra/zebra_mlag.h +++ b/zebra/zebra_mlag.h @@ -26,6 +26,10 @@ #include "zclient.h" #include "zebra/zserv.h" +#ifdef HAVE_PROTOBUF +#include "mlag/mlag.pb-c.h" +#endif + #define ZEBRA_MLAG_BUF_LIMIT 2048 #define ZEBRA_MLAG_LEN_SIZE 4 @@ -33,14 +37,8 @@ extern uint8_t mlag_wr_buffer[ZEBRA_MLAG_BUF_LIMIT]; extern uint8_t mlag_rd_buffer[ZEBRA_MLAG_BUF_LIMIT]; extern uint32_t mlag_rd_buf_offset; -static inline void zebra_mlag_reset_write_buffer(void) -{ - memset(mlag_wr_buffer, 0, ZEBRA_MLAG_BUF_LIMIT); -} - static inline void zebra_mlag_reset_read_buffer(void) { - memset(mlag_rd_buffer, 0, ZEBRA_MLAG_BUF_LIMIT); mlag_rd_buf_offset = 0; } @@ -64,6 +62,6 @@ void zebra_mlag_process_mlag_data(uint8_t *data, uint32_t len); */ int zebra_mlag_protobuf_encode_client_data(struct stream *s, uint32_t *msg_type); -int zebra_mlag_protobuf_decode_message(struct stream **s, uint8_t *data, +int zebra_mlag_protobuf_decode_message(struct stream *s, uint8_t *data, uint32_t len); #endif |