blob: f043099b52455e753f56c9267c8a9017217eec44 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/* Zebra daemon server header.
2 * Copyright (C) 1997, 98 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 it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * 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 Free
18 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 * 02111-1307, USA.
20 */
21
22#ifndef _ZEBRA_ZSERV_H
23#define _ZEBRA_ZSERV_H
24
25/* Default port information. */
26#define ZEBRA_PORT 2600
27#define ZEBRA_VTY_PORT 2601
paul718e3742002-12-13 20:15:29 +000028
29/* Default configuration filename. */
30#define DEFAULT_CONFIG_FILE "zebra.conf"
31
32/* Client structure. */
33struct zserv
34{
35 /* Client file descriptor. */
36 int sock;
37
38 /* Input/output buffer to the client. */
39 struct stream *ibuf;
40 struct stream *obuf;
41
42 /* Threads for read/write. */
43 struct thread *t_read;
44 struct thread *t_write;
45
46 /* default routing table this client munges */
47 int rtm_table;
48
49 /* This client's redistribute flag. */
50 u_char redist[ZEBRA_ROUTE_MAX];
51
52 /* Redistribute default route flag. */
53 u_char redist_default;
54
55 /* Interface information. */
56 u_char ifinfo;
57};
58
paulb21b19c2003-06-15 01:28:29 +000059/* Zebra instance */
60struct zebra_t
61{
62 /* Thread master */
63 struct thread_master *master;
64 list client_list;
65
66 /* default table */
67 int rtm_table_default;
68
69};
70
paul718e3742002-12-13 20:15:29 +000071/* Count prefix size from mask length */
72#define PSIZE(a) (((a) + 7) / (8))
73
74/* Prototypes. */
75void zebra_init ();
76void zebra_if_init ();
77void hostinfo_get ();
78void rib_init ();
79void interface_list ();
80void kernel_init ();
81void route_read ();
82void rtadv_init ();
83void zebra_snmp_init ();
84
paulb9df2d22004-05-09 09:09:59 +000085int zsend_interface_add (struct zserv *, struct interface *);
86#if (defined(RTM_IFANNOUNCE) || defined(HAVE_NETLINK))
87int zsend_interface_delete (struct zserv *, struct interface *);
hasso726f9b22003-05-25 21:04:54 +000088#endif
paulb9df2d22004-05-09 09:09:59 +000089int zsend_interface_address (int, struct zserv *, struct interface *,
90 struct connected *);
91int zsend_interface_update (int, struct zserv *, struct interface *);
92int zsend_route_multipath (int, struct zserv *, struct prefix *, struct rib *);
paul718e3742002-12-13 20:15:29 +000093
94extern pid_t pid;
95extern pid_t old_pid;
96
97#endif /* _ZEBRA_ZEBRA_H */