diff options
Diffstat (limited to 'zebra/zebra_mlag.h')
| -rw-r--r-- | zebra/zebra_mlag.h | 49 |
1 files changed, 43 insertions, 6 deletions
diff --git a/zebra/zebra_mlag.h b/zebra/zebra_mlag.h index 90a5a41fa4..015c94bf5c 100644 --- a/zebra/zebra_mlag.h +++ b/zebra/zebra_mlag.h @@ -1,5 +1,5 @@ /* Zebra mlag header. - * Copyright (C) 2018 Cumulus Networks, Inc. + * Copyright (C) 2019 Cumulus Networks, Inc. * Donald Sharp * * This file is part of FRR. @@ -23,18 +23,55 @@ #define __ZEBRA_MLAG_H__ #include "mlag.h" +#include "zclient.h" +#include "zebra/zserv.h" -#ifdef __cplusplus -extern "C" { +#ifdef HAVE_PROTOBUF +#include "mlag/mlag.pb-c.h" #endif +#define ZEBRA_MLAG_BUF_LIMIT 2048 +#define ZEBRA_MLAG_LEN_SIZE 4 + +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_read_buffer(void) +{ + mlag_rd_buf_offset = 0; +} + +enum zebra_mlag_state { + MLAG_UP = 1, + MLAG_DOWN = 2, +}; + void zebra_mlag_init(void); void zebra_mlag_terminate(void); enum mlag_role zebra_mlag_get_role(void); -#ifdef __cplusplus -} -#endif +void zebra_mlag_client_register(ZAPI_HANDLER_ARGS); + +void zebra_mlag_client_unregister(ZAPI_HANDLER_ARGS); + +void zebra_mlag_forward_client_msg(ZAPI_HANDLER_ARGS); + +void zebra_mlag_send_register(void); + +void zebra_mlag_send_deregister(void); + +void zebra_mlag_handle_process_state(enum zebra_mlag_state state); + +void zebra_mlag_process_mlag_data(uint8_t *data, uint32_t len); + +/* + * ProtoBuffer Api's + */ +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, + uint32_t len); #endif |
