// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright (c) 2025 Christophe Fontaine, Red Hat

#pragma once

#include <lib/if.h>
#include <lib/memory.h>
#include <lib/vrf.h>

DECLARE_MGROUP(GROUT);
DECLARE_MTYPE(GROUT_MEM);

bool add_ifindex_mapping(uint16_t grout_ifindex, ifindex_t frr_ifindex);
bool remove_mapping_by_grout_ifindex(uint16_t grout_ifindex);

ifindex_t ifindex_grout_to_frr(uint16_t grout_ifindex);
uint16_t ifindex_frr_to_grout(ifindex_t frr_ifindex);

vrf_id_t vrf_grout_to_frr(uint16_t gr_vrf_id);
uint16_t vrf_frr_to_grout(vrf_id_t frr_vrf_id);

void clear_ifindex_mappings(void);
void init_ifindex_mappings(void);
