]>
Commit | Line | Data |
---|---|---|
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" |
26 | ||
718e3744 | 27 | /* Default port information. */ |
28 | #define ZEBRA_PORT 2600 | |
29 | #define ZEBRA_VTY_PORT 2601 | |
718e3744 | 30 | |
31 | /* Default configuration filename. */ | |
32 | #define DEFAULT_CONFIG_FILE "zebra.conf" | |
33 | ||
34 | /* Client structure. */ | |
35 | struct 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 | ||
b21b19c5 | 61 | /* Zebra instance */ |
62 | struct zebra_t | |
63 | { | |
64 | /* Thread master */ | |
65 | struct thread_master *master; | |
66 | list client_list; | |
67 | ||
68 | /* default table */ | |
69 | int rtm_table_default; | |
70 | ||
71 | }; | |
72 | ||
718e3744 | 73 | /* Count prefix size from mask length */ |
74 | #define PSIZE(a) (((a) + 7) / (8)) | |
75 | ||
76 | /* Prototypes. */ | |
77 | void zebra_init (); | |
78 | void zebra_if_init (); | |
79 | void hostinfo_get (); | |
80 | void rib_init (); | |
81 | void interface_list (); | |
82 | void kernel_init (); | |
83 | void route_read (); | |
84 | void rtadv_init (); | |
85 | void zebra_snmp_init (); | |
86 | ||
b9df2d25 | 87 | int zsend_interface_add (struct zserv *, struct interface *); |
88 | #if (defined(RTM_IFANNOUNCE) || defined(HAVE_NETLINK)) | |
89 | int zsend_interface_delete (struct zserv *, struct interface *); | |
726f9b2b | 90 | #endif |
b9df2d25 | 91 | int zsend_interface_address (int, struct zserv *, struct interface *, |
92 | struct connected *); | |
93 | int zsend_interface_update (int, struct zserv *, struct interface *); | |
94 | int zsend_route_multipath (int, struct zserv *, struct prefix *, struct rib *); | |
718e3744 | 95 | |
96 | extern pid_t pid; | |
97 | extern pid_t old_pid; | |
98 | ||
99 | #endif /* _ZEBRA_ZEBRA_H */ |