paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 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 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 28 | |
| 29 | /* Default configuration filename. */ |
| 30 | #define DEFAULT_CONFIG_FILE "zebra.conf" |
| 31 | |
| 32 | /* Client structure. */ |
| 33 | struct zserv |
| 34 | { |
| 35 | /* Client file descriptor. */ |
| 36 | int sock; |
| 37 | |
| 38 | /* Input/output buffer to the client. */ |
| 39 | struct stream *ibuf; |
| 40 | struct stream *obuf; |
| 41 | |
| 42 | /* Threads for read/write. */ |
| 43 | struct thread *t_read; |
| 44 | struct thread *t_write; |
| 45 | |
| 46 | /* default routing table this client munges */ |
| 47 | int rtm_table; |
| 48 | |
| 49 | /* This client's redistribute flag. */ |
| 50 | u_char redist[ZEBRA_ROUTE_MAX]; |
| 51 | |
| 52 | /* Redistribute default route flag. */ |
| 53 | u_char redist_default; |
| 54 | |
| 55 | /* Interface information. */ |
| 56 | u_char ifinfo; |
| 57 | }; |
| 58 | |
| 59 | /* Count prefix size from mask length */ |
| 60 | #define PSIZE(a) (((a) + 7) / (8)) |
| 61 | |
| 62 | /* Prototypes. */ |
| 63 | void zebra_init (); |
| 64 | void zebra_if_init (); |
| 65 | void hostinfo_get (); |
| 66 | void rib_init (); |
| 67 | void interface_list (); |
| 68 | void kernel_init (); |
| 69 | void route_read (); |
| 70 | void rtadv_init (); |
| 71 | void zebra_snmp_init (); |
| 72 | |
| 73 | int |
| 74 | zsend_interface_add (struct zserv *, struct interface *); |
| 75 | int |
| 76 | zsend_interface_delete (struct zserv *, struct interface *); |
| 77 | |
| 78 | int |
| 79 | zsend_interface_address_add (struct zserv *, struct interface *, |
| 80 | struct connected *); |
| 81 | |
| 82 | int |
| 83 | zsend_interface_address_delete (struct zserv *, struct interface *, |
| 84 | struct connected *); |
| 85 | |
| 86 | int |
| 87 | zsend_interface_up (struct zserv *, struct interface *); |
| 88 | |
| 89 | int |
| 90 | zsend_interface_down (struct zserv *, struct interface *); |
| 91 | |
hasso | 726f9b2 | 2003-05-25 21:04:54 +0000 | [diff] [blame] | 92 | #if 0 |
| 93 | #warning oldies |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 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); |
hasso | 726f9b2 | 2003-05-25 21:04:54 +0000 | [diff] [blame] | 103 | #endif |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 104 | |
| 105 | int |
| 106 | zsend_ipv4_add_multipath (struct zserv *, struct prefix *, struct rib *); |
| 107 | |
| 108 | int |
| 109 | zsend_ipv4_delete_multipath (struct zserv *, struct prefix *, struct rib *); |
| 110 | |
| 111 | #ifdef HAVE_IPV6 |
hasso | 726f9b2 | 2003-05-25 21:04:54 +0000 | [diff] [blame] | 112 | #if 0 |
| 113 | #warning oldies |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 114 | int |
| 115 | zsend_ipv6_add (struct zserv *client, int type, int flags, |
| 116 | struct prefix_ipv6 *p, struct in6_addr *nexthop, |
| 117 | unsigned int ifindex); |
| 118 | |
| 119 | int |
| 120 | zsend_ipv6_delete (struct zserv *client, int type, int flags, |
| 121 | struct prefix_ipv6 *p, struct in6_addr *nexthop, |
| 122 | unsigned int ifindex); |
hasso | 726f9b2 | 2003-05-25 21:04:54 +0000 | [diff] [blame] | 123 | #endif |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 124 | |
| 125 | int |
| 126 | zsend_ipv6_add_multipath (struct zserv *, struct prefix *, struct rib *); |
| 127 | |
| 128 | int |
| 129 | zsend_ipv6_delete_multipath (struct zserv *, struct prefix *, struct rib *); |
| 130 | |
| 131 | #endif /* HAVE_IPV6 */ |
| 132 | |
| 133 | extern pid_t pid; |
| 134 | extern pid_t old_pid; |
| 135 | |
| 136 | #endif /* _ZEBRA_ZEBRA_H */ |