blob: c76228083ff909f327629da78d0c390c6c09a12e [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
28#define ZEBRA_VTYSH_PATH "/tmp/.zebra"
29#define ZEBRA_SERV_PATH "/tmp/.zserv"
30
31/* Default configuration filename. */
32#define DEFAULT_CONFIG_FILE "zebra.conf"
33
34/* Client structure. */
35struct zserv
36{
37 /* Client file descriptor. */
38 int sock;
39
40 /* Input/output buffer to the client. */
41 struct stream *ibuf;
42 struct stream *obuf;
43
44 /* Threads for read/write. */
45 struct thread *t_read;
46 struct thread *t_write;
47
48 /* default routing table this client munges */
49 int rtm_table;
50
51 /* This client's redistribute flag. */
52 u_char redist[ZEBRA_ROUTE_MAX];
53
54 /* Redistribute default route flag. */
55 u_char redist_default;
56
57 /* Interface information. */
58 u_char ifinfo;
59};
60
61/* Count prefix size from mask length */
62#define PSIZE(a) (((a) + 7) / (8))
63
64/* Prototypes. */
65void zebra_init ();
66void zebra_if_init ();
67void hostinfo_get ();
68void rib_init ();
69void interface_list ();
70void kernel_init ();
71void route_read ();
72void rtadv_init ();
73void zebra_snmp_init ();
74
75int
76zsend_interface_add (struct zserv *, struct interface *);
77int
78zsend_interface_delete (struct zserv *, struct interface *);
79
80int
81zsend_interface_address_add (struct zserv *, struct interface *,
82 struct connected *);
83
84int
85zsend_interface_address_delete (struct zserv *, struct interface *,
86 struct connected *);
87
88int
89zsend_interface_up (struct zserv *, struct interface *);
90
91int
92zsend_interface_down (struct zserv *, struct interface *);
93
94int
95zsend_ipv4_add (struct zserv *client, int type, int flags,
96 struct prefix_ipv4 *p, struct in_addr *nexthop,
97 unsigned int ifindex);
98
99int
100zsend_ipv4_delete (struct zserv *client, int type, int flags,
101 struct prefix_ipv4 *p, struct in_addr *nexthop,
102 unsigned int ifindex);
103
104int
105zsend_ipv4_add_multipath (struct zserv *, struct prefix *, struct rib *);
106
107int
108zsend_ipv4_delete_multipath (struct zserv *, struct prefix *, struct rib *);
109
110#ifdef HAVE_IPV6
111int
112zsend_ipv6_add (struct zserv *client, int type, int flags,
113 struct prefix_ipv6 *p, struct in6_addr *nexthop,
114 unsigned int ifindex);
115
116int
117zsend_ipv6_delete (struct zserv *client, int type, int flags,
118 struct prefix_ipv6 *p, struct in6_addr *nexthop,
119 unsigned int ifindex);
120
121int
122zsend_ipv6_add_multipath (struct zserv *, struct prefix *, struct rib *);
123
124int
125zsend_ipv6_delete_multipath (struct zserv *, struct prefix *, struct rib *);
126
127#endif /* HAVE_IPV6 */
128
129extern pid_t pid;
130extern pid_t old_pid;
131
132#endif /* _ZEBRA_ZEBRA_H */