1 /* Zebra daemon server header.
2 * Copyright (C) 1997, 98 Kunihiro Ishiguro
4 * This file is part of GNU Zebra.
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
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.
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
22 #ifndef _ZEBRA_ZSERV_H
23 #define _ZEBRA_ZSERV_H
27 #include "workqueue.h"
30 /* Default port information. */
31 #define ZEBRA_VTY_PORT 2601
33 /* Default configuration filename. */
34 #define DEFAULT_CONFIG_FILE "zebra.conf"
36 /* Client structure. */
39 /* Client file descriptor. */
42 /* Input/output buffer to the client. */
46 /* Buffer of data waiting to be written to client. */
49 /* Threads for read/write. */
50 struct thread *t_read;
51 struct thread *t_write;
53 /* Thread for delayed close. */
54 struct thread *t_suicide;
56 /* default routing table this client munges */
59 /* This client's redistribute flag. */
60 vrf_bitmap_t redist[ZEBRA_ROUTE_MAX];
62 /* Redistribute default route flag. */
63 vrf_bitmap_t redist_default;
65 /* Interface information. */
68 /* Router-id information. */
71 /* client's protocol */
75 u_int32_t redist_v4_add_cnt;
76 u_int32_t redist_v4_del_cnt;
77 u_int32_t redist_v6_add_cnt;
78 u_int32_t redist_v6_del_cnt;
79 u_int32_t v4_route_add_cnt;
80 u_int32_t v4_route_upd8_cnt;
81 u_int32_t v4_route_del_cnt;
82 u_int32_t v6_route_add_cnt;
83 u_int32_t v6_route_del_cnt;
84 u_int32_t v6_route_upd8_cnt;
85 u_int32_t connected_rt_add_cnt;
86 u_int32_t connected_rt_del_cnt;
93 time_t last_read_time;
94 time_t last_write_time;
97 time_t nh_last_upd_time;
107 struct thread_master *master;
108 struct list *client_list;
111 int rtm_table_default;
114 struct work_queue *ribq;
115 struct meta_queue *mq;
119 extern void zebra_init (void);
120 extern void zebra_if_init (void);
121 extern void zebra_zserv_socket_init (char *path);
122 extern void hostinfo_get (void);
123 extern void rib_init (void);
124 extern void interface_list (struct zebra_vrf *);
125 extern void route_read (struct zebra_vrf *);
126 extern void kernel_init (struct zebra_vrf *);
127 extern void kernel_terminate (struct zebra_vrf *);
128 extern void zebra_route_map_init (void);
129 extern void zebra_snmp_init (void);
130 extern void zebra_vty_init (void);
132 extern int zsend_interface_add (struct zserv *, struct interface *);
133 extern int zsend_interface_delete (struct zserv *, struct interface *);
134 extern int zsend_interface_address (int, struct zserv *, struct interface *,
136 extern int zsend_interface_update (int, struct zserv *, struct interface *);
137 extern int zsend_route_multipath (int, struct zserv *, struct prefix *,
139 extern int zsend_router_id_update (struct zserv *, struct prefix *,
142 extern int zsend_interface_link_params (struct zserv *, struct interface *);
146 extern void zserv_create_header(struct stream *s, uint16_t cmd, vrf_id_t);
147 extern int zebra_server_send_message(struct zserv *client);
149 #endif /* _ZEBRA_ZEBRA_H */