components/quagga/patches/70-isisd-trill.patch
branchs11-sru
changeset 2239 f0bde9a421fe
parent 417 7c10b5cba79b
child 855 e14713202945
equal deleted inserted replaced
2238:cc3545c342fd 2239:f0bde9a421fe
     1 diff --git configure.ac configure.ac
     1 diff --git configure.ac configure.ac
     2 index 78198cb..12e9729 100755
       
     3 --- configure.ac
     2 --- configure.ac
     4 +++ configure.ac
     3 +++ configure.ac
     5 @@ -197,6 +197,10 @@ AC_ARG_ENABLE(watchquagga,
     4 @@ -202,6 +202,8 @@
     6  [  --disable-watchquagga   do not build watchquagga])
     5  [  --disable-watchquagga   do not build watchquagga])
     7  AC_ARG_ENABLE(isisd,
     6  AC_ARG_ENABLE(isisd,
     8  [  --enable-isisd          build isisd])
     7  [  --enable-isisd          build isisd])
     9 +AC_ARG_ENABLE(trill,
     8 +AC_ARG_ENABLE(trill,
    10 +[  --enable-trill          include TRILL support])
     9 +[  --enable-trill          include trill support])
    11 +AC_ARG_ENABLE(solaris,
    10  AC_ARG_ENABLE(solaris,
    12 +[  --enable-solaris          build solaris])
    11  [  --enable-solaris          build solaris])
    13  AC_ARG_ENABLE(bgp-announce,
    12  AC_ARG_ENABLE(bgp-announce,
    14  [  --disable-bgp-announce, turn off BGP route announcement])
    13 @@ -328,6 +330,30 @@
    15  AC_ARG_ENABLE(netlink,
       
    16 @@ -311,6 +315,30 @@ AC_SUBST(ISIS_TOPOLOGY_INCLUDES)
       
    17  AC_SUBST(ISIS_TOPOLOGY_DIR)
    14  AC_SUBST(ISIS_TOPOLOGY_DIR)
    18  AC_SUBST(ISIS_TOPOLOGY_LIB)
    15  AC_SUBST(ISIS_TOPOLOGY_LIB)
    19  
    16  
    20 +if test "${enable_trill}" = "yes"; then
    17 +if test "${enable_trill}" = "yes"; then
    21 +  AC_CHECK_HEADER(net/trill.h)
    18 +  AC_CHECK_HEADER(net/trill.h)
    42 +AC_SUBST(ISIS_LIBS)
    39 +AC_SUBST(ISIS_LIBS)
    43 +
    40 +
    44  if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
    41  if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
    45    enable_user="quagga"
    42    enable_user="quagga"
    46  elif test "${enable_user}" = "no"; then
    43  elif test "${enable_user}" = "no"; then
    47 @@ -753,28 +781,31 @@ AC_SUBST(OTHER_METHOD)
    44 @@ -785,28 +811,31 @@
    48  dnl --------------------------
    45  AC_DEFINE(ISIS_METHOD_PFPACKET,	1, [ constant value for isis method pfpacket ])
    49  dnl Determine IS-IS I/O method
    46  AC_DEFINE(ISIS_METHOD_DLPI,	2, [ constant value for isis method dlpi ])
    50  dnl --------------------------
    47  AC_DEFINE(ISIS_METHOD_BPF,	3, [ constant value for isis method bpf ])
    51 -AC_CHECK_HEADER(net/bpf.h)
    48 -AC_CHECK_HEADER(net/bpf.h)
    52 -AC_CHECK_HEADER(sys/dlpi.h)
    49 -AC_CHECK_HEADER(sys/dlpi.h)
    53 -AC_MSG_CHECKING(zebra IS-IS I/O method)
    50 -AC_MSG_CHECKING(zebra IS-IS I/O method)
    54 -if test x"$opsys" = x"gnu-linux"; then
    51 -if test x"$opsys" = x"gnu-linux"; then
    55 -  AC_MSG_RESULT(pfpacket)
    52 -  AC_MSG_RESULT(pfpacket)
    56 -  ISIS_METHOD=isis_pfpacket.o
    53 -  ISIS_METHOD_MACRO="ISIS_METHOD_PFPACKET"
    57 -elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
    54 -elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
    58 -  AC_MSG_RESULT(DLPI)
    55 -  AC_MSG_RESULT(DLPI)
    59 -  ISIS_METHOD="isis_dlpi.o"
    56 -  ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
    60 -else
    57 -else
    61 -  if test $ac_cv_header_net_bpf_h = no; then
    58 -  if test $ac_cv_header_net_bpf_h = no; then
    62 -    if test $ac_cv_header_sys_dlpi_h = no; then
    59 -    if test $ac_cv_header_sys_dlpi_h = no; then
    63 -      AC_MSG_RESULT(none)
    60 -      AC_MSG_RESULT(none)
    64 -      AC_MSG_WARN([*** IS-IS support will not be built ***])
    61 -      AC_MSG_WARN([*** IS-IS support will not be built ***])
    65 -      ISISD=""
    62 -      ISISD=""
    66 -    else
    63 -    else
    67 -      AC_MSG_RESULT(DLPI)
    64 -      AC_MSG_RESULT(DLPI)
    68 -    fi
    65 -    fi
    69 +if test "${enable_isisd}" = "yes"; then
    66 +if test "${enable_isisd}" = "yes"; then
    70 +  ISIS_METHOD=
    67 +  ISIS_METHOD_MACRO=
    71 +  AC_CHECK_HEADER(net/bpf.h)
    68 +  AC_CHECK_HEADER(net/bpf.h)
    72 +  AC_CHECK_HEADER(sys/dlpi.h)
    69 +  AC_CHECK_HEADER(sys/dlpi.h)
    73 +  AC_MSG_CHECKING(zebra IS-IS I/O method)
    70 +  AC_MSG_CHECKING(zebra IS-IS I/O method)
    74 +  if test x"$opsys" = x"gnu-linux"; then
    71 +  if test x"$opsys" = x"gnu-linux"; then
    75 +    AC_MSG_RESULT(pfpacket)
    72 +    AC_MSG_RESULT(pfpacket)
    76 +    ISIS_METHOD=isis_pfpacket.o
    73 +    ISIS_METHOD_MACRO="ISIS_METHOD_PFPACKET"
    77 +  elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
    74 +  elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
    78 +    AC_MSG_RESULT(DLPI)
    75 +    AC_MSG_RESULT(DLPI)
    79      ISIS_METHOD="isis_dlpi.o"
    76      ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
    80    else
    77    else
    81 -    AC_MSG_RESULT(BPF)
    78 -    AC_MSG_RESULT(BPF)
    82 -    ISIS_METHOD="isis_bpf.o"
    79 -    ISIS_METHOD_MACRO="ISIS_METHOD_BPF"
    83 +    if test $ac_cv_header_net_bpf_h = no; then
    80 +    if test $ac_cv_header_net_bpf_h = no; then
    84 +      if test $ac_cv_header_sys_dlpi_h = no; then
    81 +      if test $ac_cv_header_sys_dlpi_h = no; then
    85 +	AC_MSG_RESULT(none)
    82 +        AC_MSG_RESULT(none)
    86 +	AC_MSG_WARN([*** IS-IS support will not be built ***])
    83 +        AC_MSG_WARN([*** IS-IS support will not be built ***])
    87 +	ISISD=""
    84 +        ISISD=""
    88 +      else
    85 +      else
    89 +	AC_MSG_RESULT(DLPI)
    86 +        AC_MSG_RESULT(DLPI)
    90 +      fi
    87 +      fi
    91 +      ISIS_METHOD="isis_dlpi.o"
    88 +      ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
    92 +    else
    89 +    else
    93 +      AC_MSG_RESULT(BPF)
    90 +      AC_MSG_RESULT(BPF)
    94 +      ISIS_METHOD="isis_bpf.o"
    91 +      ISIS_METHOD_MACRO="ISIS_METHOD_BPF"
    95 +    fi
    92 +    fi
    96    fi
    93    fi
    97  fi
    94  fi
    98  AC_SUBST(ISIS_METHOD)
    95  AC_DEFINE_UNQUOTED(ISIS_METHOD, $ISIS_METHOD_MACRO, [ selected method for isis, == one of the constants ])
    99 diff --git isisd/Makefile.am isisd/Makefile.am
    96 diff --git isisd/Makefile.am isisd/Makefile.am
   100 index 859facd..9adcc05 100644
    97 index 859facd..9adcc05 100644
   101 --- isisd/Makefile.am
    98 --- isisd/Makefile.am
   102 +++ isisd/Makefile.am
    99 +++ isisd/Makefile.am
   103 @@ -4,10 +4,11 @@ INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib \
   100 @@ -4,14 +4,15 @@
   104  	   @ISIS_TOPOLOGY_INCLUDES@
   101  	   @ISIS_TOPOLOGY_INCLUDES@
   105  DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
   102  DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
   106  INSTALL_SDATA=@INSTALL@ -m 600
   103  INSTALL_SDATA=@INSTALL@ -m 600
   107 -LIBS = @LIBS@ 
   104 -LIBS = @LIBS@ 
   108 +LIBS = @LIBS@ @ISIS_LIBS@
   105 +LIBS = @LIBS@ @ISIS_LIBS@
       
   106  
       
   107  AM_CFLAGS = $(PICFLAGS)
       
   108  AM_LDFLAGS = $(PILDFLAGS)
       
   109  
   109  noinst_LIBRARIES = libisis.a
   110  noinst_LIBRARIES = libisis.a
   110 -sbin_PROGRAMS = isisd 
   111 -sbin_PROGRAMS = isisd 
   111 +sbin_PROGRAMS = @ISIS_TARGETS@
   112 +sbin_PROGRAMS = @ISIS_TARGETS@
   112  SUBDIRS = topology
   113  SUBDIRS = topology
   113 +EXTRA_PROGRAMS = isisd trilld
   114 +EXTRA_PROGRAMS = isisd trilld
   114  
   115  
   115  isis_method = @ISIS_METHOD@
   116  libisis_a_SOURCES = \
   116  
   117  	isis_adjacency.c isis_lsp.c dict.c isis_circuit.c isis_pdu.c \
   117 @@ -23,16 +24,24 @@ noinst_HEADERS = \
   118 @@ -25,13 +26,23 @@
   118  	isis_lsp.h dict.h isis_circuit.h isis_misc.h isis_network.h \
   119  	isis_lsp.h dict.h isis_circuit.h isis_misc.h isis_network.h \
   119  	isis_zebra.h isis_dr.h isis_flags.h isis_dynhn.h isis_common.h \
   120  	isis_zebra.h isis_dr.h isis_flags.h isis_dynhn.h isis_common.h \
   120  	iso_checksum.h isis_csm.h isis_events.h isis_spf.h isis_route.h \
   121  	iso_checksum.h isis_csm.h isis_events.h isis_spf.h isis_route.h \
   121 +	isis_trill.h \
   122 +	isis_trill.h \
   122  	include-netbsd/clnp.h include-netbsd/esis.h include-netbsd/iso.h
   123  	include-netbsd/clnp.h include-netbsd/esis.h include-netbsd/iso.h
   123  
   124  
   124  isisd_SOURCES = \
   125  isisd_SOURCES = \
   125 -	isis_main.c $(libisis_a_SOURCES)
   126  	isis_main.c $(libisis_a_SOURCES) \
   126 +	isis_main.c $(libisis_a_SOURCES) isis_trilldummy.c
   127 -	isis_bpf.c isis_dlpi.c isis_pfpacket.c
   127  
   128 +	isis_bpf.c isis_dlpi.c isis_pfpacket.c isis_trilldummy.c
   128 -isisd_LDADD = $(isis_method) @ISIS_TOPOLOGY_LIB@ ../lib/libzebra.la @LIBCAP@
   129  
   129 +isisd_LDADD = $(isis_method) @ISIS_TOPOLOGY_LIB@ ../lib/libzebra.la @LIBCAP@ @LIBM@
   130 -isisd_LDADD = @ISIS_TOPOLOGY_LIB@ ../lib/libzebra.la @LIBCAP@
   130  
   131 +isisd_LDADD = @ISIS_TOPOLOGY_LIB@ ../lib/libzebra.la @LIBCAP@ @LIBM@
   131  isisd_DEPENDENCIES = $(isis_method)
   132  
   132  
       
   133 -EXTRA_DIST = isis_bpf.c isis_dlpi.c isis_pfpacket.c
       
   134 +trilld_SOURCES = \
   133 +trilld_SOURCES = \
   135 +	isis_main.c $(libisis_a_SOURCES) isis_trill.c isis_trillio.c \
   134 +	isis_main.c $(libisis_a_SOURCES) isis_trill.c isis_trillio.c \
   136 +	isis_trillvlans.c isis_trillbpdu.c
   135 +	isis_trillvlans.c isis_trillbpdu.c
   137 +
   136 +
   138 +trilld_LDADD = @ISIS_TOPOLOGY_LIB@ ../lib/libzebra.la @LIBCAP@ @LIBM@
   137 +trilld_LDADD = @ISIS_TOPOLOGY_LIB@ ../lib/libzebra.la @LIBCAP@ @LIBM@
   139 +
   138 +
   140 +EXTRA_DIST = isis_bpf.c isis_dlpi.c isis_pfpacket.c isis_trill.c \
   139 +EXTRA_DIST = isis_bpf.c isis_dlpi.c isis_pfpacket.c isis_trill.c \
   141 +	isis_trillio.c isis_trillvlans.c isis_trillbpdu.c
   140 +	isis_trillio.c isis_trillvlans.c isis_trillbpdu.c
   142  
   141 +
   143  examplesdir = $(exampledir)
   142  examplesdir = $(exampledir)
   144  dist_examples_DATA = isisd.conf.sample
   143  dist_examples_DATA = isisd.conf.sample
   145 diff --git isisd/bool.h isisd/bool.h
   144 diff --git isisd/bool.h isisd/bool.h
   146 new file mode 100644
   145 new file mode 100644
   147 index 0000000..e713d65
   146 index 0000000..e713d65
   596  	  isis_event_circuit_state_change (circuit, 0);
   595  	  isis_event_circuit_state_change (circuit, 0);
   597 diff --git isisd/isis_dlpi.c isisd/isis_dlpi.c
   596 diff --git isisd/isis_dlpi.c isisd/isis_dlpi.c
   598 index 07ab547..5837201 100644
   597 index 07ab547..5837201 100644
   599 --- isisd/isis_dlpi.c
   598 --- isisd/isis_dlpi.c
   600 +++ isisd/isis_dlpi.c
   599 +++ isisd/isis_dlpi.c
   601 @@ -21,6 +21,8 @@
   600 @@ -21,6 +21,7 @@
   602   */
   601   */
   603  
   602  
   604  #include <zebra.h>
   603  #include <zebra.h>
   605 +#include <vty.h>
   604 +#include <vty.h>
   606 +
   605  #if ISIS_METHOD == ISIS_METHOD_DLPI
   607  #include <net/if.h>
   606  #include <net/if.h>
   608  #include <netinet/if_ether.h>
   607  #include <netinet/if_ether.h>
   609  #include <sys/types.h>
   608 @@ -302,7 +303,7 @@
   610 @@ -301,7 +303,7 @@ dlpiaddr (int fd, u_char *addr)
       
   611  static int
   609  static int
   612  open_dlpi_dev (struct isis_circuit *circuit)
   610  open_dlpi_dev (struct isis_circuit *circuit)
   613  {
   611  {
   614 -  int fd, unit, retval;
   612 -  int fd, unit, retval;
   615 +  int fd = -1, unit, retval;
   613 +  int fd = -1, unit, retval;
   616    char devpath[MAXPATHLEN];
   614    char devpath[MAXPATHLEN];
   617    dl_info_ack_t *dia = (dl_info_ack_t *)dlpi_ctl;
   615    dl_info_ack_t *dia = (dl_info_ack_t *)dlpi_ctl;
   618    ssize_t acklen;
   616    ssize_t acklen;
   619 @@ -313,20 +315,21 @@ open_dlpi_dev (struct isis_circuit *circuit)
   617 @@ -314,20 +315,21 @@
   620  	circuit->interface->name);
   618  	circuit->interface->name);
   621        return ISIS_WARNING;
   619        return ISIS_WARNING;
   622      }
   620      }
   623 -  
   621 -  
   624 +
   622 +
   643 +      (void) snprintf(devpath, sizeof (devpath), "/dev/%s",
   641 +      (void) snprintf(devpath, sizeof (devpath), "/dev/%s",
   644 +        circuit->interface->name);
   642 +        circuit->interface->name);
   645        unit = -1;
   643        unit = -1;
   646        fd = dlpiopen (devpath, &acklen);
   644        fd = dlpiopen (devpath, &acklen);
   647      }
   645      }
   648 @@ -402,8 +405,8 @@ open_dlpi_dev (struct isis_circuit *circuit)
   646 @@ -403,8 +405,8 @@
   649      case DL_100BT:
   647      case DL_100BT:
   650        break;
   648        break;
   651      default:
   649      default:
   652 -      zlog_warn ("%s: unexpected mac type on %s: %d", __func__,
   650 -      zlog_warn ("%s: unexpected mac type on %s: %d", __func__,
   653 -	circuit->interface->name, dia->dl_mac_type);
   651 -	circuit->interface->name, dia->dl_mac_type);
   654 +      zlog_warn ("%s: unexpected mac type on %s: %ld", __func__,
   652 +      zlog_warn ("%s: unexpected mac type on %s: %ld", __func__,
   655 +	circuit->interface->name, (u_long)dia->dl_mac_type);
   653 +	circuit->interface->name, (u_long)dia->dl_mac_type);
   656        close (fd);
   654        close (fd);
   657        return ISIS_WARNING;
   655        return ISIS_WARNING;
   658      }
   656      }
   659 @@ -471,9 +474,9 @@ open_dlpi_dev (struct isis_circuit *circuit)
       
   660        sioc.ic_timout = 5;
       
   661        sioc.ic_len = sizeof (struct packetfilt);
       
   662        sioc.ic_dp = (char *)&pfil;
       
   663 -      if (ioctl (fd, I_STR, &sioc) == -1)
       
   664 +      if (ioctl (fd, I_STR, &sioc) == -1) 
       
   665           zlog_warn("%s: could not perform PF_IOCSETF on %s",
       
   666 -           __func__, circuit->interface->name);
       
   667 +   	    __func__, circuit->interface->name);
       
   668      }
       
   669  
       
   670    circuit->fd = fd;
       
   671 diff --git isisd/isis_dr.c isisd/isis_dr.c
   657 diff --git isisd/isis_dr.c isisd/isis_dr.c
   672 index 8d306c8..a481142 100644
   658 index 8d306c8..a481142 100644
   673 --- isisd/isis_dr.c
   659 --- isisd/isis_dr.c
   674 +++ isisd/isis_dr.c
   660 +++ isisd/isis_dr.c
   675 @@ -207,17 +207,16 @@ isis_dr_elect (struct isis_circuit *circuit, int level)
   661 @@ -207,17 +207,16 @@ isis_dr_elect (struct isis_circuit *circuit, int level)
  1085 +  ZCAP_BIND,
  1071 +  ZCAP_BIND,
  1086 +  ZCAP_EXEC
  1072 +  ZCAP_EXEC
  1087  };
  1073  };
  1088  
  1074  
  1089  struct zebra_privs_t isisd_privs = {
  1075  struct zebra_privs_t isisd_privs = {
  1090 @@ -66,7 +78,7 @@ struct zebra_privs_t isisd_privs = {
  1076 @@ -66,7 +78,7 @@
  1091    .vty_group = VTY_GROUP,
  1077    .vty_group = VTY_GROUP,
  1092  #endif
  1078  #endif
  1093    .caps_p = _caps_p,
  1079    .caps_p = _caps_p,
  1094 -  .cap_num_p = 2,
  1080 -  .cap_num_p = 2,
  1095 +  .cap_num_p = sizeof (_caps_p) / sizeof (*_caps_p),
  1081 +  .cap_num_p = sizeof (_caps_p) / sizeof (*_caps_p),
  1096    .cap_num_i = 0
  1082    .cap_num_i = 0
  1097  };
  1083  };
  1098  
  1084  
  1099 @@ -151,7 +163,10 @@ reload ()
  1085 @@ -151,7 +163,10 @@
  1100    zlog_debug ("Reload");
  1086    zlog_debug ("Reload");
  1101    /* FIXME: Clean up func call here */
  1087    /* FIXME: Clean up func call here */
  1102    vty_reset ();
  1088    vty_reset ();
  1103 +  (void) isisd_privs.change (ZPRIVS_RAISE);
  1089 +  (void) isisd_privs.change (ZPRIVS_RAISE);
  1104    execve (_progpath, _argv, _envp);
  1090    execve (_progpath, _argv, _envp);
  1105 +  zlog_err ("Reload failed: cannot exec %s: %s", _progpath,
  1091 +  zlog_err ("Reload failed: cannot exec %s: %s", _progpath,
  1106 +      safe_strerror (errno));
  1092 +      safe_strerror (errno));
  1107  }
  1093  }
  1108  
  1094  
  1109  static void
  1095  static void
  1110 @@ -168,6 +183,9 @@ void
  1096 @@ -168,6 +183,9 @@
  1111  sighup (void)
  1097  sighup (void)
  1112  {
  1098  {
  1113    zlog_debug ("SIGHUP received");
  1099    zlog_debug ("SIGHUP received");
  1114 +#ifdef HAVE_TRILL
  1100 +#ifdef HAVE_TRILL
  1115 +  if (!trill_reload())
  1101 +  if (!trill_reload())
  1116 +#endif
  1102 +#endif
  1117    reload ();
  1103    reload ();
  1118  
  1104  
  1119    return;
  1105    return;
  1120 @@ -227,6 +245,11 @@ main (int argc, char **argv, char **envp)
  1106 @@ -227,6 +245,11 @@
  1121    char *vty_addr = NULL;
  1107    char *vty_addr = NULL;
  1122    int dryrun = 0;
  1108    int dryrun = 0;
  1123  
  1109  
  1124 +#if defined(__sparc) && __GNUC__ == 3
  1110 +#if defined(__sparc) && __GNUC__ == 3
  1125 +  /* work around alignment problems in gcc 3.x on SPARC */
  1111 +  /* work around alignment problems in gcc 3.x on SPARC */
  1127 +#endif
  1113 +#endif
  1128 +
  1114 +
  1129    /* Get the programname without the preceding path. */
  1115    /* Get the programname without the preceding path. */
  1130    progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]);
  1116    progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]);
  1131  
  1117  
  1132 @@ -319,6 +342,22 @@ main (int argc, char **argv, char **envp)
  1118 @@ -319,6 +342,22 @@
  1133    memory_init ();
  1119    memory_init ();
  1134    access_list_init();
  1120    access_list_init();
  1135    isis_init ();
  1121    isis_init ();
  1136 +  isis_circuit_init ();
  1122 +  isis_circuit_init ();
  1137 +  isis_spf_cmds_init ();
  1123 +  isis_spf_cmds_init ();
  1150 +  isis_zebra_init ();
  1136 +  isis_zebra_init ();
  1151 +
  1137 +
  1152    dyn_cache_init ();
  1138    dyn_cache_init ();
  1153    sort_node ();
  1139    sort_node ();
  1154  
  1140  
  1155 @@ -337,7 +376,8 @@ main (int argc, char **argv, char **envp)
  1141 @@ -340,7 +379,8 @@
  1156      daemon (0, 0);
  1142      }
  1157  
  1143  
  1158    /* Process ID file creation. */
  1144    /* Process ID file creation. */
  1159 -  pid_output (pid_file);
  1145 -  pid_output (pid_file);
  1160 +  if (pid_file[0] != '\0')
  1146 +  if (pid_file[0] != '\0')
  1161 +    pid_output (pid_file);
  1147 +    pid_output (pid_file);
  7905 +#ifdef HAVE_TRILL
  7891 +#ifdef HAVE_TRILL
  7906 +#define DEBUG_TRILL_EVENTS		 (1<<12)
  7892 +#define DEBUG_TRILL_EVENTS		 (1<<12)
  7907 +#endif
  7893 +#endif
  7908  
  7894  
  7909  #endif /* ISISD_H */
  7895  #endif /* ISISD_H */
  7910 diff --git lib/command.c lib/command.c
       
  7911 index 270bf0d..2c8d752 100644
       
  7912 --- lib/command.c
       
  7913 +++ lib/command.c
       
  7914 @@ -193,8 +193,8 @@ install_node (struct cmd_node *node,
       
  7915  static int
       
  7916  cmp_node (const void *p, const void *q)
       
  7917  {
       
  7918 -  const struct cmd_element *a = *(struct cmd_element **)p;
       
  7919 -  const struct cmd_element *b = *(struct cmd_element **)q;
       
  7920 +  const struct cmd_element *a = *(struct cmd_element * const *)p;
       
  7921 +  const struct cmd_element *b = *(struct cmd_element * const *)q;
       
  7922  
       
  7923    return strcmp (a->string, b->string);
       
  7924  }
       
  7925 @@ -202,8 +202,8 @@ cmp_node (const void *p, const void *q)
       
  7926  static int
       
  7927  cmp_desc (const void *p, const void *q)
       
  7928  {
       
  7929 -  const struct desc *a = *(struct desc **)p;
       
  7930 -  const struct desc *b = *(struct desc **)q;
       
  7931 +  const struct desc *a = *(struct desc * const *)p;
       
  7932 +  const struct desc *b = *(struct desc * const *)q;
       
  7933  
       
  7934    return strcmp (a->cmd, b->cmd);
       
  7935  }
       
  7936 @@ -491,8 +491,11 @@ install_element (enum node_type ntype, struct cmd_element *cmd)
       
  7937  
       
  7938    vector_set (cnode->cmd_vector, cmd);
       
  7939  
       
  7940 -  cmd->strvec = cmd_make_descvec (cmd->string, cmd->doc);
       
  7941 -  cmd->cmdsize = cmd_cmdsize (cmd->strvec);
       
  7942 +  if (cmd->strvec == NULL)
       
  7943 +    {
       
  7944 +      cmd->strvec = cmd_make_descvec (cmd->string, cmd->doc);
       
  7945 +      cmd->cmdsize = cmd_cmdsize (cmd->strvec);
       
  7946 +    }
       
  7947  }
       
  7948  
       
  7949  static unsigned char itoa64[] =	
       
  7950 @@ -3497,6 +3500,8 @@ DEFUN (no_banner_motd,
       
  7951  void
       
  7952  host_config_set (char *filename)
       
  7953  {
       
  7954 +  if (host.config != NULL)
       
  7955 +    XFREE (MTYPE_HOST, host.config);
       
  7956    host.config = XSTRDUP (MTYPE_HOST, filename);
       
  7957  }
       
  7958  
       
  7959 diff --git lib/command.h lib/command.h
  7896 diff --git lib/command.h lib/command.h
  7960 index a725378..fefa6d3 100644
  7897 index a725378..fefa6d3 100644
  7961 --- lib/command.h
  7898 --- lib/command.h
  7962 +++ lib/command.h
  7899 +++ lib/command.h
  7963 @@ -302,6 +302,8 @@ struct desc
  7900 @@ -303,6 +303,8 @@
  7964  #define OSPF6_DUMP_TYPE_LIST \
  7901  #define OSPF6_DUMP_TYPE_LIST \
  7965  "(neighbor|interface|area|lsa|zebra|config|dbex|spf|route|lsdb|redistribute|hook|asbr|prefix|abr)"
  7902  "(neighbor|interface|area|lsa|zebra|config|dbex|spf|route|lsdb|redistribute|hook|asbr|prefix|abr)"
  7966  #define ISIS_STR "IS-IS information\n"
  7903  #define ISIS_STR "IS-IS information\n"
  7967 +#define TRILL_STR "TRILL IS-IS information\n"
  7904 +#define TRILL_STR "TRILL IS-IS information\n"
  7968 +#define TRILL_NICK_STR "Configure TRILL RBridge nickname information\n"
  7905 +#define TRILL_NICK_STR "Configure TRILL RBridge nickname information\n"
  7969  #define AREA_TAG_STR "[area tag]\n"
  7906  #define AREA_TAG_STR "[area tag]\n"
  7970  
  7907  
  7971  #define CONF_BACKUP_EXT ".sav"
  7908  #define CONF_BACKUP_EXT ".sav"
  7972 @@ -359,5 +361,5 @@ extern void host_config_set (char *);
       
  7973  extern void print_version (const char *);
       
  7974  
       
  7975  /* struct host global, ick */
       
  7976 -extern struct host host; 
       
  7977 +extern struct host host;
       
  7978  #endif /* _ZEBRA_COMMAND_H */
       
  7979 diff --git lib/linklist.c lib/linklist.c
       
  7980 index 11e16a8..a16e9e1 100644
       
  7981 --- lib/linklist.c
       
  7982 +++ lib/linklist.c
       
  7983 @@ -65,7 +65,9 @@ void
       
  7984  listnode_add (struct list *list, void *val)
       
  7985  {
       
  7986    struct listnode *node;
       
  7987 -
       
  7988 +  
       
  7989 +  assert (val != NULL);
       
  7990 +  
       
  7991    node = listnode_new ();
       
  7992  
       
  7993    node->prev = list->tail;
       
  7994 @@ -91,7 +93,9 @@ listnode_add_sort (struct list *list, void *val)
       
  7995  {
       
  7996    struct listnode *n;
       
  7997    struct listnode *new;
       
  7998 -
       
  7999 +  
       
  8000 +  assert (val != NULL);
       
  8001 +  
       
  8002    new = listnode_new ();
       
  8003    new->data = val;
       
  8004  
       
  8005 @@ -130,7 +134,9 @@ void
       
  8006  listnode_add_after (struct list *list, struct listnode *pp, void *val)
       
  8007  {
       
  8008    struct listnode *nn;
       
  8009 -
       
  8010 +  
       
  8011 +  assert (val != NULL);
       
  8012 +  
       
  8013    nn = listnode_new ();
       
  8014    nn->data = val;
       
  8015  
       
  8016 @@ -158,6 +164,7 @@ listnode_add_after (struct list *list, struct listnode *pp, void *val)
       
  8017  
       
  8018        pp->next = nn;
       
  8019      }
       
  8020 +  list->count++;
       
  8021  }
       
  8022  
       
  8023  
       
  8024 @@ -265,7 +272,9 @@ void
       
  8025  list_add_node_prev (struct list *list, struct listnode *current, void *val)
       
  8026  {
       
  8027    struct listnode *node;
       
  8028 -
       
  8029 +  
       
  8030 +  assert (val != NULL);
       
  8031 +  
       
  8032    node = listnode_new ();
       
  8033    node->next = current;
       
  8034    node->data = val;
       
  8035 @@ -286,7 +295,9 @@ void
       
  8036  list_add_node_next (struct list *list, struct listnode *current, void *val)
       
  8037  {
       
  8038    struct listnode *node;
       
  8039 -
       
  8040 +  
       
  8041 +  assert (val != NULL);
       
  8042 +  
       
  8043    node = listnode_new ();
       
  8044    node->prev = current;
       
  8045    node->data = val;
       
  8046 diff --git lib/memory.c lib/memory.c
       
  8047 index eb67072..9ed5e10 100644
       
  8048 --- lib/memory.c
       
  8049 +++ lib/memory.c
       
  8050 @@ -501,7 +501,7 @@ mtype_memstr (char *buf, size_t len, unsigned long bytes)
       
  8051         * Just hacked to make it not warn on 'smaller' machines. 
       
  8052         * Static compiler analysis should mean no extra code
       
  8053         */
       
  8054 -      if (bytes & (1 << (sizeof (unsigned long) >= 8 ? 39 : 0)))
       
  8055 +      if (bytes & (1UL << (sizeof (unsigned long) >= 8 ? 39 : 0)))
       
  8056          t++;
       
  8057        snprintf (buf, len, "%4d TiB", t);
       
  8058      }
       
  8059 diff --git lib/memtypes.c lib/memtypes.c
  7909 diff --git lib/memtypes.c lib/memtypes.c
  8060 index c7028c9..476ad35 100644
  7910 index c7028c9..476ad35 100644
  8061 --- lib/memtypes.c
  7911 --- lib/memtypes.c
  8062 +++ lib/memtypes.c
  7912 +++ lib/memtypes.c
  8063 @@ -225,20 +225,32 @@ struct memory_list memory_list_ospf6[] =
  7913 @@ -228,20 +228,32 @@
  8064  
  7914  
  8065  struct memory_list memory_list_isis[] =
  7915  struct memory_list memory_list_isis[] =
  8066  {
  7916  {
  8067 -  { MTYPE_ISIS,               "ISIS"				},
  7917 -  { MTYPE_ISIS,               "ISIS"				},
  8068 -  { MTYPE_ISIS_TMP,           "ISIS TMP"			},
  7918 -  { MTYPE_ISIS_TMP,           "ISIS TMP"			},
  8105 +  { MTYPE_ISIS_TRILL_VLANSUBTLV, "ISIS TRILL VLAN subTLV construction" },
  7955 +  { MTYPE_ISIS_TRILL_VLANSUBTLV, "ISIS TRILL VLAN subTLV construction" },
  8106 +  { MTYPE_ISIS_TRILL_INHIB,	 "ISIS TRILL VLAN inhibit entry" },
  7956 +  { MTYPE_ISIS_TRILL_INHIB,	 "ISIS TRILL VLAN inhibit entry" },
  8107    { -1, NULL },
  7957    { -1, NULL },
  8108  };
  7958  };
  8109  
  7959  
  8110 diff --git lib/memtypes.h lib/memtypes.h
  7960 diff --git lib/memtypes.h /dev/null
  8111 deleted file mode 100644
  7961 deleted file mode 100644
  8112 index 2d90e80..0000000
  7962 index 2d90e80..0000000
  8113 --- lib/memtypes.h
  7963 --- lib/memtypes.h
  8114 +++ /dev/null
  7964 +++ /dev/null
  8115 @@ -1,206 +0,0 @@
  7965 @@ -1,209 +0,0 @@
  8116 -/* Auto-generated from memtypes.c by gawk. */
  7966 -/* Auto-generated from memtypes.c by gawk. */
  8117 -/* Do not edit! */
  7967 -/* Do not edit! */
  8118 -
  7968 -
  8119 -#ifndef _QUAGGA_MEMTYPES_H
  7969 -#ifndef _QUAGGA_MEMTYPES_H
  8120 -#define _QUAGGA_MEMTYPES_H
  7970 -#define _QUAGGA_MEMTYPES_H
  8186 -  MTYPE_RIB,
  8036 -  MTYPE_RIB,
  8187 -  MTYPE_RIB_QUEUE,
  8037 -  MTYPE_RIB_QUEUE,
  8188 -  MTYPE_STATIC_IPV4,
  8038 -  MTYPE_STATIC_IPV4,
  8189 -  MTYPE_STATIC_IPV6,
  8039 -  MTYPE_STATIC_IPV6,
  8190 -  MTYPE_BGP,
  8040 -  MTYPE_BGP,
       
  8041 -  MTYPE_BGP_LISTENER,
  8191 -  MTYPE_BGP_PEER,
  8042 -  MTYPE_BGP_PEER,
  8192 -  MTYPE_BGP_PEER_HOST,
  8043 -  MTYPE_BGP_PEER_HOST,
  8193 -  MTYPE_PEER_GROUP,
  8044 -  MTYPE_PEER_GROUP,
  8194 -  MTYPE_PEER_DESC,
  8045 -  MTYPE_PEER_DESC,
       
  8046 -  MTYPE_PEER_PASSWORD,
  8195 -  MTYPE_ATTR,
  8047 -  MTYPE_ATTR,
  8196 -  MTYPE_ATTR_EXTRA,
  8048 -  MTYPE_ATTR_EXTRA,
  8197 -  MTYPE_AS_PATH,
  8049 -  MTYPE_AS_PATH,
  8198 -  MTYPE_AS_SEG,
  8050 -  MTYPE_AS_SEG,
  8199 -  MTYPE_AS_SEG_DATA,
  8051 -  MTYPE_AS_SEG_DATA,
  8200 -  MTYPE_AS_STR,
  8052 -  MTYPE_AS_STR,
  8201 -  MTYPE_BGP_TABLE,
  8053 -  MTYPE_BGP_TABLE,
  8202 -  MTYPE_BGP_NODE,
  8054 -  MTYPE_BGP_NODE,
  8203 -  MTYPE_BGP_ROUTE,
  8055 -  MTYPE_BGP_ROUTE,
  8204 -  MTYPE_BGP_ROUTE_EXTRA,
  8056 -  MTYPE_BGP_ROUTE_EXTRA,
       
  8057 -  MTYPE_BGP_CONN,
  8205 -  MTYPE_BGP_STATIC,
  8058 -  MTYPE_BGP_STATIC,
  8206 -  MTYPE_BGP_ADVERTISE_ATTR,
  8059 -  MTYPE_BGP_ADVERTISE_ATTR,
  8207 -  MTYPE_BGP_ADVERTISE,
  8060 -  MTYPE_BGP_ADVERTISE,
  8208 -  MTYPE_BGP_SYNCHRONISE,
  8061 -  MTYPE_BGP_SYNCHRONISE,
  8209 -  MTYPE_BGP_ADJ_IN,
  8062 -  MTYPE_BGP_ADJ_IN,
  8382      SIGHUP,
  8235      SIGHUP,
  8383 diff --git solaris/Makefile.am solaris/Makefile.am
  8236 diff --git solaris/Makefile.am solaris/Makefile.am
  8384 index acccbdb..3520bc5 100644
  8237 index acccbdb..3520bc5 100644
  8385 --- solaris/Makefile.am
  8238 --- solaris/Makefile.am
  8386 +++ solaris/Makefile.am
  8239 +++ solaris/Makefile.am
  8387 @@ -12,7 +12,7 @@ pkg_depends := $(pkg_names:%=depend.%)
  8240 @@ -14,7 +14,7 @@
  8388  pkg_packages := $(pkg_names:%=@PACKAGE_TARNAME@-%-$(pkg_name_rev).pkg)
  8241  pkg_packages = $(pkg_names:%=@PACKAGE_TARNAME@-%-$(pkg_name_rev).pkg)
  8389  pkg_pkginfos := $(pkg_names:%=pkginfo.%.full)
  8242  pkg_pkginfos = $(pkg_names:%=pkginfo.%.full)
  8390  pkg_prototypes := $(pkg_names:%=prototype.%)
  8243  pkg_prototypes = $(pkg_names:%=prototype.%)
  8391 -pkg_manifests := quagga.xml
  8244 -pkg_manifests = quagga.xml
  8392 +pkg_manifests := quagga.xml trill.xml
  8245 +pkg_manifests = quagga.xml trill.xml
  8393  
  8246  
  8394  # pkgmk variable substitutions wont grok ${variable} in prototype
  8247  # pkgmk variable substitutions wont grok ${variable} in prototype
  8395  # file, so we cant let autoconf generate the file sadly
  8248  # file, so we cant let autoconf generate the file sadly
  8396 diff --git solaris/trill.xml.in solaris/trill.xml.in
  8249 diff --git solaris/trill.xml.in solaris/trill.xml.in
  8397 new file mode 100644
  8250 new file mode 100644
  8456 +		name='start'
  8309 +		name='start'
  8457 +		exec='/usr/sbin/trilld -i "" -P 0 %i &amp;'
  8310 +		exec='/usr/sbin/trilld -i "" -P 0 %i &amp;'
  8458 +		timeout_seconds='60'>
  8311 +		timeout_seconds='60'>
  8459 +		<method_context>
  8312 +		<method_context>
  8460 +		  <method_credential
  8313 +		  <method_credential
  8461 +		   user='root' group='root'/>
  8314 +		   user='root' group='root' />
  8462 + 		</method_context>
  8315 + 		</method_context>
  8463 +	</exec_method>
  8316 +	</exec_method>
  8464 +
  8317 +
  8465 +	<exec_method
  8318 +	<exec_method
  8466 +		type='method'
  8319 +		type='method'