]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zserv.h
2005-07-29 Paul Jakma <paul.jakma@sun.com>
[mirror_frr.git] / zebra / zserv.h
CommitLineData
718e3744 1/* 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
5b73a671 25#include "rib.h"
4d38fdb4 26#include "workqueue.h"
5b73a671 27
718e3744 28/* Default port information. */
718e3744 29#define ZEBRA_VTY_PORT 2601
718e3744 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
719e9741 44 /* Buffer of data waiting to be written to client. */
45 struct buffer *wb;
46
718e3744 47 /* Threads for read/write. */
48 struct thread *t_read;
49 struct thread *t_write;
50
719e9741 51 /* Thread for delayed close. */
52 struct thread *t_suicide;
53
718e3744 54 /* default routing table this client munges */
55 int rtm_table;
56
57 /* This client's redistribute flag. */
58 u_char redist[ZEBRA_ROUTE_MAX];
59
60 /* Redistribute default route flag. */
61 u_char redist_default;
62
63 /* Interface information. */
64 u_char ifinfo;
18a6dce6 65
66 /* Router-id information. */
67 u_char ridinfo;
718e3744 68};
69
b21b19c5 70/* Zebra instance */
71struct zebra_t
72{
73 /* Thread master */
74 struct thread_master *master;
52dc7ee6 75 struct list *client_list;
b21b19c5 76
77 /* default table */
78 int rtm_table_default;
4d38fdb4 79
80 /* rib work queue */
81 struct work_queue *ribq;
b21b19c5 82};
83
718e3744 84/* Count prefix size from mask length */
85#define PSIZE(a) (((a) + 7) / (8))
86
87/* Prototypes. */
a1ac18c4 88extern void zebra_init (void);
89extern void zebra_if_init (void);
90extern void hostinfo_get (void);
91extern void rib_init (void);
92extern void interface_list (void);
93extern void kernel_init (void);
94extern void route_read (void);
95extern void zebra_snmp_init (void);
96extern void zebra_vty_init (void);
97
98extern int zsend_interface_add (struct zserv *, struct interface *);
a1ac18c4 99extern int zsend_interface_delete (struct zserv *, struct interface *);
a1ac18c4 100extern int zsend_interface_address (int, struct zserv *, struct interface *,
101 struct connected *);
102extern int zsend_interface_update (int, struct zserv *, struct interface *);
103extern int zsend_route_multipath (int, struct zserv *, struct prefix *,
104 struct rib *);
105extern int zsend_router_id_update(struct zserv *, struct prefix *);
718e3744 106
107extern pid_t pid;
108extern pid_t old_pid;
109
110#endif /* _ZEBRA_ZEBRA_H */