blob: e9625a3548aea135453176ab4c548b6f691bcdd9 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/* Distribute list functions header
2 * Copyright (C) 1999 Kunihiro Ishiguro
3 *
4 * This file is part of GNU Zebra.
5 *
6 * GNU Zebra is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published
8 * by the Free Software Foundation; either version 2, or (at your
9 * option) any later version.
10 *
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Zebra; see the file COPYING. If not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
22#ifndef _ZEBRA_DISTRIBUTE_H
23#define _ZEBRA_DISTRIBUTE_H
24
Paul Jakma57345092011-12-25 17:52:09 +010025#include <zebra.h>
26#include "if.h"
David Lamparter388f8852015-03-03 08:55:54 +010027#include "filter.h"
Paul Jakma57345092011-12-25 17:52:09 +010028
paul718e3742002-12-13 20:15:29 +000029/* Disctirubte list types. */
30enum distribute_type
31{
Matthieu Boutierdf2ef242014-09-10 16:50:45 +020032 DISTRIBUTE_V4_IN,
33 DISTRIBUTE_V6_IN,
34 DISTRIBUTE_V4_OUT,
35 DISTRIBUTE_V6_OUT,
paul718e3742002-12-13 20:15:29 +000036 DISTRIBUTE_MAX
37};
38
39struct distribute
40{
41 /* Name of the interface. */
42 char *ifname;
43
44 /* Filter name of `in' and `out' */
45 char *list[DISTRIBUTE_MAX];
46
47 /* prefix-list name of `in' and `out' */
48 char *prefix[DISTRIBUTE_MAX];
49};
50
51/* Prototypes for distribute-list. */
paul8cc41982005-05-06 21:25:49 +000052extern void distribute_list_init (int);
53extern void distribute_list_reset (void);
54extern void distribute_list_add_hook (void (*) (struct distribute *));
55extern void distribute_list_delete_hook (void (*) (struct distribute *));
56extern struct distribute *distribute_lookup (const char *);
57extern int config_write_distribute (struct vty *);
58extern int config_show_distribute (struct vty *);
paul718e3742002-12-13 20:15:29 +000059
paul8cc41982005-05-06 21:25:49 +000060extern enum filter_type distribute_apply_in (struct interface *, struct prefix *);
61extern enum filter_type distribute_apply_out (struct interface *, struct prefix *);
paul718e3742002-12-13 20:15:29 +000062
63#endif /* _ZEBRA_DISTRIBUTE_H */