]> git.proxmox.com Git - mirror_frr.git/blame - lib/if_rmap.h
Merge pull request #13455 from sri-mohan1/srib-ldpd
[mirror_frr.git] / lib / if_rmap.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
718e3744 2/* route-map for interface.
3 * Copyright (C) 1999 Kunihiro Ishiguro
718e3744 4 */
5
6#ifndef _ZEBRA_IF_RMAP_H
7#define _ZEBRA_IF_RMAP_H
8
efa2ca6e
CH
9#include "typesafe.h"
10
5e244469
RW
11#ifdef __cplusplus
12extern "C" {
13#endif
14
efa2ca6e
CH
15struct lyd_node;
16struct vty;
17
d62a17ae 18enum if_rmap_type { IF_RMAP_IN, IF_RMAP_OUT, IF_RMAP_MAX };
718e3744 19
d62a17ae 20struct if_rmap {
21 /* Name of the interface. */
efa2ca6e 22 const char *ifname;
718e3744 23
d62a17ae 24 char *routemap[IF_RMAP_MAX];
718e3744 25};
26
4b23867c
PG
27struct if_rmap_ctx {
28 /* if_rmap */
29 struct hash *ifrmaphash;
30
31 /* Hook functions. */
32 void (*if_rmap_add_hook)(struct if_rmap_ctx *ctx,
33 struct if_rmap *ifrmap);
34 void (*if_rmap_delete_hook)(struct if_rmap_ctx *ctx,
35 struct if_rmap *ifrmap);
36
aec0d756
PG
37 /* naming information */
38 char *name;
4b23867c
PG
39};
40
aec0d756 41extern struct if_rmap_ctx *if_rmap_ctx_create(const char *name);
4b23867c
PG
42extern void if_rmap_ctx_delete(struct if_rmap_ctx *ctx);
43extern void if_rmap_init(int node);
44extern void if_rmap_terminate(void);
45void if_rmap_hook_add(struct if_rmap_ctx *ctx,
46 void (*func)(struct if_rmap_ctx *ctx,
47 struct if_rmap *));
48void if_rmap_hook_delete(struct if_rmap_ctx *ctx,
49 void (*func)(struct if_rmap_ctx *ctx,
50 struct if_rmap *));
51extern struct if_rmap *if_rmap_lookup(struct if_rmap_ctx *ctx,
52 const char *ifname);
efa2ca6e
CH
53extern void if_rmap_yang_modify_cb(struct if_rmap_ctx *ctx,
54 const struct lyd_node *dnode,
55 enum if_rmap_type type, bool del);
56extern void if_rmap_yang_destroy_cb(struct if_rmap_ctx *ctx,
57 const struct lyd_node *dnode);
4b23867c 58extern int config_write_if_rmap(struct vty *, struct if_rmap_ctx *ctx);
1d1f77b6
IR
59void cli_show_if_route_map(struct vty *vty, const struct lyd_node *dnode,
60 bool show_defaults);
718e3744 61
5e244469
RW
62#ifdef __cplusplus
63}
64#endif
65
718e3744 66#endif /* _ZEBRA_IF_RMAP_H */