components/quagga/patches/70-isisd-trill.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Wed, 29 Aug 2012 11:05:56 -0700
changeset 957 255465c5756f
parent 855 e14713202945
child 3637 ccffa596a69c
permissions -rw-r--r--
Close of build 04.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
     1
diff --git configure.ac configure.ac
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
     2
--- configure.ac
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
     3
+++ configure.ac
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
     4
@@ -202,6 +202,8 @@
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
     5
 [  --disable-watchquagga   do not build watchquagga])
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
     6
 AC_ARG_ENABLE(isisd,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
     7
 [  --enable-isisd          build isisd])
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
     8
+AC_ARG_ENABLE(trill,
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
     9
+[  --enable-trill          include trill support])
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    10
 AC_ARG_ENABLE(solaris,
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    11
 [  --enable-solaris          build solaris])
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    12
 AC_ARG_ENABLE(bgp-announce,
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    13
@@ -328,6 +330,30 @@
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    14
 AC_SUBST(ISIS_TOPOLOGY_DIR)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    15
 AC_SUBST(ISIS_TOPOLOGY_LIB)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    16
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    17
+if test "${enable_trill}" = "yes"; then
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    18
+  AC_CHECK_HEADER(net/trill.h)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    19
+  AC_CHECK_LIB(dladm, dladm_valid_bridgename, libdladm=yes)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    20
+  AC_MSG_CHECKING(TRILL IS-IS support)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    21
+  if test $ac_cv_header_net_trill_h = no || \
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    22
+    test $ac_cv_lib_dladm_dladm_valid_bridgename = no; then
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    23
+    AC_MSG_RESULT(none)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    24
+    AC_MSG_WARN([*** TRILL IS-IS support will not be built ***])
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    25
+    enable_trill=no
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    26
+  else
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    27
+    AC_MSG_RESULT(yes)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    28
+    AC_DEFINE(HAVE_TRILL,,Enable TRILL support)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    29
+  fi
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    30
+fi
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    31
+if test "${enable_trill}" = "yes"; then
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    32
+  ISIS_TARGETS="isisd trilld"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    33
+  ISIS_LIBS=-ldladm
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    34
+else
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    35
+  ISIS_TARGETS="isisd"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    36
+  ISIS_LIBS=
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    37
+fi
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    38
+AC_SUBST(ISIS_TARGETS)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    39
+AC_SUBST(ISIS_LIBS)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    40
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    41
 if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    42
   enable_user="quagga"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    43
 elif test "${enable_user}" = "no"; then
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    44
@@ -785,28 +811,31 @@
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    45
 AC_DEFINE(ISIS_METHOD_PFPACKET,	1, [ constant value for isis method pfpacket ])
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    46
 AC_DEFINE(ISIS_METHOD_DLPI,	2, [ constant value for isis method dlpi ])
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    47
 AC_DEFINE(ISIS_METHOD_BPF,	3, [ constant value for isis method bpf ])
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    48
-AC_CHECK_HEADER(net/bpf.h)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    49
-AC_CHECK_HEADER(sys/dlpi.h)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    50
-AC_MSG_CHECKING(zebra IS-IS I/O method)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    51
-if test x"$opsys" = x"gnu-linux"; then
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    52
-  AC_MSG_RESULT(pfpacket)
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    53
-  ISIS_METHOD_MACRO="ISIS_METHOD_PFPACKET"
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    54
-elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    55
-  AC_MSG_RESULT(DLPI)
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    56
-  ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    57
-else
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    58
-  if test $ac_cv_header_net_bpf_h = no; then
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    59
-    if test $ac_cv_header_sys_dlpi_h = no; then
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    60
-      AC_MSG_RESULT(none)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    61
-      AC_MSG_WARN([*** IS-IS support will not be built ***])
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    62
-      ISISD=""
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    63
-    else
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    64
-      AC_MSG_RESULT(DLPI)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    65
-    fi
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    66
+if test "${enable_isisd}" = "yes"; then
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    67
+  ISIS_METHOD_MACRO=
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    68
+  AC_CHECK_HEADER(net/bpf.h)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    69
+  AC_CHECK_HEADER(sys/dlpi.h)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    70
+  AC_MSG_CHECKING(zebra IS-IS I/O method)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    71
+  if test x"$opsys" = x"gnu-linux"; then
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    72
+    AC_MSG_RESULT(pfpacket)
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    73
+    ISIS_METHOD_MACRO="ISIS_METHOD_PFPACKET"
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    74
+  elif test x"$opsys" = x"sol2-6" -o x"$opsys" = x"sol8"; then
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    75
+    AC_MSG_RESULT(DLPI)
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    76
     ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    77
   else
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    78
-    AC_MSG_RESULT(BPF)
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    79
-    ISIS_METHOD_MACRO="ISIS_METHOD_BPF"
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    80
+    if test $ac_cv_header_net_bpf_h = no; then
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    81
+      if test $ac_cv_header_sys_dlpi_h = no; then
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    82
+        AC_MSG_RESULT(none)
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    83
+        AC_MSG_WARN([*** IS-IS support will not be built ***])
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    84
+        ISISD=""
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    85
+      else
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    86
+        AC_MSG_RESULT(DLPI)
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    87
+      fi
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    88
+      ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    89
+    else
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    90
+      AC_MSG_RESULT(BPF)
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    91
+      ISIS_METHOD_MACRO="ISIS_METHOD_BPF"
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    92
+    fi
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    93
   fi
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    94
 fi
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
    95
 AC_DEFINE_UNQUOTED(ISIS_METHOD, $ISIS_METHOD_MACRO, [ selected method for isis, == one of the constants ])
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    96
diff --git isisd/Makefile.am isisd/Makefile.am
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    97
index 859facd..9adcc05 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    98
--- isisd/Makefile.am
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
    99
+++ isisd/Makefile.am
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   100
@@ -4,14 +4,15 @@
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   101
 	   @[email protected]
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   102
 DEFS = @[email protected] -DSYSCONFDIR=\"$(sysconfdir)/\"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   103
 [email protected]@ -m 600
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   104
-LIBS = @[email protected] 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   105
+LIBS = @[email protected] @[email protected]
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   106
 
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   107
 AM_CFLAGS = $(PICFLAGS)
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   108
 AM_LDFLAGS = $(PILDFLAGS)
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   109
 
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   110
 noinst_LIBRARIES = libisis.a
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   111
-sbin_PROGRAMS = isisd 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   112
+sbin_PROGRAMS = @[email protected]
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   113
 SUBDIRS = topology
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   114
+EXTRA_PROGRAMS = isisd trilld
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   115
 
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   116
 libisis_a_SOURCES = \
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   117
 	isis_adjacency.c isis_lsp.c dict.c isis_circuit.c isis_pdu.c \
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   118
@@ -25,13 +26,23 @@
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   119
 	isis_lsp.h dict.h isis_circuit.h isis_misc.h isis_network.h \
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   120
 	isis_zebra.h isis_dr.h isis_flags.h isis_dynhn.h isis_common.h \
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   121
 	iso_checksum.h isis_csm.h isis_events.h isis_spf.h isis_route.h \
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   122
+	isis_trill.h \
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   123
 	include-netbsd/clnp.h include-netbsd/esis.h include-netbsd/iso.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   124
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   125
 isisd_SOURCES = \
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   126
 	isis_main.c $(libisis_a_SOURCES) \
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   127
-	isis_bpf.c isis_dlpi.c isis_pfpacket.c
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   128
+	isis_bpf.c isis_dlpi.c isis_pfpacket.c isis_trilldummy.c
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   129
 
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   130
-isisd_LDADD = @[email protected] ../lib/libzebra.la @[email protected]
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   131
+isisd_LDADD = @[email protected] ../lib/libzebra.la @[email protected] @[email protected]
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   132
 
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   133
+trilld_SOURCES = \
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   134
+	isis_main.c $(libisis_a_SOURCES) isis_trill.c isis_trillio.c \
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   135
+	isis_trillvlans.c isis_trillbpdu.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   136
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   137
+trilld_LDADD = @[email protected] ../lib/libzebra.la @[email protected] @[email protected]
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   138
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   139
+EXTRA_DIST = isis_bpf.c isis_dlpi.c isis_pfpacket.c isis_trill.c \
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   140
+	isis_trillio.c isis_trillvlans.c isis_trillbpdu.c
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   141
+
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   142
 examplesdir = $(exampledir)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   143
 dist_examples_DATA = isisd.conf.sample
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   144
diff --git isisd/bool.h isisd/bool.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   145
new file mode 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   146
index 0000000..e713d65
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   147
--- /dev/null
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   148
+++ isisd/bool.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   149
@@ -0,0 +1,25 @@
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   150
+/*
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   151
+ * IS-IS Rout(e)ing protocol               - bool.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   152
+ *
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   153
+ * This program is free software; you can redistribute it and/or modify it 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   154
+ * under the terms of the GNU General Public Licenseas published by the Free 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   155
+ * Software Foundation; either version 2 of the License, or (at your option) 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   156
+ * any later version.
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   157
+ *
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   158
+ * This program is distributed in the hope that it will be useful,but WITHOUT 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   159
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   160
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   161
+ * more details.
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   162
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   163
+ * You should have received a copy of the GNU General Public License along 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   164
+ * with this program; if not, write to the Free Software Foundation, Inc., 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   165
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   166
+ */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   167
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   168
+#ifndef _ZEBRA_ISIS_BOOL_H
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   169
+#define _ZEBRA_ISIS_BOOL_H
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   170
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   171
+#define FALSE 0
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   172
+#define TRUE 1
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   173
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   174
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   175
diff --git isisd/dict.h isisd/dict.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   176
index 9395d1c..0a5382c 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   177
--- isisd/dict.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   178
+++ isisd/dict.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   179
@@ -124,6 +124,11 @@ extern void dict_load_next(dict_load_t *, dnode_t *, const void *);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   180
 extern void dict_load_end(dict_load_t *);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   181
 extern void dict_merge(dict_t *, dict_t *);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   182
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   183
+#define ALL_DICT_NODES_RO(D,dnode,data) \
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   184
+  (dnode) = dict_first((D)); \
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   185
+  (dnode) != NULL && ((data) = dnode_get((dnode)), 1); \
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   186
+  (dnode) = dict_next((D),(dnode))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   187
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   188
 #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   189
 #ifdef KAZLIB_SIDEEFFECT_DEBUG
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   190
 #define dict_isfull(D) (SFX_CHECK(D)->dict_nodecount == (D)->dict_maxcount)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   191
diff --git isisd/isis_adjacency.c isisd/isis_adjacency.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   192
index aab8d1a..4b2159b 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   193
--- isisd/isis_adjacency.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   194
+++ isisd/isis_adjacency.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   195
@@ -43,6 +43,9 @@
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   196
 #include "isisd/isis_dr.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   197
 #include "isisd/isis_dynhn.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   198
 #include "isisd/isis_pdu.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   199
+#include "isisd/isis_tlv.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   200
+#include "isisd/isis_lsp.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   201
+#include "isisd/isis_vlans.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   202
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   203
 extern struct isis *isis;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   204
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   205
@@ -53,6 +56,10 @@ adj_alloc (u_char * id)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   206
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   207
   adj = XCALLOC (MTYPE_ISIS_ADJACENCY, sizeof (struct isis_adjacency));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   208
   memcpy (adj->sysid, id, ISIS_SYS_ID_LEN);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   209
+  adj->lsps = list_new();
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   210
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   211
+  adj->vlans = XCALLOC (MTYPE_ISIS_TRILL_ADJVLANS, sizeof (struct trill_adj_vlans));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   212
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   213
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   214
   return adj;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   215
 }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   216
@@ -127,6 +134,9 @@ isis_adj_lookup_snpa (u_char * ssnpa, struct list *adjdb)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   217
 void
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   218
 isis_delete_adj (struct isis_adjacency *adj, struct list *adjdb)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   219
 {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   220
+  struct listnode *node;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   221
+  struct isis_lsp *lsp;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   222
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   223
   if (!adj)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   224
     return;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   225
   /* When we recieve a NULL list, we will know its p2p. */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   226
@@ -141,7 +151,18 @@ isis_delete_adj (struct isis_adjacency *adj, struct list *adjdb)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   227
   if (adj->ipv6_addrs)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   228
     list_delete (adj->ipv6_addrs);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   229
 #endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   230
-  
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   231
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   232
+  /* clear adj LSPs list (tracks LSPs recvd from the adj) */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   233
+  if (adj->lsps)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   234
+    {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   235
+      for (ALL_LIST_ELEMENTS_RO (adj->lsps, node, lsp))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   236
+        lsp->adj = NULL;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   237
+      list_delete (adj->lsps);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   238
+    }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   239
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   240
+#ifdef HAVE_VLAN
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   241
+  XFREE (MTYPE_ISIS_TRILL_ADJVLANS, adj->vlans);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   242
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   243
   XFREE (MTYPE_ISIS_ADJACENCY, adj);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   244
   return;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   245
 }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   246
@@ -179,6 +200,10 @@ isis_adj_state_change (struct isis_adjacency *adj, enum isis_adj_state state,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   247
       list_delete_all_node (circuit->u.bc.lan_neighs[level - 1]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   248
       isis_adj_build_neigh_list (circuit->u.bc.adjdb[level - 1],
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   249
 				 circuit->u.bc.lan_neighs[level - 1]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   250
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   251
+      /* On adjacency state change send new pseudo LSP if we are the DR */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   252
+      if (circuit->u.bc.is_dr[level - 1])
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   253
+        lsp_pseudo_regenerate (circuit, level);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   254
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   255
   else if (state == ISIS_ADJ_UP)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   256
     {				/* p2p interface */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   257
@@ -302,6 +327,11 @@ isis_adj_print_vty2 (struct isis_adjacency *adj, struct vty *vty, char detail)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   258
   struct isis_dynhn *dyn;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   259
   int level;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   260
   struct listnode *node;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   261
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   262
+  int vlan_count = 0;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   263
+  int vlan_set;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   264
+  int vlan;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   265
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   266
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   267
   dyn = dynhn_find_by_id (adj->sysid);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   268
   if (dyn)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   269
@@ -388,6 +418,38 @@ isis_adj_print_vty2 (struct isis_adjacency *adj, struct vty *vty, char detail)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   270
 	    }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   271
 	}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   272
 #endif /* HAVE_IPV6 */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   273
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   274
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   275
+      vty_out (vty, "    Designated VLAN: %d", adj->vlans->designated);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   276
+      vty_out (vty, "%s    VLAN Forwarder: ", VTY_NEWLINE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   277
+      EACH_VLAN_SET(adj->vlans->forwarder, vlan, vlan_set)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   278
+        {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   279
+	   vlan_count++;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   280
+	   if (vlan_count % 8 == 0)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   281
+             vty_out(vty, "%s                     ", VTY_NEWLINE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   282
+           vty_out (vty, "%d ", vlan); 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   283
+        }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   284
+      vty_out (vty, "%s    Enabled VLANs: ", VTY_NEWLINE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   285
+      vlan_count = 0;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   286
+      EACH_VLAN_SET(adj->vlans->enabled, vlan, vlan_set)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   287
+        {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   288
+	   vlan_count++;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   289
+	   if (vlan_count % 8 == 0)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   290
+             vty_out(vty, "%s                     ", VTY_NEWLINE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   291
+           vty_out (vty, "%d ", vlan); 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   292
+        }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   293
+      vty_out (vty, "%s    Rx VLANs: ", VTY_NEWLINE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   294
+      vlan_count = 0;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   295
+      EACH_VLAN_SET(adj->vlans->seen, vlan, vlan_set)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   296
+        {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   297
+	   vlan_count++;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   298
+	   if (vlan_count % 8 == 0)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   299
+             vty_out(vty, "%s                     ", VTY_NEWLINE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   300
+           vty_out (vty, "%d ", vlan); 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   301
+        }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   302
+      vty_out (vty, "%s", VTY_NEWLINE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   303
+#endif /* HAVE_TRILL */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   304
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   305
       vty_out (vty, "%s", VTY_NEWLINE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   306
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   307
   return;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   308
diff --git isisd/isis_adjacency.h isisd/isis_adjacency.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   309
index 99a8bb2..b966230 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   310
--- isisd/isis_adjacency.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   311
+++ isisd/isis_adjacency.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   312
@@ -96,6 +96,11 @@ struct isis_adjacency
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   313
   int flaps;			/* number of adjacency flaps  */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   314
   struct thread *t_expire;	/* expire after hold_time  */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   315
   struct isis_circuit *circuit;	/* back pointer */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   316
+  struct list *lsps;		/* LSPs marked with this adjacency */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   317
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   318
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   319
+  struct trill_adj_vlans *vlans;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   320
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   321
 };
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   322
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   323
 struct isis_adjacency *isis_adj_lookup (u_char * sysid, struct list *adjdb);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   324
diff --git isisd/isis_circuit.c isisd/isis_circuit.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   325
index af24988..8de3622 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   326
--- isisd/isis_circuit.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   327
+++ isisd/isis_circuit.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   328
@@ -58,6 +58,11 @@
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   329
 #include "isisd/isis_csm.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   330
 #include "isisd/isis_events.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   331
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   332
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   333
+#include "isisd/isis_vlans.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   334
+#include "isisd/isis_trill.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   335
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   336
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   337
 extern struct thread_master *master;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   338
 extern struct isis *isis;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   339
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   340
@@ -87,6 +92,11 @@ isis_circuit_new ()
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   341
 	  circuit->metrics[i].metric_delay = METRICS_UNSUPPORTED;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   342
 	  circuit->te_metric[i] = DEFAULT_CIRCUIT_METRICS;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   343
 	}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   344
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   345
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   346
+      circuit->vlans = XCALLOC (MTYPE_ISIS_TRILL_VLANS,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   347
+          sizeof(struct trill_circuit_vlans));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   348
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   349
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   350
   else
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   351
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   352
@@ -126,6 +136,13 @@ isis_circuit_configure (struct isis_circuit *circuit, struct isis_area *area)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   353
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   354
   circuit->lsp_interval = LSP_INTERVAL;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   355
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   356
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   357
+  circuit->vlans->pvid = DFLT_VLAN;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   358
+  circuit->vlans->designated = DFLT_VLAN;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   359
+  circuit->vlans->our_designated = DFLT_VLAN;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   360
+  SET_VLAN(circuit->vlans->enabled, DFLT_VLAN);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   361
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   362
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   363
   /*
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   364
    * Add the circuit into area
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   365
    */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   366
@@ -216,6 +233,26 @@ isis_circuit_del (struct isis_circuit *circuit)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   367
     list_delete (circuit->ipv6_non_link);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   368
 #endif /* HAVE_IPV6 */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   369
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   370
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   371
+  if (circuit->vlans != NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   372
+    {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   373
+      struct trill_circuit_vlans *cvlans = circuit->vlans;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   374
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   375
+      if (cvlans->appvlanfwders != NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   376
+	list_delete (cvlans->appvlanfwders);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   377
+      if (cvlans->enabled_vlans != NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   378
+	list_delete (cvlans->enabled_vlans);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   379
+      if (cvlans->inhibit_vlans != NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   380
+	list_delete (cvlans->inhibit_vlans);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   381
+      if (cvlans->inhibit_thread != NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   382
+	thread_cancel (cvlans->inhibit_thread);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   383
+      XFREE (MTYPE_ISIS_TRILL_VLANS, cvlans);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   384
+    }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   385
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   386
+  if (circuit->tc_thread != NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   387
+    thread_cancel (circuit->tc_thread);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   388
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   389
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   390
   /* and lastly the circuit itself */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   391
   XFREE (MTYPE_ISIS_CIRCUIT, circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   392
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   393
@@ -374,7 +411,7 @@ isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   394
   circuit->interface = ifp;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   395
   ifp->info = circuit;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   396
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   397
-  circuit->circuit_id = ifp->ifindex % 255;	/* FIXME: Why not ? */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   398
+  circuit->circuit_id = (ifp->ifindex % 255) + 1; /* FIXME: Why not ? */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   399
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   400
   /*  isis_circuit_update_addrs (circuit, ifp); */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   401
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   402
@@ -436,7 +473,7 @@ isis_circuit_update_params (struct isis_circuit *circuit,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   403
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   404
       zlog_warn ("changing circuit_id %d->%d", circuit->circuit_id,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   405
 		 ifp->ifindex);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   406
-      circuit->circuit_id = ifp->ifindex % 255;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   407
+      circuit->circuit_id = (ifp->ifindex % 255) + 1;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   408
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   409
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   410
   /* FIXME: Why is this needed? shouldn't we compare to the area's mtu */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   411
@@ -500,9 +537,10 @@ isis_circuit_if_del (struct isis_circuit *circuit)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   412
   return;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   413
 }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   414
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   415
-void
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   416
+int
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   417
 isis_circuit_up (struct isis_circuit *circuit)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   418
 {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   419
+  int retv;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   420
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   421
   if (circuit->circ_type == CIRCUIT_T_BROADCAST)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   422
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   423
@@ -565,43 +603,57 @@ isis_circuit_up (struct isis_circuit *circuit)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   424
 		       isis_jitter (circuit->psnp_interval[1], PSNP_JITTER));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   425
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   426
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   427
-  /* initialize the circuit streams */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   428
+  /* unified init for circuits; ignore warnings below this level */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   429
+  retv = isis_sock_init (circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   430
+  if (retv == ISIS_ERROR)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   431
+    {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   432
+      isis_circuit_down (circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   433
+      return retv;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   434
+    }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   435
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   436
+  /* initialize the circuit streams after opening connection */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   437
   if (circuit->rcv_stream == NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   438
     circuit->rcv_stream = stream_new (ISO_MTU (circuit));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   439
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   440
   if (circuit->snd_stream == NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   441
     circuit->snd_stream = stream_new (ISO_MTU (circuit));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   442
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   443
-  /* unified init for circuits */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   444
-  isis_sock_init (circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   445
-
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   446
-#ifdef GNU_LINUX
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   447
+#if defined(GNU_LINUX) || defined(SUNOS_5)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   448
   THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   449
 		  circuit->fd);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   450
 #else
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   451
   THREAD_TIMER_ON (master, circuit->t_read, isis_receive, circuit,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   452
 		   circuit->fd);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   453
 #endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   454
-  return;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   455
+  return ISIS_OK;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   456
 }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   457
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   458
 void
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   459
 isis_circuit_down (struct isis_circuit *circuit)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   460
 {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   461
   /* Cancel all active threads -- FIXME: wrong place */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   462
-  /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   463
+  /* HT: Read thread if GNU_LINUX or SUNOS_5, TIMER thread otherwise. */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   464
   THREAD_OFF (circuit->t_read);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   465
+  THREAD_TIMER_OFF (circuit->t_send_csnp[0]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   466
+  THREAD_TIMER_OFF (circuit->t_send_csnp[1]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   467
+  THREAD_TIMER_OFF (circuit->t_send_psnp[0]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   468
+  THREAD_TIMER_OFF (circuit->t_send_psnp[1]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   469
   if (circuit->circ_type == CIRCUIT_T_BROADCAST)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   470
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   471
       THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[0]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   472
       THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[1]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   473
       THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[0]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   474
       THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   475
+      THREAD_TIMER_OFF (circuit->u.bc.t_refresh_pseudo_lsp[0]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   476
+      THREAD_TIMER_OFF (circuit->u.bc.t_refresh_pseudo_lsp[1]);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   477
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   478
   else if (circuit->circ_type == CIRCUIT_T_P2P)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   479
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   480
       THREAD_TIMER_OFF (circuit->u.p2p.t_send_p2p_hello);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   481
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   482
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   483
+  THREAD_TIMER_OFF (circuit->tc_thread);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   484
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   485
   /* close the socket */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   486
   close (circuit->fd);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   487
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   488
diff --git isisd/isis_circuit.h isisd/isis_circuit.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   489
index a7e719f..fd26a27 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   490
--- isisd/isis_circuit.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   491
+++ isisd/isis_circuit.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   492
@@ -137,6 +137,14 @@ struct isis_circuit
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   493
   u_int32_t ctrl_pdus_txed;	/* controlPDUsSent */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   494
   u_int32_t desig_changes[2];	/* lanLxDesignatedIntermediateSystemChanges */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   495
   u_int32_t rej_adjacencies;	/* rejectedAdjacencies */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   496
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   497
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   498
+  struct trill_circuit_vlans *vlans;	/* TRILL VLANs */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   499
+  u_int8_t root_bridge[8];		/* STP Root Bridge */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   500
+  time_t root_expire;			/* time when root expires */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   501
+  int tc_count;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   502
+  struct thread *tc_thread;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   503
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   504
 };
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   505
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   506
 void isis_circuit_init (void);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   507
@@ -147,7 +155,7 @@ struct isis_circuit *circuit_scan_by_ifp (struct interface *ifp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   508
 void isis_circuit_del (struct isis_circuit *circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   509
 void isis_circuit_configure (struct isis_circuit *circuit,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   510
 			     struct isis_area *area);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   511
-void isis_circuit_up (struct isis_circuit *circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   512
+int isis_circuit_up (struct isis_circuit *circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   513
 void isis_circuit_deconfigure (struct isis_circuit *circuit,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   514
 			       struct isis_area *area);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   515
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   516
diff --git isisd/isis_common.h isisd/isis_common.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   517
index 2633855..29baf1e 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   518
--- isisd/isis_common.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   519
+++ isisd/isis_common.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   520
@@ -21,6 +21,9 @@
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   521
  * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   522
  */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   523
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   524
+#ifndef ISIS_COMMON_H
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   525
+#define ISIS_COMMON_H
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   526
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   527
 /*
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   528
  * Area Address
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   529
  */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   530
@@ -72,3 +75,5 @@ struct flags
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   531
   int maxindex;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   532
   struct list *free_idcs;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   533
 };
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   534
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   535
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   536
diff --git isisd/isis_constants.h isisd/isis_constants.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   537
index 1b75ba6..50a526c 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   538
--- isisd/isis_constants.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   539
+++ isisd/isis_constants.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   540
@@ -102,6 +102,10 @@
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   541
 #define IS_LEVEL_2       2
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   542
 #define IS_LEVEL_1_AND_2 3
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   543
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   544
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   545
+#define TRILL_ISIS_LEVEL  IS_LEVEL_1		/* Use ISIS level 1 for TRILL */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   546
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   547
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   548
 #define SNPA_ADDRSTRLEN 18
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   549
 #define ISIS_SYS_ID_LEN  6
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   550
 #define SYSID_STRLEN    24
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   551
diff --git isisd/isis_csm.c isisd/isis_csm.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   552
index 80d0c90..c5bb42d 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   553
--- isisd/isis_csm.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   554
+++ isisd/isis_csm.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   555
@@ -110,7 +110,11 @@ isis_csm_state_change (int event, struct isis_circuit *circuit, void *arg)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   556
 	{
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   557
 	case ISIS_ENABLE:
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   558
 	  isis_circuit_configure (circuit, (struct isis_area *) arg);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   559
-	  isis_circuit_up (circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   560
+	  if (isis_circuit_up (circuit) != ISIS_OK)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   561
+	    {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   562
+	      isis_circuit_deconfigure (circuit, (struct isis_area *) arg);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   563
+	      break;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   564
+	    }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   565
 	  circuit->state = C_STATE_UP;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   566
 	  isis_event_circuit_state_change (circuit, 1);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   567
 	  listnode_delete (isis->init_circ_list, circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   568
@@ -137,7 +141,11 @@ isis_csm_state_change (int event, struct isis_circuit *circuit, void *arg)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   569
 	  break;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   570
 	case IF_UP_FROM_Z:
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   571
 	  isis_circuit_if_add (circuit, (struct interface *) arg);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   572
-	  isis_circuit_up (circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   573
+	  if (isis_circuit_up (circuit) != ISIS_OK)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   574
+	    {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   575
+	      isis_circuit_if_del (circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   576
+	      break;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   577
+	    }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   578
 	  circuit->state = C_STATE_UP;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   579
 	  isis_event_circuit_state_change (circuit, 1);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   580
 	  break;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   581
@@ -161,12 +169,14 @@ isis_csm_state_change (int event, struct isis_circuit *circuit, void *arg)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   582
 	  zlog_warn ("circuit already connected");
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   583
 	  break;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   584
 	case ISIS_DISABLE:
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   585
+	  isis_circuit_down (circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   586
 	  isis_circuit_deconfigure (circuit, (struct isis_area *) arg);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   587
 	  listnode_add (isis->init_circ_list, circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   588
 	  circuit->state = C_STATE_INIT;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   589
 	  isis_event_circuit_state_change (circuit, 0);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   590
 	  break;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   591
 	case IF_DOWN_FROM_Z:
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   592
+	  isis_circuit_down (circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   593
 	  isis_circuit_if_del (circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   594
 	  circuit->state = C_STATE_CONF;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   595
 	  isis_event_circuit_state_change (circuit, 0);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   596
diff --git isisd/isis_dlpi.c isisd/isis_dlpi.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   597
index 07ab547..5837201 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   598
--- isisd/isis_dlpi.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   599
+++ isisd/isis_dlpi.c
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   600
@@ -21,6 +21,7 @@
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   601
  */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   602
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   603
 #include <zebra.h>
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   604
+#include <vty.h>
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   605
 #if ISIS_METHOD == ISIS_METHOD_DLPI
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   606
 #include <net/if.h>
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   607
 #include <netinet/if_ether.h>
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   608
@@ -302,7 +303,7 @@
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   609
 static int
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   610
 open_dlpi_dev (struct isis_circuit *circuit)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   611
 {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   612
-  int fd, unit, retval;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   613
+  int fd = -1, unit, retval;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   614
   char devpath[MAXPATHLEN];
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   615
   dl_info_ack_t *dia = (dl_info_ack_t *)dlpi_ctl;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   616
   ssize_t acklen;
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   617
@@ -314,20 +315,21 @@
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   618
 	circuit->interface->name);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   619
       return ISIS_WARNING;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   620
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   621
-  
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   622
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   623
+  /* Try first as Style 1 */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   624
   /* Try the vanity node first, if permitted */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   625
   if (getenv("DLPI_DEVONLY") == NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   626
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   627
-      (void) snprintf (devpath, sizeof(devpath), "/dev/net/%s",
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   628
-                      circuit->interface->name);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   629
-      fd = dlpiopen (devpath, &acklen);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   630
+      (void) snprintf(devpath, sizeof(devpath), "/dev/net/%s",
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   631
+        circuit->interface->name);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   632
+      fd = dlpiopen(devpath, &acklen);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   633
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   634
-  
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   635
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   636
   /* Now try as an ordinary Style 1 node */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   637
   if (fd == -1)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   638
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   639
-      (void) snprintf (devpath, sizeof (devpath), "/dev/%s",
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   640
-                      circuit->interface->name);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   641
+      (void) snprintf(devpath, sizeof (devpath), "/dev/%s",
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   642
+        circuit->interface->name);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   643
       unit = -1;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   644
       fd = dlpiopen (devpath, &acklen);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   645
     }
641
719d637aca9f 7119945 Update Quagga to version 0.99.19
Brian Utterback <Brian.Utterback@Oracle.COM>
parents: 417
diff changeset
   646
@@ -403,8 +405,8 @@
417
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   647
     case DL_100BT:
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   648
       break;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   649
     default:
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   650
-      zlog_warn ("%s: unexpected mac type on %s: %d", __func__,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   651
-	circuit->interface->name, dia->dl_mac_type);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   652
+      zlog_warn ("%s: unexpected mac type on %s: %ld", __func__,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   653
+	circuit->interface->name, (u_long)dia->dl_mac_type);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   654
       close (fd);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   655
       return ISIS_WARNING;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   656
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   657
diff --git isisd/isis_dr.c isisd/isis_dr.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   658
index 8d306c8..a481142 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   659
--- isisd/isis_dr.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   660
+++ isisd/isis_dr.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   661
@@ -207,17 +207,16 @@ isis_dr_elect (struct isis_circuit *circuit, int level)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   662
       || (adj_dr->prio[level - 1] == own_prio
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   663
 	  && memcmp (adj_dr->snpa, circuit->u.bc.snpa, ETH_ALEN) < 0))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   664
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   665
-      if (!circuit->u.bc.is_dr[level - 1])
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   666
-	{
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   667
-	  /*
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   668
-	   * We are the DR
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   669
-	   */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   670
+      adj_dr->dis_record[level - 1].dis = ISIS_IS_NOT_DIS;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   671
+      adj_dr->dis_record[level - 1].last_dis_change = time (NULL);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   672
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   673
-	  /* rotate the history log */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   674
-	  for (ALL_LIST_ELEMENTS_RO (list, node, adj))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   675
-            isis_check_dr_change (adj, level);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   676
+      /* rotate the history log */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   677
+      for (ALL_LIST_ELEMENTS_RO (list, node, adj))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   678
+        isis_check_dr_change (adj, level);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   679
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   680
-	  /* commence */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   681
+      if (!circuit->u.bc.is_dr[level - 1])
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   682
+	{
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   683
+	  /* We are the DR, commence DR */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   684
 	  list_delete (list);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   685
 	  return isis_dr_commence (circuit, level);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   686
 	}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   687
diff --git isisd/isis_flags.h isisd/isis_flags.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   688
index 13dd9e1..4346eb7 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   689
--- isisd/isis_flags.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   690
+++ isisd/isis_flags.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   691
@@ -27,6 +27,7 @@
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   692
 /* The grand plan is to support 1024 circuits so we have 32*32 bit flags
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   693
  * the support will be achived using the newest drafts */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   694
 #define ISIS_MAX_CIRCUITS 32 /* = 1024 */	/*FIXME:defined in lsp.h as well */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   695
+#define ISIS_MAX_CIRCUITS_COUNT 32 * ISIS_MAX_CIRCUITS  /* total count of max circuits */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   696
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   697
 void flags_initialize (struct flags *flags);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   698
 struct flags *new_flags (int size);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   699
diff --git isisd/isis_lsp.c isisd/isis_lsp.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   700
index 48e3147..53430a7 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   701
--- isisd/isis_lsp.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   702
+++ isisd/isis_lsp.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   703
@@ -38,17 +38,22 @@
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   704
 #include "isisd/dict.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   705
 #include "isisd/isis_constants.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   706
 #include "isisd/isis_common.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   707
+#include "isisd/isis_flags.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   708
 #include "isisd/isis_circuit.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   709
-#include "isisd/isisd.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   710
 #include "isisd/isis_tlv.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   711
 #include "isisd/isis_lsp.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   712
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   713
+#include "isisd/isis_vlans.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   714
+#include "isisd/isis_trill.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   715
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   716
+#include "isisd/isisd.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   717
 #include "isisd/isis_pdu.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   718
 #include "isisd/isis_dynhn.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   719
 #include "isisd/isis_misc.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   720
-#include "isisd/isis_flags.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   721
 #include "isisd/isis_csm.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   722
 #include "isisd/isis_adjacency.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   723
 #include "isisd/isis_spf.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   724
+#include "isisd/bool.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   725
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   726
 #ifdef TOPOLOGY_GENERATE
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   727
 #include "spgrid.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   728
@@ -138,18 +143,34 @@ lsp_clear_data (struct isis_lsp *lsp)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   729
   if (lsp->tlv_data.ipv6_reachs)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   730
     list_delete (lsp->tlv_data.ipv6_reachs);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   731
 #endif /* HAVE_IPV6 */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   732
+  if (lsp->tlv_data.router_capabilities)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   733
+    list_delete (lsp->tlv_data.router_capabilities);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   734
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   735
   memset (&lsp->tlv_data, 0, sizeof (struct tlvs));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   736
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   737
   return;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   738
 }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   739
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   740
+/*
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   741
+ * clearnick is set by callers to indicate it is
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   742
+ * also safe to clear any nickname that was learnt from
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   743
+ * the LSP. LSP purge case is safe but LSP destroyed before
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   744
+ * replaced by a new LSP from the other RBridge is not. 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   745
+ */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   746
 static void
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   747
-lsp_destroy (struct isis_lsp *lsp)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   748
+lsp_destroy (struct isis_lsp *lsp, int clearnick)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   749
 {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   750
   if (!lsp)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   751
     return;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   752
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   753
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   754
+  if (clearnick)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   755
+    trill_nick_destroy(lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   756
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   757
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   758
+  if (lsp->adj != NULL && lsp->adj->lsps != NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   759
+    listnode_delete(lsp->adj->lsps, lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   760
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   761
   lsp_clear_data (lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   762
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   763
   if (LSP_FRAGMENT (lsp->lsp_header->lsp_id) == 0 && lsp->lspu.frags)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   764
@@ -173,7 +194,7 @@ lsp_db_destroy (dict_t * lspdb)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   765
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   766
       next = dict_next (lspdb, dnode);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   767
       lsp = dnode_get (dnode);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   768
-      lsp_destroy (lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   769
+      lsp_destroy (lsp, TRUE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   770
       dict_delete_free (lspdb, dnode);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   771
       dnode = next;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   772
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   773
@@ -187,7 +208,7 @@ lsp_db_destroy (dict_t * lspdb)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   774
  * Remove all the frags belonging to the given lsp
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   775
  */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   776
 static void
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   777
-lsp_remove_frags (struct list *frags, dict_t * lspdb)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   778
+lsp_remove_frags (struct list *frags, dict_t * lspdb, int clearnick)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   779
 {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   780
   dnode_t *dnode;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   781
   struct listnode *lnode, *lnnode;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   782
@@ -196,7 +217,7 @@ lsp_remove_frags (struct list *frags, dict_t * lspdb)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   783
   for (ALL_LIST_ELEMENTS (frags, lnode, lnnode, lsp))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   784
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   785
       dnode = dict_lookup (lspdb, lsp->lsp_header->lsp_id);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   786
-      lsp_destroy (lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   787
+      lsp_destroy (lsp, clearnick);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   788
       dnode_destroy (dict_delete (lspdb, dnode));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   789
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   790
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   791
@@ -222,7 +243,7 @@ lsp_search_and_destroy (u_char * id, dict_t * lspdb)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   792
       if (LSP_FRAGMENT (lsp->lsp_header->lsp_id) == 0)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   793
 	{
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   794
 	  if (lsp->lspu.frags)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   795
-	    lsp_remove_frags (lsp->lspu.frags, lspdb);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   796
+	    lsp_remove_frags (lsp->lspu.frags, lspdb, FALSE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   797
 	}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   798
       else
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   799
 	{
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   800
@@ -232,7 +253,7 @@ lsp_search_and_destroy (u_char * id, dict_t * lspdb)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   801
 	  if (lsp->lspu.zero_lsp && lsp->lspu.zero_lsp->lspu.frags)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   802
 	    listnode_delete (lsp->lspu.zero_lsp->lspu.frags, lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   803
 	}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   804
-      lsp_destroy (lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   805
+      lsp_destroy (lsp, FALSE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   806
       dnode_destroy (node);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   807
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   808
 }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   809
@@ -314,7 +335,7 @@ lsp_inc_seqnum (struct isis_lsp *lsp, u_int32_t seq_num)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   810
     newseq = seq_num++;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   811
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   812
   lsp->lsp_header->seq_num = htonl (newseq);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   813
-  fletcher_checksum (STREAM_DATA (lsp->pdu) + 12,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   814
+  fletcher_checksum(STREAM_DATA (lsp->pdu) + 12,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   815
 		   ntohs (lsp->lsp_header->pdu_len) - 12, 12);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   816
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   817
   return;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   818
@@ -367,6 +388,8 @@ lsp_update_data (struct isis_lsp *lsp, struct stream *stream,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   819
   int retval;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   820
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   821
   /* copying only the relevant part of our stream */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   822
+  if (lsp->pdu != NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   823
+    stream_free (lsp->pdu);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   824
   lsp->pdu = stream_dup (stream);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   825
   
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   826
   /* setting pointers to the correct place */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   827
@@ -414,6 +437,10 @@ lsp_update_data (struct isis_lsp *lsp, struct stream *stream,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   828
 			   (lsp->lsp_header->lsp_bits & LSPBIT_IST));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   829
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   830
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   831
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   832
+  if (isis->trill_active)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   833
+    trill_parse_router_capability_tlvs (area, lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   834
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   835
 }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   836
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   837
 void
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   838
@@ -428,7 +455,6 @@ lsp_update (struct isis_lsp *lsp, struct isis_link_state_hdr *lsp_hdr,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   839
     dnode_destroy (dict_delete (area->lspdb[level - 1], dnode));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   840
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   841
   /* free the old lsp data */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   842
-  XFREE (MTYPE_STREAM_DATA, lsp->pdu);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   843
   lsp_clear_data (lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   844
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   845
   /* rebuild the lsp data */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   846
@@ -852,11 +878,9 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   847
   if (lsp->tlv_data.te_is_neighs)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   848
     for (ALL_LIST_ELEMENTS_RO (lsp->tlv_data.te_is_neighs, lnode, te_is_neigh))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   849
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   850
-      uint32_t metric;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   851
-      memcpy (&metric, te_is_neigh->te_metric, 3);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   852
       lspid_print (te_is_neigh->neigh_id, LSPid, dynhost, 0);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   853
       vty_out (vty, "  Metric: %-10d IS-Extended %s%s",
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   854
-	       ntohl (metric << 8), LSPid, VTY_NEWLINE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   855
+	       GET_TE_METRIC(te_is_neigh), LSPid, VTY_NEWLINE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   856
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   857
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   858
   /* TE IPv4 tlv */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   859
@@ -933,16 +957,32 @@ lsp_tlv_fit (struct isis_lsp *lsp, struct list **from, struct list **to,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   860
   if (!FRAG_NEEDED (lsp->pdu, frag_thold, listcount (*from) * tlvsize + 2))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   861
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   862
       tlv_build_func (*from, lsp->pdu);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   863
-      *to = *from;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   864
-      *from = NULL;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   865
+      if (listcount (*to) != 0)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   866
+	{
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   867
+	  struct listnode *node, *nextnode;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   868
+	  void *elem;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   869
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   870
+	  for (ALL_LIST_ELEMENTS (*from, node, nextnode, elem))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   871
+	    {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   872
+	      listnode_add (*to, elem);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   873
+	      list_delete_node (*from, node);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   874
+	    }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   875
+	}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   876
+      else
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   877
+	{
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   878
+	  list_free (*to);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   879
+	  *to = *from;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   880
+	  *from = NULL;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   881
+	}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   882
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   883
   else if (!FRAG_NEEDED (lsp->pdu, frag_thold, tlvsize + 2))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   884
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   885
       /* fit all we can */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   886
       count = FRAG_THOLD (lsp->pdu, frag_thold) - 2 -
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   887
 	(STREAM_SIZE (lsp->pdu) - STREAM_REMAIN (lsp->pdu));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   888
-      if (count)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   889
-	count = count / tlvsize;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   890
+      count = count / tlvsize;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   891
+      if (count > (int)listcount (*from))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   892
+	count = listcount (*from);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   893
       for (i = 0; i < count; i++)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   894
 	{
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   895
 	  listnode_add (*to, listgetdata (listhead (*from)));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   896
@@ -972,7 +1012,7 @@ lsp_next_frag (u_char frag_num, struct isis_lsp *lsp0, struct isis_area *area,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   897
       lsp_clear_data (lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   898
       if (lsp0->tlv_data.auth_info.type)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   899
 	{
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   900
-	  memcpy (&lsp->tlv_data.auth_info, &lsp->tlv_data.auth_info,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   901
+	  memcpy (&lsp->tlv_data.auth_info, &lsp0->tlv_data.auth_info,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   902
 		  sizeof (struct isis_passwd));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   903
 	  tlv_add_authinfo (lsp->tlv_data.auth_info.type,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   904
 			    lsp->tlv_data.auth_info.len,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   905
@@ -991,7 +1031,7 @@ lsp_next_frag (u_char frag_num, struct isis_lsp *lsp0, struct isis_area *area,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   906
    */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   907
   if (lsp0->tlv_data.auth_info.type)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   908
     {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   909
-      memcpy (&lsp->tlv_data.auth_info, &lsp->tlv_data.auth_info,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   910
+      memcpy (&lsp->tlv_data.auth_info, &lsp0->tlv_data.auth_info,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   911
 	      sizeof (struct isis_passwd));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   912
       tlv_add_authinfo (lsp->tlv_data.auth_info.type,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   913
 			lsp->tlv_data.auth_info.len,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   914
@@ -1094,6 +1134,11 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   915
   if (lsp->tlv_data.area_addrs && listcount (lsp->tlv_data.area_addrs) > 0)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   916
     tlv_add_area_addrs (lsp->tlv_data.area_addrs, lsp->pdu);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   917
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   918
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   919
+  if (isis->trill_active && CHECK_FLAG (area->trill->status, TRILL_NICK_SET))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   920
+      tlv_add_trill_nickname (&(area->trill->nick), lsp->pdu, area);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   921
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   922
+
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   923
   /* IPv4 address and TE router ID TLVs. In case of the first one we don't
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   924
    * follow "C" vendor, but "J" vendor behavior - one IPv4 address is put into
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   925
    * LSP and this address is same as router id. */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   926
@@ -1281,13 +1326,11 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   927
 		    memcpy (te_is_neigh->neigh_id,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   928
 			    circuit->u.bc.l2_desig_is, ISIS_SYS_ID_LEN + 1);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   929
 		  if (area->oldmetric)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   930
-		    metric =
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   931
-		      ((htonl(circuit->metrics[level - 1].metric_default) >> 8)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   932
-			      & 0xffffff);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   933
+		    metric = circuit->metrics[level - 1].metric_default;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   934
 		  else
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   935
-		    metric = ((htonl(*circuit->te_metric) >> 8) & 0xffffff);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   936
+		    metric = circuit->te_metric[level - 1];
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   937
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   938
-		  memcpy (te_is_neigh->te_metric, &metric, 3);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   939
+		  SET_TE_METRIC(te_is_neigh, metric);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   940
 		  listnode_add (tlv_data.te_is_neighs, te_is_neigh);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   941
 		}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   942
 	    }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   943
@@ -1320,8 +1363,8 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   944
 		  te_is_neigh = XCALLOC (MTYPE_ISIS_TLV,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   945
 					 sizeof (struct te_is_neigh));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   946
 		  memcpy (te_is_neigh->neigh_id, nei->sysid, ISIS_SYS_ID_LEN);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   947
-		  metric = ((htonl(*circuit->te_metric) >> 8) & 0xffffff);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   948
-		  memcpy (te_is_neigh->te_metric, &metric, 3);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   949
+		  metric = circuit->te_metric[level - 1];
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   950
+		  SET_TE_METRIC(te_is_neigh, metric);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   951
 		  listnode_add (tlv_data.te_is_neighs, te_is_neigh);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   952
 		}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   953
 	    }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   954
@@ -1539,6 +1582,10 @@ lsp_non_pseudo_regenerate (struct isis_area *area, int level)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   955
   if (area->ipv6_circuits)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   956
     isis_spf_schedule6 (area, level);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   957
 #endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   958
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   959
+  if (isis->trill_active)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   960
+    isis_spf_schedule_trill (area);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   961
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   962
   return ISIS_OK;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   963
 }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   964
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   965
@@ -1803,7 +1850,7 @@ lsp_build_pseudo (struct isis_lsp *lsp, struct isis_circuit *circuit,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   966
     tlv_add_is_neighs (lsp->tlv_data.es_neighs, lsp->pdu);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   967
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   968
   lsp->lsp_header->pdu_len = htons (stream_get_endp (lsp->pdu));
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   969
-  fletcher_checksum (STREAM_DATA (lsp->pdu) + 12,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   970
+  fletcher_checksum(STREAM_DATA (lsp->pdu) + 12,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   971
 		   ntohs (lsp->lsp_header->pdu_len) - 12, 12);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   972
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   973
   list_delete (adj_list);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   974
@@ -1811,7 +1858,7 @@ lsp_build_pseudo (struct isis_lsp *lsp, struct isis_circuit *circuit,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   975
   return;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   976
 }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   977
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   978
-static int
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   979
+int
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   980
 lsp_pseudo_regenerate (struct isis_circuit *circuit, int level)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   981
 {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   982
   dict_t *lspdb = circuit->area->lspdb[level - 1];
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   983
@@ -2022,8 +2069,8 @@ lsp_tick (struct thread *thread)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   984
 		  if (lsp->from_topology)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   985
 		    THREAD_TIMER_OFF (lsp->t_lsp_top_ref);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   986
 #endif /* TOPOLOGY_GENERATE */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   987
-		  lsp_destroy (lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   988
-		  dict_delete (area->lspdb[level], dnode);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   989
+		  lsp_destroy (lsp, TRUE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   990
+		  dict_delete_free (area->lspdb[level], dnode);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   991
 		}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   992
 	      else if (flags_any_set (lsp->SRMflags))
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   993
 		listnode_add (lsp_list, lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   994
@@ -2071,7 +2118,7 @@ lsp_purge_dr (u_char * id, struct isis_circuit *circuit, int level)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   995
       lsp->lsp_header->pdu_len =
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   996
 	htons (ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   997
       lsp->purged = 0;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   998
-      fletcher_checksum (STREAM_DATA (lsp->pdu) + 12,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
   999
+      fletcher_checksum(STREAM_DATA (lsp->pdu) + 12,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1000
 		       ntohs (lsp->lsp_header->pdu_len) - 12, 12);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1001
       ISIS_FLAGS_SET_ALL (lsp->SRMflags);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1002
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1003
@@ -2227,7 +2274,7 @@ remove_topology_lsps (struct isis_area *area)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1004
       if (lsp->from_topology)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1005
 	{
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1006
 	  THREAD_TIMER_OFF (lsp->t_lsp_top_ref);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1007
-	  lsp_destroy (lsp);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1008
+	  lsp_destroy (lsp, TRUE);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1009
 	  dict_delete (area->lspdb[0], dnode);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1010
 	}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1011
       dnode = dnode_next;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1012
@@ -2325,8 +2372,6 @@ build_topology_lsp_data (struct isis_lsp *lsp, struct isis_area *area,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1013
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1014
       if (area->newmetric)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1015
 	{
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1016
-	  uint32_t metric;
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1017
-
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1018
 	  if (tlv_data.te_is_neighs == NULL)
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1019
 	    {
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1020
 	      tlv_data.te_is_neighs = list_new ();
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1021
@@ -2337,8 +2382,7 @@ build_topology_lsp_data (struct isis_lsp *lsp, struct isis_area *area,
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1022
 		  ISIS_SYS_ID_LEN);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1023
 	  te_is_neigh->neigh_id[ISIS_SYS_ID_LEN - 1] = (to_lsp & 0xFF);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1024
 	  te_is_neigh->neigh_id[ISIS_SYS_ID_LEN - 2] = ((to_lsp >> 8) & 0xFF);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1025
-	  metric = ((htonl(arc->distance) >> 8) & 0xffffff);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1026
-	  memcpy (te_is_neigh->te_metric, &metric, 3);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1027
+	  SET_TE_METRIC(te_is_neigh, arc->distance);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1028
 	  listnode_add (tlv_data.te_is_neighs, te_is_neigh);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1029
 	}
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1030
     }
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1031
diff --git isisd/isis_lsp.h isisd/isis_lsp.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1032
index adbde78..4112681 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1033
--- isisd/isis_lsp.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1034
+++ isisd/isis_lsp.h
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1035
@@ -74,6 +74,7 @@ int lsp_refresh_l1 (struct thread *thread);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1036
 int lsp_refresh_l2 (struct thread *thread);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1037
 int lsp_regenerate_schedule (struct isis_area *area);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1038
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1039
+int lsp_pseudo_regenerate (struct isis_circuit *circuit, int level);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1040
 int lsp_l1_pseudo_generate (struct isis_circuit *circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1041
 int lsp_l2_pseudo_generate (struct isis_circuit *circuit);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1042
 int lsp_l1_refresh_pseudo (struct thread *thread);
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1043
diff --git isisd/isis_main.c isisd/isis_main.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1044
index 2411518..a75281d 100644
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1045
--- isisd/isis_main.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1046
+++ isisd/isis_main.c
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1047
@@ -43,6 +43,14 @@
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1048
 #include "isisd/isis_circuit.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1049
 #include "isisd/isisd.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1050
 #include "isisd/isis_dynhn.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1051
+#include "isisd/isis_spf.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1052
+#include "isisd/isis_route.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1053
+#include "isisd/isis_zebra.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1054
+#ifdef HAVE_TRILL
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1055
+#include "isisd/isis_tlv.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1056
+#include "isisd/isis_vlans.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1057
+#include "isisd/isis_trill.h"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1058
+#endif
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1059
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1060
 /* Default configuration file name */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1061
 #define ISISD_DEFAULT_CONFIG "isisd.conf"
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1062
@@ -51,8 +59,12 @@
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1063
 
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1064
 /* isisd privileges */
7c10b5cba79b 7066915 Move Quagga to Userland
Brian Utterback <Brian.Utterback@Oracle.COM>
parents:
diff changeset
  1065
 zebra_capabilities_t _caps_p[] = {