www.usr.com/support/gpl/USR9108_release1.5.tar.gz
[bcm963xx.git] / userapps / opensource / zebra / zebra / zserv.h
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
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. */
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
61 /* Count prefix size from mask length */
62 #define PSIZE(a) (((a) + 7) / (8))
63
64 /* Prototypes. */
65 void zebra_init ();
66 void zebra_if_init ();
67 void hostinfo_get ();
68 void rib_init ();
69 void interface_list ();
70 void kernel_init ();
71 void route_read ();
72 void rtadv_init ();
73 void zebra_snmp_init ();
74
75 int
76 zsend_interface_add (struct zserv *, struct interface *);
77 int
78 zsend_interface_delete (struct zserv *, struct interface *);
79
80 int
81 zsend_interface_address_add (struct zserv *, struct interface *,
82                              struct connected *);
83
84 int
85 zsend_interface_address_delete (struct zserv *, struct interface *,
86                                 struct connected *);
87
88 int
89 zsend_interface_up (struct zserv *, struct interface *);
90
91 int
92 zsend_interface_down (struct zserv *, struct interface *);
93
94 int
95 zsend_ipv4_add (struct zserv *client, int type, int flags,
96                 struct prefix_ipv4 *p, struct in_addr *nexthop,
97                 unsigned int ifindex);
98
99 int
100 zsend_ipv4_delete (struct zserv *client, int type, int flags,
101                    struct prefix_ipv4 *p, struct in_addr *nexthop,
102                    unsigned int ifindex);
103
104 int
105 zsend_ipv4_add_multipath (struct zserv *, struct prefix *, struct rib *);
106
107 int
108 zsend_ipv4_delete_multipath (struct zserv *, struct prefix *, struct rib *);
109
110 #ifdef HAVE_IPV6
111 int
112 zsend_ipv6_add (struct zserv *client, int type, int flags,
113                 struct prefix_ipv6 *p, struct in6_addr *nexthop,
114                 unsigned int ifindex);
115
116 int
117 zsend_ipv6_delete (struct zserv *client, int type, int flags,
118                    struct prefix_ipv6 *p, struct in6_addr *nexthop,
119                    unsigned int ifindex);
120
121 int
122 zsend_ipv6_add_multipath (struct zserv *, struct prefix *, struct rib *);
123
124 int
125 zsend_ipv6_delete_multipath (struct zserv *, struct prefix *, struct rib *);
126
127 #endif /* HAVE_IPV6 */
128
129 extern pid_t pid;
130 extern pid_t old_pid;
131
132 #endif /* _ZEBRA_ZEBRA_H */