]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_mlag.h
2 * Copyright (C) 2018 Cumulus Networks, Inc.
5 * This file is part of FRR.
7 * FRR is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
12 * FRR is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with FRR; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __ZEBRA_MLAG_H__
23 #define __ZEBRA_MLAG_H__
27 #include "zebra/zserv.h"
29 #define ZEBRA_MLAG_BUF_LIMIT 2048
30 #define ZEBRA_MLAG_LEN_SIZE 4
32 extern uint8_t mlag_wr_buffer
[ZEBRA_MLAG_BUF_LIMIT
];
33 extern uint8_t mlag_rd_buffer
[ZEBRA_MLAG_BUF_LIMIT
];
34 extern uint32_t mlag_rd_buf_offset
;
36 static inline void zebra_mlag_reset_write_buffer(void)
38 memset(mlag_wr_buffer
, 0, ZEBRA_MLAG_BUF_LIMIT
);
41 static inline void zebra_mlag_reset_read_buffer(void)
43 memset(mlag_rd_buffer
, 0, ZEBRA_MLAG_BUF_LIMIT
);
44 mlag_rd_buf_offset
= 0;
47 enum zebra_mlag_state
{
52 void zebra_mlag_init(void);
53 void zebra_mlag_terminate(void);
54 enum mlag_role
zebra_mlag_get_role(void);
55 void zebra_mlag_client_register(ZAPI_HANDLER_ARGS
);
56 void zebra_mlag_client_unregister(ZAPI_HANDLER_ARGS
);
57 void zebra_mlag_forward_client_msg(ZAPI_HANDLER_ARGS
);
58 void zebra_mlag_send_register(void);
59 void zebra_mlag_send_deregister(void);
60 void zebra_mlag_handle_process_state(enum zebra_mlag_state state
);
61 void zebra_mlag_process_mlag_data(uint8_t *data
, uint32_t len
);
65 int zebra_mlag_protobuf_encode_client_data(struct stream
*s
,
67 int zebra_mlag_protobuf_decode_message(struct stream
**s
, uint8_t *data
,