]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zserv.h
Merge quagga mainline into the google ISIS code.
[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"
ec1a4283 26#include "if.h"
4d38fdb4 27#include "workqueue.h"
5b73a671 28
718e3744 29/* Default port information. */
718e3744 30#define ZEBRA_VTY_PORT 2601
718e3744 31
32/* Default configuration filename. */
33#define DEFAULT_CONFIG_FILE "zebra.conf"
34
35/* Client structure. */
36struct zserv
37{
38 /* Client file descriptor. */
39 int sock;
40
af56d404
JB
41 /* Client route type. */
42 /* Assuming each client contains only one type of route. */
43 int route_type;
44
718e3744 45 /* Input/output buffer to the client. */
46 struct stream *ibuf;
47 struct stream *obuf;
48
719e9741 49 /* Buffer of data waiting to be written to client. */
50 struct buffer *wb;
51
718e3744 52 /* Threads for read/write. */
53 struct thread *t_read;
54 struct thread *t_write;
55
719e9741 56 /* Thread for delayed close. */
57 struct thread *t_suicide;
58
718e3744 59 /* default routing table this client munges */
60 int rtm_table;
61
62 /* This client's redistribute flag. */
63 u_char redist[ZEBRA_ROUTE_MAX];
64
65 /* Redistribute default route flag. */
66 u_char redist_default;
67
68 /* Interface information. */
69 u_char ifinfo;
18a6dce6 70
71 /* Router-id information. */
72 u_char ridinfo;
718e3744 73};
74
b21b19c5 75/* Zebra instance */
76struct zebra_t
77{
78 /* Thread master */
79 struct thread_master *master;
52dc7ee6 80 struct list *client_list;
b21b19c5 81
82 /* default table */
83 int rtm_table_default;
4d38fdb4 84
85 /* rib work queue */
86 struct work_queue *ribq;
e96f9203 87 struct meta_queue *mq;
b21b19c5 88};
89
718e3744 90/* Count prefix size from mask length */
91#define PSIZE(a) (((a) + 7) / (8))
92
93/* Prototypes. */
a1ac18c4 94extern void zebra_init (void);
95extern void zebra_if_init (void);
b5114685 96extern void zebra_zserv_socket_init (char *path);
a1ac18c4 97extern void hostinfo_get (void);
98extern void rib_init (void);
99extern void interface_list (void);
100extern void kernel_init (void);
101extern void route_read (void);
7514fb77 102extern void zebra_route_map_init (void);
a1ac18c4 103extern void zebra_snmp_init (void);
104extern void zebra_vty_init (void);
105
106extern int zsend_interface_add (struct zserv *, struct interface *);
a1ac18c4 107extern int zsend_interface_delete (struct zserv *, struct interface *);
a1ac18c4 108extern int zsend_interface_address (int, struct zserv *, struct interface *,
109 struct connected *);
110extern int zsend_interface_update (int, struct zserv *, struct interface *);
111extern int zsend_route_multipath (int, struct zserv *, struct prefix *,
112 struct rib *);
113extern int zsend_router_id_update(struct zserv *, struct prefix *);
718e3744 114
115extern pid_t pid;
718e3744 116
117#endif /* _ZEBRA_ZEBRA_H */