]>
git.proxmox.com Git - mirror_frr.git/blob - lib/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
31 #include "lib/stream.h"
33 #define MLAG_MSG_NULL_PAYLOAD 0
34 #define MLAG_MSG_NO_BATCH 1
35 #define MLAG_BUF_LIMIT 2048
61 * This message definition should match mlag.proto
62 * Because message registration is based on this
68 MLAG_STATUS_UPDATE
= 3,
72 MLAG_MROUTE_ADD_BULK
= 7,
73 MLAG_MROUTE_DEL_BULK
= 8,
74 MLAG_PIM_CFG_DUMP
= 10,
75 MLAG_VXLAN_UPDATE
= 11,
76 MLAG_PEER_FRR_STATUS
= 12,
79 struct mlag_frr_status
{
80 enum mlag_frr_state frr_state
;
84 char peerlink_rif
[INTERFACE_NAMSIZ
];
85 enum mlag_role my_role
;
86 enum mlag_state peer_state
;
89 #define MLAG_ROLE_STRSIZE 16
96 struct mlag_mroute_add
{
97 char vrf_name
[VRF_NAMSIZ
];
101 enum mlag_owner owner_id
;
103 bool am_i_dual_active
;
105 char intf_name
[INTERFACE_NAMSIZ
];
108 struct mlag_mroute_del
{
109 char vrf_name
[VRF_NAMSIZ
];
112 enum mlag_owner owner_id
;
114 char intf_name
[INTERFACE_NAMSIZ
];
118 enum mlag_msg_type msg_type
;
122 } __attribute__((packed
));
125 extern char *mlag_role2str(enum mlag_role role
, char *buf
, size_t size
);
126 extern char *mlag_lib_msgid_to_str(enum mlag_msg_type msg_type
, char *buf
,
128 extern int mlag_lib_decode_mlag_hdr(struct stream
*s
, struct mlag_msg
*msg
,
130 extern int mlag_lib_decode_mroute_add(struct stream
*s
,
131 struct mlag_mroute_add
*msg
,
133 extern int mlag_lib_decode_mroute_del(struct stream
*s
,
134 struct mlag_mroute_del
*msg
,
136 extern int mlag_lib_decode_mlag_status(struct stream
*s
,
137 struct mlag_status
*msg
);
138 extern int mlag_lib_decode_vxlan_update(struct stream
*s
,
139 struct mlag_vxlan
*msg
);
140 extern int mlag_lib_decode_frr_status(struct stream
*s
,
141 struct mlag_frr_status
*msg
);