]> git.proxmox.com Git - mirror_frr.git/blob - lib/if_rmap.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / lib / if_rmap.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* route-map for interface.
3 * Copyright (C) 1999 Kunihiro Ishiguro
4 */
5
6 #ifndef _ZEBRA_IF_RMAP_H
7 #define _ZEBRA_IF_RMAP_H
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12
13 enum if_rmap_type { IF_RMAP_IN, IF_RMAP_OUT, IF_RMAP_MAX };
14
15 struct if_rmap {
16 /* Name of the interface. */
17 char *ifname;
18
19 char *routemap[IF_RMAP_MAX];
20 };
21
22 struct if_rmap_ctx {
23 /* if_rmap */
24 struct hash *ifrmaphash;
25
26 /* Hook functions. */
27 void (*if_rmap_add_hook)(struct if_rmap_ctx *ctx,
28 struct if_rmap *ifrmap);
29 void (*if_rmap_delete_hook)(struct if_rmap_ctx *ctx,
30 struct if_rmap *ifrmap);
31
32 /* naming information */
33 char *name;
34 };
35
36 extern struct if_rmap_ctx *if_rmap_ctx_create(const char *name);
37 extern void if_rmap_ctx_delete(struct if_rmap_ctx *ctx);
38 extern void if_rmap_init(int node);
39 extern void if_rmap_terminate(void);
40 void if_rmap_hook_add(struct if_rmap_ctx *ctx,
41 void (*func)(struct if_rmap_ctx *ctx,
42 struct if_rmap *));
43 void if_rmap_hook_delete(struct if_rmap_ctx *ctx,
44 void (*func)(struct if_rmap_ctx *ctx,
45 struct if_rmap *));
46 extern struct if_rmap *if_rmap_lookup(struct if_rmap_ctx *ctx,
47 const char *ifname);
48 extern int config_write_if_rmap(struct vty *, struct if_rmap_ctx *ctx);
49
50 #ifdef __cplusplus
51 }
52 #endif
53
54 #endif /* _ZEBRA_IF_RMAP_H */