/*
 * common.h: Shared helpers for bridgemngr datamodel backends
 *
 * Copyright (C) 2026 IOPSYS Software Solutions AB. All rights reserved.
 *
 * See LICENSE file for license related information.
 */

#ifndef BRIDGEMNGR_COMMON_H
#define BRIDGEMNGR_COMMON_H

#ifdef BRIDGE_ENABLE_FDB_EXT

#include <stdbool.h>
#include "libbbfdm-api/dmcommon.h"

struct fdb_entry_data {
	char mac[18];
	unsigned int vid;
	bool is_local;
	char status[16];
};

int fdb_browse_port_entries(struct dmctx *dmctx, DMNODE *parent_node,
			    const char *bridge_name, const char *port_name);

int browseBridgingBridgePortFDBEntryInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance);
int get_BridgingBridgePort_FDBEntryNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);

int get_BridgingBridgePortFDBEntry_MACAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int get_BridgingBridgePortFDBEntry_VID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int get_BridgingBridgePortFDBEntry_IsLocal(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int get_BridgingBridgePortFDBEntry_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);

extern DMLEAF tBridgingBridgePortFDBEntryParams[];

#endif /* BRIDGE_ENABLE_FDB_EXT */

#endif /* BRIDGEMNGR_COMMON_H */
