summaryrefslogtreecommitdiffstats
path: root/zebra/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/main.c')
-rw-r--r--zebra/main.c44
1 files changed, 19 insertions, 25 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 98177a423..459e6148d 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with GNU Zebra; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * 02111-1307, USA.
*/
#include <zebra.h>
@@ -43,11 +43,11 @@
#include "zebra/router-id.h"
#include "zebra/irdp.h"
#include "zebra/rtadv.h"
-#include "zebra/zebra_fpm.h"
#include "zebra/zebra_ptm.h"
#include "zebra/zebra_ns.h"
#include "zebra/redistribute.h"
#include "zebra/zebra_mpls.h"
+#include "zebra/label_manager.h"
#define ZEBRA_PTM_SUPPORT
@@ -78,14 +78,14 @@ u_int32_t nl_rcvbufsize = 4194304;
#endif /* HAVE_NETLINK */
/* Command line options. */
-struct option longopts[] =
+struct option longopts[] =
{
{ "batch", no_argument, NULL, 'b'},
{ "allow_delete", no_argument, NULL, 'a'},
{ "keep_kernel", no_argument, NULL, 'k'},
- { "fpm_format", required_argument, NULL, 'F'},
{ "socket", required_argument, NULL, 'z'},
{ "ecmp", required_argument, NULL, 'e'},
+ { "label_socket", no_argument, NULL, 'l'},
{ "retain", no_argument, NULL, 'r'},
#ifdef HAVE_NETLINK
{ "nl-bufsize", required_argument, NULL, 's'},
@@ -93,7 +93,7 @@ struct option longopts[] =
{ 0 }
};
-zebra_capabilities_t _caps_p [] =
+zebra_capabilities_t _caps_p [] =
{
ZCAP_NET_ADMIN,
ZCAP_SYS_ADMIN,
@@ -118,7 +118,7 @@ struct zebra_privs_t zserv_privs =
unsigned int multipath_num = MULTIPATH_NUM;
/* SIGHUP handler. */
-static void
+static void
sighup (void)
{
zlog_info ("SIGHUP received");
@@ -182,8 +182,8 @@ sigusr1 (void)
struct quagga_signal_t zebra_signals[] =
{
- {
- .signal = SIGHUP,
+ {
+ .signal = SIGHUP,
.handler = &sighup,
},
{
@@ -219,20 +219,21 @@ main (int argc, char **argv)
{
// int batch_mode = 0;
char *zserv_path = NULL;
- char *fpm_format = NULL;
+ /* Socket to external label manager */
+ char *lblmgr_path = NULL;
frr_preinit(&zebra_di, argc, argv);
- frr_opt_add("bakF:z:e:r"
+ frr_opt_add("bakz:e:l:r"
#ifdef HAVE_NETLINK
"s:"
#endif
, longopts,
" -b, --batch Runs in batch mode\n"
" -a, --allow_delete Allow other processes to delete zebra routes\n"
- " -F, --fpm_format Set fpm format to 'netlink' or 'protobuf'\n"
" -z, --socket Set path of zebra socket\n"
" -e, --ecmp Specify ECMP to use.\n"
+ " -l, --label_socket Socket to external label manager\n"\
" -k, --keep_kernel Don't delete old routes which installed by zebra.\n"
" -r, --retain When program terminates, retain added route by zebra.\n"
#ifdef HAVE_NETLINK
@@ -247,7 +248,7 @@ main (int argc, char **argv)
if (opt == EOF)
break;
- switch (opt)
+ switch (opt)
{
case 0:
break;
@@ -260,9 +261,6 @@ main (int argc, char **argv)
case 'k':
keep_kernel_mode = 1;
break;
- case 'F':
- fpm_format = optarg;
- break;
case 'e':
multipath_num = atoi (optarg);
if (multipath_num > MULTIPATH_NUM || multipath_num <= 0)
@@ -274,6 +272,9 @@ main (int argc, char **argv)
case 'z':
zserv_path = optarg;
break;
+ case 'l':
+ lblmgr_path = optarg;
+ break;
case 'r':
retain_mode = 1;
break;
@@ -320,16 +321,6 @@ main (int argc, char **argv)
/* Initialize NS( and implicitly the VRF module), and make kernel routing socket. */
zebra_ns_init ();
-#ifdef HAVE_SNMP
- zebra_snmp_init ();
-#endif /* HAVE_SNMP */
-
-#ifdef HAVE_FPM
- zfpm_init (zebrad.master, 1, 0, fpm_format);
-#else
- zfpm_init (zebrad.master, 0, 0, fpm_format);
-#endif
-
/* Process the configuration file. Among other configuration
* directives we can meet those installing static routes. Such
* requests will not be executed immediately, but queued in
@@ -359,6 +350,9 @@ main (int argc, char **argv)
/* This must be done only after locking pidfile (bug #403). */
zebra_zserv_socket_init (zserv_path);
+ /* Init label manager */
+ label_manager_init (lblmgr_path);
+
frr_run (zebrad.master);
/* Not reached... */