]>
git.proxmox.com Git - mirror_frr.git/blob - lib/distribute.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* Distribute list functions header
3 * Copyright (C) 1999 Kunihiro Ishiguro
6 #ifndef _ZEBRA_DISTRIBUTE_H
7 #define _ZEBRA_DISTRIBUTE_H
17 /* Distribute list types. */
18 enum distribute_type
{
27 /* Name of the interface. */
30 /* Filter name of `in' and `out' */
31 char *list
[DISTRIBUTE_MAX
];
33 /* prefix-list name of `in' and `out' */
34 char *prefix
[DISTRIBUTE_MAX
];
37 struct distribute_ctx
{
38 /* Hash of distribute list. */
39 struct hash
*disthash
;
42 void (*distribute_add_hook
)(struct distribute_ctx
*ctx
,
43 struct distribute
*dist
);
44 void (*distribute_delete_hook
)(struct distribute_ctx
*ctx
,
45 struct distribute
*dist
);
51 /* Prototypes for distribute-list. */
52 extern struct distribute_ctx
*distribute_list_ctx_create(struct vrf
*vrf
);
53 extern void distribute_list_delete(struct distribute_ctx
**ctx
);
54 extern void distribute_list_add_hook(struct distribute_ctx
*ctx
,
55 void (*)(struct distribute_ctx
*ctx
,
56 struct distribute
*));
57 extern void distribute_list_delete_hook(struct distribute_ctx
*ctx
,
58 void (*)(struct distribute_ctx
*ctx
,
59 struct distribute
*));
60 extern struct distribute
*distribute_lookup(struct distribute_ctx
*ctx
,
62 extern int config_write_distribute(struct vty
*vty
,
63 struct distribute_ctx
*ctx
);
64 extern int config_show_distribute(struct vty
*vty
,
65 struct distribute_ctx
*ctx
);
67 extern enum filter_type
distribute_apply_in(struct interface
*,
69 extern enum filter_type
distribute_apply_out(struct interface
*,
72 extern int distribute_list_parser(bool prefix
, bool v4
, const char *dir
,
73 const char *list
, const char *ifname
);
74 extern int distribute_list_no_parser(struct vty
*vty
, bool prefix
, bool v4
,
75 const char *dir
, const char *list
,
81 #endif /* _ZEBRA_DISTRIBUTE_H */