]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zebra_fpm_private.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / zebra / zebra_fpm_private.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
5adc2528
AS
2/*
3 * Private header file for the zebra FPM module.
4 *
5 * Copyright (C) 2012 by Open Source Routing.
6 * Copyright (C) 2012 by Internet Systems Consortium, Inc. ("ISC")
5adc2528
AS
7 */
8
9#ifndef _ZEBRA_FPM_PRIVATE_H
10#define _ZEBRA_FPM_PRIVATE_H
11
12#include "zebra/debug.h"
13
51e94aa7
EDP
14#ifdef __cplusplus
15extern "C" {
16#endif
17
5adc2528
AS
18#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
19
d62a17ae 20#define zfpm_debug(...) \
21 do { \
22 if (IS_ZEBRA_DEBUG_FPM) \
23 zlog_debug("FPM: " __VA_ARGS__); \
24 } while (0)
5adc2528
AS
25
26#elif defined __GNUC__
27
d62a17ae 28#define zfpm_debug(_args...) \
29 do { \
30 if (IS_ZEBRA_DEBUG_FPM) \
31 zlog_debug("FPM: " _args); \
32 } while (0)
5adc2528
AS
33
34#else
d62a17ae 35static inline void zfpm_debug(const char *format, ...)
36{
37 return;
38}
5adc2528
AS
39#endif
40
e5218ec8
AD
41/* This structure contains the MAC addresses enqueued for FPM processing. */
42struct fpm_mac_info_t {
43 struct ethaddr macaddr;
44 uint32_t zebra_flags; /* Could be used to build FPM messages */
45 vni_t vni;
46 ifindex_t vxlan_if;
47 ifindex_t svi_if; /* L2 or L3 Bridge interface */
48 struct in_addr r_vtep_ip; /* Remote VTEP IP */
49
50 /* Linkage to put MAC on the FPM processing queue. */
51 TAILQ_ENTRY(fpm_mac_info_t) fpm_mac_q_entries;
52
53 uint8_t fpm_flags;
54
55#define ZEBRA_MAC_UPDATE_FPM 0x1 /* This flag indicates if we want to upadte
56 * data plane for this MAC. If a MAC is added
57 * and then deleted immediately, we do not want
58 * to update data plane for such operation.
59 * Unset the ZEBRA_MAC_UPDATE_FPM flag in this
60 * case. FPM thread while processing the queue
61 * node will check this flag and dequeue the
62 * node silently without sending any update to
63 * the data plane.
64 */
65#define ZEBRA_MAC_DELETE_FPM 0x2 /* This flag is set if it is a delete operation
66 * for the MAC.
67 */
68};
5adc2528
AS
69
70/*
71 * Externs
72 */
d62a17ae 73extern int zfpm_netlink_encode_route(int cmd, rib_dest_t *dest,
74 struct route_entry *re, char *in_buf,
75 size_t in_buf_len);
5adc2528 76
d62a17ae 77extern int zfpm_protobuf_encode_route(rib_dest_t *dest, struct route_entry *re,
78 uint8_t *in_buf, size_t in_buf_len);
fb0aa886 79
9da60d0a
AD
80extern int zfpm_netlink_encode_mac(struct fpm_mac_info_t *mac, char *in_buf,
81 size_t in_buf_len);
82
d62a17ae 83extern struct route_entry *zfpm_route_for_update(rib_dest_t *dest);
51e94aa7 84
316d2d52
NK
85extern union g_addr ipv4ll_gateway;
86
51e94aa7
EDP
87#ifdef __cplusplus
88}
89#endif
90
5adc2528 91#endif /* _ZEBRA_FPM_PRIVATE_H */