paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 1999 Yasuhiro Ohara |
| 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 |
| 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | * Boston, MA 02111-1307, USA. |
| 20 | */ |
| 21 | |
| 22 | #include <zebra.h> |
hasso | 3b4cd3a | 2004-05-18 19:28:32 +0000 | [diff] [blame] | 23 | #include <lib/version.h> |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 24 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 25 | #include "getopt.h" |
| 26 | #include "thread.h" |
| 27 | #include "log.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 28 | #include "command.h" |
| 29 | #include "vty.h" |
| 30 | #include "memory.h" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 31 | #include "if.h" |
| 32 | #include "filter.h" |
| 33 | #include "prefix.h" |
| 34 | #include "plist.h" |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 35 | #include "privs.h" |
hasso | e42f5a3 | 2004-08-28 17:04:33 +0000 | [diff] [blame] | 36 | #include "sigevent.h" |
Denis Ovsienko | 87362ce | 2011-08-27 22:19:34 +0400 | [diff] [blame] | 37 | #include "zclient.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 38 | |
| 39 | #include "ospf6d.h" |
Denis Ovsienko | 87362ce | 2011-08-27 22:19:34 +0400 | [diff] [blame] | 40 | #include "ospf6_top.h" |
| 41 | #include "ospf6_message.h" |
| 42 | #include "ospf6_asbr.h" |
| 43 | #include "ospf6_lsa.h" |
Christian Franke | d962872 | 2013-03-08 21:47:35 +0100 | [diff] [blame^] | 44 | #include "ospf6_interface.h" |
| 45 | #include "ospf6_zebra.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 46 | |
| 47 | /* Default configuration file name for ospf6d. */ |
| 48 | #define OSPF6_DEFAULT_CONFIG "ospf6d.conf" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 49 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 50 | /* Default port values. */ |
| 51 | #define OSPF6_VTY_PORT 2606 |
| 52 | |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 53 | /* ospf6d privileges */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 54 | zebra_capabilities_t _caps_p [] = |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 55 | { |
paul | ceacedb | 2005-09-29 14:39:32 +0000 | [diff] [blame] | 56 | ZCAP_NET_RAW, |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 57 | ZCAP_BIND |
| 58 | }; |
| 59 | |
| 60 | struct zebra_privs_t ospf6d_privs = |
| 61 | { |
paul | d81fadf | 2003-08-14 05:32:12 +0000 | [diff] [blame] | 62 | #if defined(QUAGGA_USER) |
| 63 | .user = QUAGGA_USER, |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 64 | #endif |
paul | d81fadf | 2003-08-14 05:32:12 +0000 | [diff] [blame] | 65 | #if defined QUAGGA_GROUP |
| 66 | .group = QUAGGA_GROUP, |
| 67 | #endif |
| 68 | #ifdef VTY_GROUP |
| 69 | .vty_group = VTY_GROUP, |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 70 | #endif |
| 71 | .caps_p = _caps_p, |
| 72 | .cap_num_p = 2, |
| 73 | .cap_num_i = 0 |
| 74 | }; |
| 75 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 76 | /* ospf6d options, we use GNU getopt library. */ |
| 77 | struct option longopts[] = |
| 78 | { |
| 79 | { "daemon", no_argument, NULL, 'd'}, |
| 80 | { "config_file", required_argument, NULL, 'f'}, |
| 81 | { "pid_file", required_argument, NULL, 'i'}, |
Vyacheslav Trushkin | b511468 | 2011-11-25 18:51:48 +0400 | [diff] [blame] | 82 | { "socket", required_argument, NULL, 'z'}, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 83 | { "vty_addr", required_argument, NULL, 'A'}, |
| 84 | { "vty_port", required_argument, NULL, 'P'}, |
hasso | c065230 | 2004-11-25 19:33:48 +0000 | [diff] [blame] | 85 | { "user", required_argument, NULL, 'u'}, |
| 86 | { "group", required_argument, NULL, 'g'}, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 87 | { "version", no_argument, NULL, 'v'}, |
Paul Jakma | 876b8be | 2006-10-15 23:35:57 +0000 | [diff] [blame] | 88 | { "dryrun", no_argument, NULL, 'C'}, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 89 | { "help", no_argument, NULL, 'h'}, |
| 90 | { 0 } |
| 91 | }; |
| 92 | |
| 93 | /* Configuration file and directory. */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 94 | char config_default[] = SYSCONFDIR OSPF6_DEFAULT_CONFIG; |
| 95 | |
| 96 | /* ospf6d program name. */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 97 | char *progname; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 98 | |
| 99 | /* is daemon? */ |
| 100 | int daemon_mode = 0; |
| 101 | |
| 102 | /* Master of threads. */ |
| 103 | struct thread_master *master; |
| 104 | |
| 105 | /* Process ID saved for use by init system */ |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 106 | const char *pid_file = PATH_OSPF6D_PID; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 107 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 108 | /* Help information display. */ |
| 109 | static void |
| 110 | usage (char *progname, int status) |
| 111 | { |
| 112 | if (status != 0) |
| 113 | fprintf (stderr, "Try `%s --help' for more information.\n", progname); |
| 114 | else |
| 115 | { |
| 116 | printf ("Usage : %s [OPTION...]\n\n\ |
| 117 | Daemon which manages OSPF version 3.\n\n\ |
| 118 | -d, --daemon Runs in daemon mode\n\ |
| 119 | -f, --config_file Set configuration file name\n\ |
| 120 | -i, --pid_file Set process identifier file name\n\ |
Vyacheslav Trushkin | b511468 | 2011-11-25 18:51:48 +0400 | [diff] [blame] | 121 | -z, --socket Set path of zebra socket\n\ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 122 | -A, --vty_addr Set vty's bind address\n\ |
| 123 | -P, --vty_port Set vty's port number\n\ |
hasso | c065230 | 2004-11-25 19:33:48 +0000 | [diff] [blame] | 124 | -u, --user User to run as\n\ |
| 125 | -g, --group Group to run as\n\ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 126 | -v, --version Print program version\n\ |
Paul Jakma | 876b8be | 2006-10-15 23:35:57 +0000 | [diff] [blame] | 127 | -C, --dryrun Check configuration for validity and exit\n\ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 128 | -h, --help Display this help and exit\n\ |
| 129 | \n\ |
Christian Franke | 4ff3bca | 2013-03-20 10:50:07 +0000 | [diff] [blame] | 130 | Report bugs to %s\n", progname, ZEBRA_BUG_ADDRESS); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | exit (status); |
| 134 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 135 | |
Stephen Hemminger | c143c38 | 2011-12-07 01:25:46 +0400 | [diff] [blame] | 136 | static void __attribute__ ((noreturn)) |
Tom Goff | ae2254a | 2010-11-10 13:01:41 -0800 | [diff] [blame] | 137 | ospf6_exit (int status) |
| 138 | { |
Christian Franke | d962872 | 2013-03-08 21:47:35 +0100 | [diff] [blame^] | 139 | struct listnode *node; |
| 140 | struct interface *ifp; |
Tom Goff | ae2254a | 2010-11-10 13:01:41 -0800 | [diff] [blame] | 141 | |
| 142 | if (ospf6) |
| 143 | ospf6_delete (ospf6); |
| 144 | |
Christian Franke | d962872 | 2013-03-08 21:47:35 +0100 | [diff] [blame^] | 145 | for (ALL_LIST_ELEMENTS_RO(iflist, node, ifp)) |
| 146 | if (ifp->info != NULL) |
| 147 | ospf6_interface_delete(ifp->info); |
| 148 | |
Tom Goff | ae2254a | 2010-11-10 13:01:41 -0800 | [diff] [blame] | 149 | ospf6_message_terminate (); |
| 150 | ospf6_asbr_terminate (); |
| 151 | ospf6_lsa_terminate (); |
| 152 | |
| 153 | if_terminate (); |
| 154 | vty_terminate (); |
| 155 | cmd_terminate (); |
| 156 | |
| 157 | if (zclient) |
| 158 | zclient_free (zclient); |
| 159 | |
| 160 | if (master) |
| 161 | thread_master_free (master); |
| 162 | |
| 163 | if (zlog_default) |
| 164 | closezlog (zlog_default); |
| 165 | |
| 166 | exit (status); |
| 167 | } |
| 168 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 169 | /* SIGHUP handler. */ |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 170 | static void |
hasso | e42f5a3 | 2004-08-28 17:04:33 +0000 | [diff] [blame] | 171 | sighup (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 172 | { |
| 173 | zlog_info ("SIGHUP received"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | /* SIGINT handler. */ |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 177 | static void |
hasso | e42f5a3 | 2004-08-28 17:04:33 +0000 | [diff] [blame] | 178 | sigint (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 179 | { |
ajs | 887c44a | 2004-12-03 16:36:46 +0000 | [diff] [blame] | 180 | zlog_notice ("Terminating on signal SIGINT"); |
Tom Goff | ae2254a | 2010-11-10 13:01:41 -0800 | [diff] [blame] | 181 | ospf6_exit (0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | /* SIGTERM handler. */ |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 185 | static void |
hasso | e42f5a3 | 2004-08-28 17:04:33 +0000 | [diff] [blame] | 186 | sigterm (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 187 | { |
ajs | 887c44a | 2004-12-03 16:36:46 +0000 | [diff] [blame] | 188 | zlog_notice ("Terminating on signal SIGTERM"); |
Phil Laverdiere | ef2d5d1 | 2012-01-02 20:04:26 +0400 | [diff] [blame] | 189 | ospf6_clean(); |
Tom Goff | ae2254a | 2010-11-10 13:01:41 -0800 | [diff] [blame] | 190 | ospf6_exit (0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | /* SIGUSR1 handler. */ |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 194 | static void |
hasso | e42f5a3 | 2004-08-28 17:04:33 +0000 | [diff] [blame] | 195 | sigusr1 (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 196 | { |
| 197 | zlog_info ("SIGUSR1 received"); |
| 198 | zlog_rotate (NULL); |
| 199 | } |
| 200 | |
hasso | e42f5a3 | 2004-08-28 17:04:33 +0000 | [diff] [blame] | 201 | struct quagga_signal_t ospf6_signals[] = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 202 | { |
hasso | e42f5a3 | 2004-08-28 17:04:33 +0000 | [diff] [blame] | 203 | { |
| 204 | .signal = SIGHUP, |
| 205 | .handler = &sighup, |
| 206 | }, |
| 207 | { |
| 208 | .signal = SIGINT, |
| 209 | .handler = &sigint, |
| 210 | }, |
| 211 | { |
| 212 | .signal = SIGTERM, |
| 213 | .handler = &sigterm, |
| 214 | }, |
| 215 | { |
| 216 | .signal = SIGUSR1, |
| 217 | .handler = &sigusr1, |
| 218 | }, |
| 219 | }; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 220 | |
| 221 | /* Main routine of ospf6d. Treatment of argument and starting ospf finite |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 222 | state machine is handled here. */ |
| 223 | int |
| 224 | main (int argc, char *argv[], char *envp[]) |
| 225 | { |
| 226 | char *p; |
| 227 | int opt; |
| 228 | char *vty_addr = NULL; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 229 | int vty_port = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 230 | char *config_file = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 231 | struct thread thread; |
Paul Jakma | 876b8be | 2006-10-15 23:35:57 +0000 | [diff] [blame] | 232 | int dryrun = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 233 | |
| 234 | /* Set umask before anything for security */ |
| 235 | umask (0027); |
| 236 | |
| 237 | /* Preserve name of myself. */ |
| 238 | progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]); |
| 239 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 240 | /* Command line argument treatment. */ |
| 241 | while (1) |
| 242 | { |
Vyacheslav Trushkin | b511468 | 2011-11-25 18:51:48 +0400 | [diff] [blame] | 243 | opt = getopt_long (argc, argv, "df:i:z:hp:A:P:u:g:vC", longopts, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 244 | |
| 245 | if (opt == EOF) |
| 246 | break; |
| 247 | |
| 248 | switch (opt) |
| 249 | { |
| 250 | case 0: |
| 251 | break; |
| 252 | case 'd': |
| 253 | daemon_mode = 1; |
| 254 | break; |
| 255 | case 'f': |
| 256 | config_file = optarg; |
| 257 | break; |
| 258 | case 'A': |
| 259 | vty_addr = optarg; |
| 260 | break; |
| 261 | case 'i': |
| 262 | pid_file = optarg; |
| 263 | break; |
Vyacheslav Trushkin | b511468 | 2011-11-25 18:51:48 +0400 | [diff] [blame] | 264 | case 'z': |
| 265 | zclient_serv_path_set (optarg); |
| 266 | break; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 267 | case 'P': |
paul | 4fc4e7a | 2003-01-22 19:47:09 +0000 | [diff] [blame] | 268 | /* Deal with atoi() returning 0 on failure, and ospf6d not |
| 269 | listening on ospf6d port... */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 270 | if (strcmp(optarg, "0") == 0) |
paul | 4fc4e7a | 2003-01-22 19:47:09 +0000 | [diff] [blame] | 271 | { |
| 272 | vty_port = 0; |
| 273 | break; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 274 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 275 | vty_port = atoi (optarg); |
Paul Jakma | 0d6b2ee | 2008-05-29 18:29:16 +0000 | [diff] [blame] | 276 | if (vty_port <= 0 || vty_port > 0xffff) |
| 277 | vty_port = OSPF6_VTY_PORT; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 278 | break; |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 279 | case 'u': |
hasso | c065230 | 2004-11-25 19:33:48 +0000 | [diff] [blame] | 280 | ospf6d_privs.user = optarg; |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 281 | break; |
hasso | c065230 | 2004-11-25 19:33:48 +0000 | [diff] [blame] | 282 | case 'g': |
| 283 | ospf6d_privs.group = optarg; |
| 284 | break; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 285 | case 'v': |
| 286 | print_version (progname); |
| 287 | exit (0); |
| 288 | break; |
Paul Jakma | 876b8be | 2006-10-15 23:35:57 +0000 | [diff] [blame] | 289 | case 'C': |
| 290 | dryrun = 1; |
| 291 | break; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 292 | case 'h': |
| 293 | usage (progname, 0); |
| 294 | break; |
| 295 | default: |
| 296 | usage (progname, 1); |
| 297 | break; |
| 298 | } |
| 299 | } |
| 300 | |
Vyacheslav Trushkin | 6fd1620 | 2011-12-20 20:52:31 +0400 | [diff] [blame] | 301 | if (geteuid () != 0) |
| 302 | { |
| 303 | errno = EPERM; |
| 304 | perror (progname); |
| 305 | exit (1); |
| 306 | } |
| 307 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 308 | /* thread master */ |
| 309 | master = thread_master_create (); |
| 310 | |
| 311 | /* Initializations. */ |
ajs | 274a4a4 | 2004-12-07 15:39:31 +0000 | [diff] [blame] | 312 | zlog_default = openzlog (progname, ZLOG_OSPF6, |
paul | 79dc373 | 2004-07-23 15:17:45 +0000 | [diff] [blame] | 313 | LOG_CONS|LOG_NDELAY|LOG_PID, |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 314 | LOG_DAEMON); |
| 315 | zprivs_init (&ospf6d_privs); |
| 316 | /* initialize zebra libraries */ |
Balaji.G | 837d16c | 2012-09-26 14:09:10 +0530 | [diff] [blame] | 317 | signal_init (master, array_size(ospf6_signals), ospf6_signals); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 318 | cmd_init (1); |
paul | b21b19c | 2003-06-15 01:28:29 +0000 | [diff] [blame] | 319 | vty_init (master); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 320 | memory_init (); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 321 | if_init (); |
| 322 | access_list_init (); |
| 323 | prefix_list_init (); |
| 324 | |
| 325 | /* initialize ospf6 */ |
| 326 | ospf6_init (); |
| 327 | |
| 328 | /* sort command vector */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 329 | sort_node (); |
| 330 | |
| 331 | /* parse config file */ |
hasso | 320ec10 | 2004-06-20 19:54:37 +0000 | [diff] [blame] | 332 | vty_read_config (config_file, config_default); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 333 | |
Paul Jakma | 876b8be | 2006-10-15 23:35:57 +0000 | [diff] [blame] | 334 | /* Start execution only if not in dry-run mode */ |
| 335 | if (dryrun) |
| 336 | return(0); |
| 337 | |
Stephen Hemminger | 065de90 | 2009-08-07 11:13:49 -0700 | [diff] [blame] | 338 | if (daemon_mode && daemon (0, 0) < 0) |
| 339 | { |
| 340 | zlog_err("OSPF6d daemon failed: %s", strerror(errno)); |
| 341 | exit (1); |
| 342 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 343 | |
| 344 | /* pid file create */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 345 | pid_output (pid_file); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 346 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 347 | /* Make ospf6 vty socket. */ |
ajs | 887c44a | 2004-12-03 16:36:46 +0000 | [diff] [blame] | 348 | if (!vty_port) |
| 349 | vty_port = OSPF6_VTY_PORT; |
| 350 | vty_serv_sock (vty_addr, vty_port, OSPF6_VTYSH_PATH); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 351 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 352 | /* Print start message */ |
ajs | 887c44a | 2004-12-03 16:36:46 +0000 | [diff] [blame] | 353 | zlog_notice ("OSPF6d (Quagga-%s ospf6d-%s) starts: vty@%d", |
| 354 | QUAGGA_VERSION, OSPF6_DAEMON_VERSION,vty_port); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 355 | |
| 356 | /* Start finite state machine, here we go! */ |
| 357 | while (thread_fetch (master, &thread)) |
| 358 | thread_call (&thread); |
| 359 | |
| 360 | /* Log in case thread failed */ |
| 361 | zlog_warn ("Thread failed"); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 362 | |
| 363 | /* Not reached. */ |
Tom Goff | ae2254a | 2010-11-10 13:01:41 -0800 | [diff] [blame] | 364 | ospf6_exit (0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 365 | } |
| 366 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 367 | |