Browse Source

Initial revision

jardin 16 years ago
parent
commit
eb5d44eb8d
76 changed files with 45393 additions and 0 deletions
  1. 3 0
      isisd/AUTHORS
  2. 339 0
      isisd/COPYING
  3. 69 0
      isisd/ChangeLog
  4. 18 0
      isisd/INSTALL-0.0.4
  5. 55 0
      isisd/Makefile.am
  6. 463 0
      isisd/Makefile.in
  7. 20 0
      isisd/README
  8. 10 0
      isisd/TODO
  9. 1496 0
      isisd/dict.c
  10. 144 0
      isisd/dict.h
  11. 547 0
      isisd/include-netbsd/clnp.h
  12. 146 0
      isisd/include-netbsd/esis.h
  13. 208 0
      isisd/include-netbsd/iso.h
  14. 508 0
      isisd/isis_adjacency.c
  15. 126 0
      isisd/isis_adjacency.h
  16. 2200 0
      isisd/isis_circuit.c
  17. 158 0
      isisd/isis_circuit.h
  18. 65 0
      isisd/isis_common.h
  19. 151 0
      isisd/isis_constants.h
  20. 186 0
      isisd/isis_csm.c
  21. 47 0
      isisd/isis_csm.h
  22. 373 0
      isisd/isis_dr.c
  23. 42 0
      isisd/isis_dr.h
  24. 124 0
      isisd/isis_dynhn.c
  25. 42 0
      isisd/isis_dynhn.h
  26. 336 0
      isisd/isis_events.c
  27. 54 0
      isisd/isis_events.h
  28. 71 0
      isisd/isis_flags.c
  29. 58 0
      isisd/isis_flags.h
  30. 2419 0
      isisd/isis_lsp.c
  31. 132 0
      isisd/isis_lsp.h
  32. 330 0
      isisd/isis_main.c
  33. 438 0
      isisd/isis_misc.c
  34. 94 0
      isisd/isis_misc.h
  35. 622 0
      isisd/isis_network.c
  36. 37 0
      isisd/isis_network.h
  37. 2478 0
      isisd/isis_pdu.c
  38. 257 0
      isisd/isis_pdu.h
  39. 615 0
      isisd/isis_route.c
  40. 61 0
      isisd/isis_route.h
  41. 100 0
      isisd/isis_routemap.c
  42. 1293 0
      isisd/isis_spf.c
  43. 85 0
      isisd/isis_spf.h
  44. 1014 0
      isisd/isis_tlv.c
  45. 268 0
      isisd/isis_tlv.h
  46. 592 0
      isisd/isis_zebra.c
  47. 33 0
      isisd/isis_zebra.h
  48. 1989 0
      isisd/isisd.c
  49. 39 0
      isisd/isisd.conf.sample
  50. 147 0
      isisd/isisd.h
  51. 192 0
      isisd/iso_checksum.c
  52. 29 0
      isisd/iso_checksum.h
  53. 17 0
      isisd/modified/Makefile.am
  54. 462 0
      isisd/modified/Makefile.in
  55. 4 0
      isisd/modified/README
  56. 162 0
      isisd/modified/acconfig.h
  57. 2983 0
      isisd/modified/command.c
  58. 311 0
      isisd/modified/command.h
  59. 368 0
      isisd/modified/config.h.in
  60. 8277 0
      isisd/modified/configure
  61. 882 0
      isisd/modified/configure.in
  62. 484 0
      isisd/modified/log.c
  63. 129 0
      isisd/modified/log.h
  64. 527 0
      isisd/modified/memory.c
  65. 257 0
      isisd/modified/memory.h
  66. 3321 0
      isisd/modified/rib.c
  67. 713 0
      isisd/modified/thread.c
  68. 141 0
      isisd/modified/thread.h
  69. 2786 0
      isisd/modified/vty.c
  70. 313 0
      isisd/modified/zebra.h
  71. 23 0
      isisd/topology/Makefile.am
  72. 154 0
      isisd/topology/random.c
  73. 483 0
      isisd/topology/spacyc.c
  74. 729 0
      isisd/topology/spgrid.c
  75. 45 0
      isisd/topology/spgrid.h
  76. 499 0
      isisd/topology/sprand.c

+ 3 - 0
isisd/AUTHORS

@@ -0,0 +1,3 @@
+Sampo Saaristo <sambo@cs.tut.fi>
+Ofer Wald      <ofersf@islands.co.il>
+Hannes Gredler <hannes@gredler.at>

+ 339 - 0
isisd/COPYING

@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	Appendix: How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

+ 69 - 0
isisd/ChangeLog

@@ -0,0 +1,69 @@
+Version 0.0.7 to 0.0.8
+======================
+
+o A bug in handling of other ISs fragments fixed
+o hello interval now specified in *seconds*
+o replaced the adj->ipv[46]_addr tables with linked lists
+
+Version 0.0.6 to 0.0.7 (Oct 29 2002)
+======================
+
+o changed to zebra-0.93b
+o fixed a seg in SPF
+o handling/generation of LSP fragments
+o domain/area/circuit password
+
+Version 0.0.5 to 0.0.6 (Jul 4 2002)
+======================
+
+o lots of changes to SPF
+ - runs the SPF for IPv4 and IPv6 separately
+ - a number of bugs fixed
+ - simplified the implementation 
+ - "7.2.7 Removal of excess paths" implemented
+o ported to freebsd  (tested in 4.5-STABLE and 4.6-STABLE) 
+o moved to zebra-0.93-pre2
+o "show isis topology" command added 
+o "show (ip|ipv6) route isis commands added to zebra
+o a number of fixes and additions (e.g. checksum calculation and DIS state
+change event) by BeomSeok Gwak added
+
+Version 0.0.4 to 0.0.5 (Apr 26 2002)
+======================
+
+o changed to zebra-0.93-pre1
+o number of memory leaks + small bugs fixed
+o a bug related to processing of neigbors when installing routes fixed
+
+Version 0.0.3 to 0.0.4 (Feb 27 2002)
+======================
+
+o initial version of SPT algorithm
+o installing routes though zebrad
+o isis debug commands
+o work on IS-IS events (e.g. circuit state change)
+
+Version 0.0.2 to 0.0.3 (Jan 17 2002)
+======================
+
+o LSP handling improved
+o generation of pseudonode LSPs
+o DR election enhanced
+o support for p2p interfaces
+o support for topology simulation 
+o more detailed output for show commands
+
+Version 0.0.1 to 0.0.2 (Dec 13 2001)
+======================
+
+o circuit state machine (isis_csm.[ch]) added
+o lot of work on LSP generation 
+o ISO checksum 
+o uses DGRAM sockets instead of RAW
+o gets IP(v6) addresses from zebra
+o debug can be controlled with "debug isis" command
+o read support for TE tlvs
+o work started on p2p interfaces
+o work started on isis events 
+
+

+ 18 - 0
isisd/INSTALL-0.0.4

@@ -0,0 +1,18 @@
+ISISd package for zebra 0.92a installation instructions:
+
+1. grab the zebra 0.92a package from www.zebra.org
+2. unpack the package using tar -zxvf zebra-0.92a.tar.gz
+3. enter the zebra-092a directory
+4. copy the contents of the isisd package into the zebra dir
+5. enter the isisd/modified directory
+6. use the README file and copy the files to the appropriate zebra dirs
+   (the simplest way to do so would be 'source README')
+7. enter the main zebra directory and issue 'automake','autoconf' and 
+   'autoheader'. if using automake version 1.5 and up use the '-i' option.
+8. run './configure --enable-isisd' (you may use other zebra config commands)
+9. run 'make'
+10. find your self something entertaining to do for the next couple of minutes
+11. you can issue 'make install' or simply work from the isisd directory
+
+for any problems, contact the developers at the sourceforge site
+http://www.sf.net/projects/isisd

+ 55 - 0
isisd/Makefile.am

@@ -0,0 +1,55 @@
+## Process this file with automake to produce Makefile.in.
+
+# INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -Itopology
+INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib 
+DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
+INSTALL_SDATA=@INSTALL@ -m 600
+LIBS = @LIBS@ 
+noinst_LIBRARIES = libisis.a
+sbin_PROGRAMS = isisd 
+
+libisis_a_SOURCES = \
+	isis_adjacency.c isis_lsp.c dict.c isis_circuit.c isis_pdu.c \
+	isis_tlv.c isisd.c isis_misc.c isis_network.c isis_zebra.c isis_dr.c \
+	isis_flags.c isis_dynhn.c iso_checksum.c isis_csm.c isis_events.c \
+	isis_spf.c isis_route.c isis_routemap.c
+
+
+noinst_HEADERS = \
+	isisd.h isis_pdu.h isis_tlv.h isis_adjacency.h isis_constants.h \
+	isis_lsp.h dict.h isis_circuit.h isis_misc.h isis_network.h \
+	isis_zebra.h isis_dr.h isis_flags.h isis_dynhn.h isis_common.h \
+	iso_checksum.h isis_csm.h isis_events.h isis_spf.h isis_route.h
+
+isisd_SOURCES = \
+	isis_main.c $(libisis_a_SOURCES)
+
+isisd_LDADD = ../lib/libzebra.a 
+
+sysconf_DATA = isisd.conf.sample
+
+EXTRA_DIST = $(sysconf_DATA)
+
+install-sysconfDATA: $(sysconf_DATA)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
+	@list='$(sysconf_DATA)'; for p in $$list; do \
+	  if test -f $(srcdir)/$$p; then \
+	    echo " $(INSTALL_SDATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p"; \
+	    $(INSTALL_SDATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p; \
+	  else if test -f $$p; then \
+	    echo " $(INSTALL_SDATA) $$p $(DESTDIR)$(sysconfdir)/$$p"; \
+	    $(INSTALL_SDATA) $$p $(DESTDIR)$(sysconfdir)/$$p; \
+	  fi; fi; \
+	done
+
+depend:
+	@$(CPP) -MM $(INCLUDES) $(LDFLAGS) *.c
+
+## File dependency.
+isis_adjacency.o : isis_adjacency.c ../lib/version.h ../lib/log.h \
+ ../isisd/isis_adjacency.h
+isis_pdu.o : isis_pdu.c ../lib/log.h ../isisd/isisd.h \
+ ../isisd/isis_constants.h ../isisd/isis_adjacency.h \
+ ../isisd/isis_pdu.h
+isis_circuit.o : isis_circuit.c ../isisd/isis_circuit.h

+ 463 - 0
isisd/Makefile.in

@@ -0,0 +1,463 @@
+# Makefile.in generated by automake 1.6.2 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+AMTAR = @AMTAR@
+AR = @AR@
+AWK = @AWK@
+BGPD = @BGPD@
+CC = @CC@
+CPP = @CPP@
+CURSES = @CURSES@
+DEPDIR = @DEPDIR@
+IF_METHOD = @IF_METHOD@
+IF_PROC = @IF_PROC@
+
+# INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -Itopology
+INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib 
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPFORWARD = @IPFORWARD@
+ISISD = @ISISD@
+KERNEL_METHOD = @KERNEL_METHOD@
+LIBPAM = @LIBPAM@
+LIB_IPV6 = @LIB_IPV6@
+LIB_REGEX = @LIB_REGEX@
+MULTIPATH_NUM = @MULTIPATH_NUM@
+OSPF6D = @OSPF6D@
+OSPFD = @OSPFD@
+OTHER_METHOD = @OTHER_METHOD@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+RIPD = @RIPD@
+RIPNGD = @RIPNGD@
+RTREAD_METHOD = @RTREAD_METHOD@
+RT_METHOD = @RT_METHOD@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VTYSH = @VTYSH@
+ZEBRA = @ZEBRA@
+am__include = @am__include@
+am__quote = @am__quote@
+install_sh = @install_sh@
+DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
+INSTALL_SDATA = @INSTALL@ -m 600
+LIBS = @LIBS@ 
+noinst_LIBRARIES = libisis.a
+sbin_PROGRAMS = isisd 
+
+libisis_a_SOURCES = \
+	isis_adjacency.c isis_lsp.c dict.c isis_circuit.c isis_pdu.c \
+	isis_tlv.c isisd.c isis_misc.c isis_network.c isis_zebra.c isis_dr.c \
+	isis_flags.c isis_dynhn.c iso_checksum.c isis_csm.c isis_events.c \
+	isis_spf.c isis_route.c isis_routemap.c
+
+
+noinst_HEADERS = \
+	isisd.h isis_pdu.h isis_tlv.h isis_adjacency.h isis_constants.h \
+	isis_lsp.h dict.h isis_circuit.h isis_misc.h isis_network.h \
+	isis_zebra.h isis_dr.h isis_flags.h isis_dynhn.h isis_common.h \
+	iso_checksum.h isis_csm.h isis_events.h isis_spf.h isis_route.h
+
+
+isisd_SOURCES = \
+	isis_main.c $(libisis_a_SOURCES)
+
+
+isisd_LDADD = ../lib/libzebra.a 
+
+sysconf_DATA = isisd.conf.sample
+
+EXTRA_DIST = $(sysconf_DATA)
+subdir = isisd
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+
+libisis_a_AR = $(AR) cru
+libisis_a_LIBADD =
+am_libisis_a_OBJECTS = isis_adjacency.$(OBJEXT) isis_lsp.$(OBJEXT) \
+	dict.$(OBJEXT) isis_circuit.$(OBJEXT) isis_pdu.$(OBJEXT) \
+	isis_tlv.$(OBJEXT) isisd.$(OBJEXT) isis_misc.$(OBJEXT) \
+	isis_network.$(OBJEXT) isis_zebra.$(OBJEXT) isis_dr.$(OBJEXT) \
+	isis_flags.$(OBJEXT) isis_dynhn.$(OBJEXT) \
+	iso_checksum.$(OBJEXT) isis_csm.$(OBJEXT) isis_events.$(OBJEXT) \
+	isis_spf.$(OBJEXT) isis_route.$(OBJEXT) isis_routemap.$(OBJEXT)
+libisis_a_OBJECTS = $(am_libisis_a_OBJECTS)
+sbin_PROGRAMS = isisd$(EXEEXT)
+PROGRAMS = $(sbin_PROGRAMS)
+
+am__objects_1 = isis_adjacency.$(OBJEXT) isis_lsp.$(OBJEXT) \
+	dict.$(OBJEXT) isis_circuit.$(OBJEXT) isis_pdu.$(OBJEXT) \
+	isis_tlv.$(OBJEXT) isisd.$(OBJEXT) isis_misc.$(OBJEXT) \
+	isis_network.$(OBJEXT) isis_zebra.$(OBJEXT) isis_dr.$(OBJEXT) \
+	isis_flags.$(OBJEXT) isis_dynhn.$(OBJEXT) \
+	iso_checksum.$(OBJEXT) isis_csm.$(OBJEXT) isis_events.$(OBJEXT) \
+	isis_spf.$(OBJEXT) isis_route.$(OBJEXT) isis_routemap.$(OBJEXT)
+am_isisd_OBJECTS = isis_main.$(OBJEXT) $(am__objects_1)
+isisd_OBJECTS = $(am_isisd_OBJECTS)
+isisd_DEPENDENCIES = ../lib/libzebra.a
+isisd_LDFLAGS =
+DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/dict.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/isis_adjacency.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/isis_circuit.Po ./$(DEPDIR)/isis_csm.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/isis_dr.Po ./$(DEPDIR)/isis_dynhn.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/isis_events.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/isis_flags.Po ./$(DEPDIR)/isis_lsp.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/isis_main.Po ./$(DEPDIR)/isis_misc.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/isis_network.Po ./$(DEPDIR)/isis_pdu.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/isis_route.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/isis_routemap.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/isis_spf.Po ./$(DEPDIR)/isis_tlv.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/isis_zebra.Po ./$(DEPDIR)/isisd.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/iso_checksum.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+CFLAGS = @CFLAGS@
+DIST_SOURCES = $(libisis_a_SOURCES) $(isisd_SOURCES)
+DATA = $(sysconf_DATA)
+
+HEADERS = $(noinst_HEADERS)
+
+DIST_COMMON = README $(noinst_HEADERS) AUTHORS COPYING ChangeLog \
+	Makefile.am Makefile.in TODO
+SOURCES = $(libisis_a_SOURCES) $(isisd_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  isisd/Makefile
+Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+clean-noinstLIBRARIES:
+	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libisis.a: $(libisis_a_OBJECTS) $(libisis_a_DEPENDENCIES) 
+	-rm -f libisis.a
+	$(libisis_a_AR) libisis.a $(libisis_a_OBJECTS) $(libisis_a_LIBADD)
+	$(RANLIB) libisis.a
+sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(sbindir)
+	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	  ; then \
+	    p1=`echo "$$p1" | sed -e 's,^.*/,,'`; \
+	    f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \
+	   $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f; \
+	  else :; fi; \
+	done
+
+uninstall-sbinPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  f=`echo "$$f" | sed -e 's,^.*/,,'`; \
+	  echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \
+	  rm -f $(DESTDIR)$(sbindir)/$$f; \
+	done
+
+clean-sbinPROGRAMS:
+	-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
+isisd$(EXEEXT): $(isisd_OBJECTS) $(isisd_DEPENDENCIES) 
+	@rm -f isisd$(EXEEXT)
+	$(LINK) $(isisd_LDFLAGS) $(isisd_OBJECTS) $(isisd_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dict.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_adjacency.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_circuit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_csm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_dr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_dynhn.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_events.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_flags.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_lsp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_misc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_network.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_pdu.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_route.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_routemap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_spf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_tlv.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isis_zebra.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isisd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso_checksum.Po@am__quote@
+
+distclean-depend:
+	-rm -rf ./$(DEPDIR)
+
+.c.o:
+@AMDEP_TRUE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+@AMDEP_TRUE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+	$(COMPILE) -c `cygpath -w $<`
+CCDEPMODE = @CCDEPMODE@
+uninstall-info-am:
+sysconfDATA_INSTALL = $(INSTALL_DATA)
+
+uninstall-sysconfDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sysconf_DATA)'; for p in $$list; do \
+	  f="`echo $$p | sed -e 's|^.*/||'`"; \
+	  echo " rm -f $(DESTDIR)$(sysconfdir)/$$f"; \
+	  rm -f $(DESTDIR)$(sysconfdir)/$$f; \
+	done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@list='$(DISTFILES)'; for file in $$list; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS)
+
+installdirs:
+	$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(sysconfdir)
+
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-noinstLIBRARIES clean-sbinPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-compile distclean-depend \
+	distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-sbinPROGRAMS install-sysconfDATA
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS \
+	uninstall-sysconfDATA
+
+.PHONY: GTAGS all all-am check check-am clean clean-generic \
+	clean-noinstLIBRARIES clean-sbinPROGRAMS distclean \
+	distclean-compile distclean-depend distclean-generic \
+	distclean-tags distdir dvi dvi-am info info-am install \
+	install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-sbinPROGRAMS install-strip install-sysconfDATA \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic tags uninstall uninstall-am \
+	uninstall-info-am uninstall-sbinPROGRAMS uninstall-sysconfDATA
+
+
+install-sysconfDATA: $(sysconf_DATA)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
+	@list='$(sysconf_DATA)'; for p in $$list; do \
+	  if test -f $(srcdir)/$$p; then \
+	    echo " $(INSTALL_SDATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p"; \
+	    $(INSTALL_SDATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p; \
+	  else if test -f $$p; then \
+	    echo " $(INSTALL_SDATA) $$p $(DESTDIR)$(sysconfdir)/$$p"; \
+	    $(INSTALL_SDATA) $$p $(DESTDIR)$(sysconfdir)/$$p; \
+	  fi; fi; \
+	done
+
+depend:
+	@$(CPP) -MM $(INCLUDES) $(LDFLAGS) *.c
+
+isis_adjacency.o : isis_adjacency.c ../lib/version.h ../lib/log.h \
+ ../isisd/isis_adjacency.h
+isis_pdu.o : isis_pdu.c ../lib/log.h ../isisd/isisd.h \
+ ../isisd/isis_constants.h ../isisd/isis_adjacency.h \
+ ../isisd/isis_pdu.h
+isis_circuit.o : isis_circuit.c ../isisd/isis_circuit.h
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

+ 20 - 0
isisd/README

@@ -0,0 +1,20 @@
+Modified files in the ZEBRA-0.92a package.
+
+ ../configure.in
+ ../Makefile.am
+ ../acconfig.h
+ ../lib/log.h
+ ../lib/memory.h
+ ../lib/vty.c
+   - case ISIS_NODE:
+ ../lib/command.c
+   - case ISIS_NODE:
+ ../lib/command.h
+   - ISIS_NODE,                    /* IS-IS protocol mode */
+   - str #definitions
+
+
+Constraints
+
+  o Maximum number of interfaces 255
+

+ 10 - 0
isisd/TODO

@@ -0,0 +1,10 @@
+Things in the TODO list for the near future
+
+o select nearest L2 when running SPF for L1
+o remove the routes when holding time for nexthop expires
+o redist 
+o autosummary
+
+Not so urgent:
+
+o Mesh groups

File diff suppressed because it is too large
+ 1496 - 0
isisd/dict.c


+ 144 - 0
isisd/dict.h

@@ -0,0 +1,144 @@
+/*
+ * Dictionary Abstract Data Type
+ * Copyright (C) 1997 Kaz Kylheku <kaz@ashi.footprints.net>
+ *
+ * Free Software License:
+ *
+ * All rights are reserved by the author, with the following exceptions:
+ * Permission is granted to freely reproduce and distribute this software,
+ * possibly in exchange for a fee, provided that this copyright notice appears
+ * intact. Permission is also granted to adapt this software to produce
+ * derivative works, as long as the modified versions carry this copyright
+ * notice and additional notices stating that the work has been modified.
+ * This source code may be translated into executable form and incorporated
+ * into proprietary software; there is no requirement for such software to
+ * contain a copyright notice related to this source.
+ *
+ * $Id: dict.h,v 1.1 2003/12/23 08:09:48 jardin Exp $
+ * $Name:  $
+ */
+
+#ifndef DICT_H
+#define DICT_H
+
+#include <limits.h>
+#ifdef KAZLIB_SIDEEFFECT_DEBUG
+#include "sfx.h"
+#endif
+
+/*
+ * Blurb for inclusion into C++ translation units
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef unsigned long dictcount_t;
+#define DICTCOUNT_T_MAX ULONG_MAX
+
+/*
+ * The dictionary is implemented as a red-black tree
+ */
+
+typedef enum { dnode_red, dnode_black } dnode_color_t;
+
+typedef struct dnode_t {
+    #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
+    struct dnode_t *dict_left;
+    struct dnode_t *dict_right;
+    struct dnode_t *dict_parent;
+    dnode_color_t dict_color;
+    const void *dict_key;
+    void *dict_data;
+    #else
+    int dict_dummy;
+    #endif
+} dnode_t;
+
+typedef int (*dict_comp_t)(const void *, const void *);
+typedef dnode_t *(*dnode_alloc_t)(void *);
+typedef void (*dnode_free_t)(dnode_t *, void *);
+
+typedef struct dict_t {
+    #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
+    dnode_t dict_nilnode;
+    dictcount_t dict_nodecount;
+    dictcount_t dict_maxcount;
+    dict_comp_t dict_compare;
+    dnode_alloc_t dict_allocnode;
+    dnode_free_t dict_freenode;
+    void *dict_context;
+    int dict_dupes;
+    #else
+    int dict_dummmy;
+    #endif
+} dict_t;
+
+typedef void (*dnode_process_t)(dict_t *, dnode_t *, void *);
+
+typedef struct dict_load_t {
+    #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
+    dict_t *dict_dictptr;
+    dnode_t dict_nilnode;
+    #else
+    int dict_dummmy;
+    #endif
+} dict_load_t;
+
+extern dict_t *dict_create(dictcount_t, dict_comp_t);
+extern void dict_set_allocator(dict_t *, dnode_alloc_t, dnode_free_t, void *);
+extern void dict_destroy(dict_t *);
+extern void dict_free_nodes(dict_t *);
+extern void dict_free(dict_t *);
+extern dict_t *dict_init(dict_t *, dictcount_t, dict_comp_t);
+extern void dict_init_like(dict_t *, const dict_t *);
+extern int dict_verify(dict_t *);
+extern int dict_similar(const dict_t *, const dict_t *);
+extern dnode_t *dict_lookup(dict_t *, const void *);
+extern dnode_t *dict_lower_bound(dict_t *, const void *);
+extern dnode_t *dict_upper_bound(dict_t *, const void *);
+extern void dict_insert(dict_t *, dnode_t *, const void *);
+extern dnode_t *dict_delete(dict_t *, dnode_t *);
+extern int dict_alloc_insert(dict_t *, const void *, void *);
+extern void dict_delete_free(dict_t *, dnode_t *);
+extern dnode_t *dict_first(dict_t *);
+extern dnode_t *dict_last(dict_t *);
+extern dnode_t *dict_next(dict_t *, dnode_t *);
+extern dnode_t *dict_prev(dict_t *, dnode_t *);
+extern dictcount_t dict_count(dict_t *);
+extern int dict_isempty(dict_t *);
+extern int dict_isfull(dict_t *);
+extern int dict_contains(dict_t *, dnode_t *);
+extern void dict_allow_dupes(dict_t *);
+extern int dnode_is_in_a_dict(dnode_t *);
+extern dnode_t *dnode_create(void *);
+extern dnode_t *dnode_init(dnode_t *, void *);
+extern void dnode_destroy(dnode_t *);
+extern void *dnode_get(dnode_t *);
+extern const void *dnode_getkey(dnode_t *);
+extern void dnode_put(dnode_t *, void *);
+extern void dict_process(dict_t *, void *, dnode_process_t);
+extern void dict_load_begin(dict_load_t *, dict_t *);
+extern void dict_load_next(dict_load_t *, dnode_t *, const void *);
+extern void dict_load_end(dict_load_t *);
+extern void dict_merge(dict_t *, dict_t *);
+
+#if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
+#ifdef KAZLIB_SIDEEFFECT_DEBUG
+#define dict_isfull(D) (SFX_CHECK(D)->dict_nodecount == (D)->dict_maxcount)
+#else
+#define dict_isfull(D) ((D)->dict_nodecount == (D)->dict_maxcount)
+#endif
+#define dict_count(D) ((D)->dict_nodecount)
+#define dict_isempty(D) ((D)->dict_nodecount == 0)
+#define dnode_get(N) ((N)->dict_data)
+#define dnode_getkey(N) ((N)->dict_key)
+#define dnode_put(N, X) ((N)->dict_data = (X))
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

+ 547 - 0
isisd/include-netbsd/clnp.h

@@ -0,0 +1,547 @@
+/*	$NetBSD: clnp.h,v 1.13 2001/08/20 12:00:54 wiz Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 1993, 1994
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)clnp.h	8.2 (Berkeley) 4/16/94
+ */
+
+/***********************************************************
+		Copyright IBM Corporation 1987
+
+                      All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of IBM not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+/*
+ * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
+ */
+
+/* should be config option but cpp breaks with too many #defines */
+#define	DECBIT
+
+/*
+ *	Return true if the mbuf is a cluster mbuf
+ */
+#define	IS_CLUSTER(m)	((m)->m_flags & M_EXT)
+
+/*
+ *	Move the halfword into the two characters
+ */
+#define	HTOC(msb, lsb, hword)\
+	(msb) = (u_char)((hword) >> 8);\
+	(lsb) = (u_char)((hword) & 0xff)
+/*
+ *	Move the two charcters into the halfword
+ */
+#define	CTOH(msb, lsb, hword)\
+	(hword) = ((msb) << 8) | (lsb)
+
+/*
+ *	Return true if the checksum has been set - ie. the checksum is
+ *	not zero
+ */
+#define	CKSUM_REQUIRED(clnp)\
+	(((clnp)->cnf_cksum_msb != 0) || ((clnp)->cnf_cksum_lsb != 0))
+
+/*
+ *	Fixed part of clnp header
+ */
+struct clnp_fixed {
+	u_char          cnf_proto_id;	/* network layer protocol identifier */
+	u_char          cnf_hdr_len;	/* length indicator (octets) */
+	u_char          cnf_vers;	/* version/protocol identifier
+					 * extension */
+	u_char          cnf_ttl;/* lifetime (500 milliseconds) */
+	u_char          cnf_type;	/* type code */
+	/* Includes err_ok, more_segs, and seg_ok */
+	u_char          cnf_seglen_msb;	/* pdu segment length (octets) high
+					 * byte */
+	u_char          cnf_seglen_lsb;	/* pdu segment length (octets) low
+					 * byte */
+	u_char          cnf_cksum_msb;	/* checksum high byte */
+	u_char          cnf_cksum_lsb;	/* checksum low byte */
+} __attribute__((packed));
+#define CNF_TYPE	0x1f
+#define CNF_ERR_OK	0x20
+#define CNF_MORE_SEGS	0x40
+#define CNF_SEG_OK	0x80
+
+#define CLNP_CKSUM_OFF	0x07	/* offset of checksum */
+
+#define	clnl_fixed	clnp_fixed
+
+/*
+ *	Segmentation part of clnp header
+ */
+struct clnp_segment {
+	u_short         cng_id;	/* data unit identifier */
+	u_short         cng_off;/* segment offset */
+	u_short         cng_tot_len;	/* total length */
+};
+
+/*
+ *	Clnp fragment reassembly structures:
+ *
+ *	All packets undergoing reassembly are linked together in
+ *	clnp_fragl structures. Each clnp_fragl structure contains a
+ *	pointer to the original clnp packet header, as well as a
+ *	list of packet fragments. Each packet fragment
+ *	is headed by a clnp_frag structure. This structure contains the
+ *	offset of the first and last byte of the fragment, as well as
+ *	a pointer to the data (an mbuf chain) of the fragment.
+ */
+
+/*
+ *	NOTE:
+ *		The clnp_frag structure is stored in an mbuf immedately
+ *		preceding the fragment data. Since there are words in
+ *		this struct, it must be word aligned.
+ *
+ *	NOTE:
+ *		All the fragment code assumes that the entire clnp header is
+ *		contained in the first mbuf.
+ */
+struct clnp_frag {
+	u_int           cfr_first;	/* offset of first byte of this frag */
+	u_int           cfr_last;	/* offset of last byte of this frag */
+	u_int           cfr_bytes;	/* bytes to shave to get to data */
+	struct mbuf    *cfr_data;	/* ptr to data for this frag */
+	struct clnp_frag *cfr_next;	/* next fragment in list */
+};
+
+struct clnp_fragl {
+	struct iso_addr cfl_src;/* source of the pkt */
+	struct iso_addr cfl_dst;/* destination of the pkt */
+	u_short         cfl_id;	/* id of the pkt */
+	u_char          cfl_ttl;/* current ttl of pkt */
+	u_short         cfl_last;	/* offset of last byte of packet */
+	struct mbuf    *cfl_orighdr;	/* ptr to original header */
+	struct clnp_frag *cfl_frags;	/* linked list of fragments for pkt */
+	struct clnp_fragl *cfl_next;	/* next pkt being reassembled */
+};
+
+/*
+ *	The following structure is used to index into an options section
+ *	of a clnp datagram. These values can be used without worry that
+ *	offset or length fields are invalid or too big, etc. That is,
+ *	the consistancy of the options will be guaranteed before this
+ *	structure is filled in. Any pointer (field ending in p) is
+ *	actually the offset from the beginning of the mbuf the option
+ *	is contained in.  A value of NULL for any pointer
+ *	means that the option is not present. The length any option
+ *	does not include the option code or option length fields.
+ */
+struct clnp_optidx {
+	u_short         cni_securep;	/* ptr to start of security option */
+	char            cni_secure_len;	/* length of entire security option */
+
+	u_short         cni_srcrt_s;	/* offset of start of src rt option */
+	u_short         cni_srcrt_len;	/* length of entire src rt option */
+
+	u_short         cni_recrtp;	/* ptr to beginning of recrt option */
+	char            cni_recrt_len;	/* length of entire recrt option */
+
+	char            cni_priorp;	/* ptr to priority option */
+
+	u_short         cni_qos_formatp;	/* ptr to format of qos
+						 * option */
+	char            cni_qos_len;	/* length of entire qos option */
+
+	u_char          cni_er_reason;	/* reason from ER pdu option */
+
+	/* ESIS options */
+
+	u_short         cni_esct;	/* value from ISH ESCT option */
+
+	u_short         cni_netmaskp;	/* ptr to beginning of netmask option */
+	char            cni_netmask_len;	/* length of entire netmask
+						 * option */
+
+	u_short         cni_snpamaskp;	/* ptr to start of snpamask option */
+	char            cni_snpamask_len;	/* length of entire snpamask
+						 * option */
+
+};
+
+#define	ER_INVALREAS	0xff	/* code for invalid ER pdu discard reason */
+
+/* given an mbuf and addr of option, return offset from data of mbuf */
+#define CLNP_OPTTOOFF(m, opt) ((u_short) (opt - mtod(m, caddr_t)))
+
+/* given an mbuf and offset of option, return address of option */
+#define CLNP_OFFTOOPT(m, off) ((caddr_t) (mtod(m, caddr_t) + off))
+
+/* return true iff src route is valid */
+#define	CLNPSRCRT_VALID(oidx) ((oidx) && (oidx->cni_srcrt_s))
+
+/* return the offset field of the src rt */
+#define CLNPSRCRT_OFF(oidx, options)\
+	(*((u_char *)(CLNP_OFFTOOPT(options, oidx->cni_srcrt_s) + 1)))
+
+/* return the type field of the src rt */
+#define CLNPSRCRT_TYPE(oidx, options)\
+	((u_char)(*(CLNP_OFFTOOPT(options, oidx->cni_srcrt_s))))
+
+/* return the length of the current address */
+#define CLNPSRCRT_CLEN(oidx, options)\
+	((u_char)(*(CLNP_OFFTOOPT(options, oidx->cni_srcrt_s) + CLNPSRCRT_OFF(oidx, options) - 1)))
+
+/* return the address of the current address */
+#define CLNPSRCRT_CADDR(oidx, options)\
+	((caddr_t)(CLNP_OFFTOOPT(options, oidx->cni_srcrt_s) + CLNPSRCRT_OFF(oidx, options)))
+
+/*
+ * return true if the src route has run out of routes this is true if the
+ * offset of next route is greater than the end of the rt
+ */
+#define	CLNPSRCRT_TERM(oidx, options)\
+	(CLNPSRCRT_OFF(oidx, options) > oidx->cni_srcrt_len)
+
+/*
+ *	Options a user can set/get
+ */
+#define	CLNPOPT_FLAGS	0x01	/* flags: seg permitted, no er xmit, etc  */
+#define	CLNPOPT_OPTS	0x02	/* datagram options */
+
+/*
+ *	Values for particular datagram options
+ */
+#define	CLNPOVAL_PAD		0xcc	/* padding */
+#define	CLNPOVAL_SECURE		0xc5	/* security */
+#define	CLNPOVAL_SRCRT		0xc8	/* source routing */
+#define	CLNPOVAL_RECRT		0xcb	/* record route */
+#define	CLNPOVAL_QOS		0xc3	/* quality of service */
+#define	CLNPOVAL_PRIOR		0xcd	/* priority */
+#define CLNPOVAL_ERREAS		0xc1	/* ER PDU ONLY: reason for discard */
+
+#define	CLNPOVAL_SRCSPEC	0x40	/* source address specific */
+#define	CLNPOVAL_DSTSPEC	0x80	/* destination address specific */
+#define	CLNPOVAL_GLOBAL		0xc0	/* globally unique */
+
+/* Globally Unique QOS */
+#define	CLNPOVAL_SEQUENCING	0x10	/* sequencing preferred */
+#define CLNPOVAL_CONGESTED	0x08	/* congestion experienced */
+#define CLNPOVAL_LOWDELAY	0x04	/* low transit delay */
+
+#define	CLNPOVAL_PARTRT		0x00	/* partial source routing */
+#define CLNPOVAL_COMPRT		0x01	/* complete source routing */
+
+/*
+ *	Clnp flags used in a control block flags field.
+ *	NOTE: these must be out of the range of bits defined in ../net/raw_cb.h
+ */
+#define	CLNP_NO_SEG		0x010	/* segmentation not permitted */
+#define	CLNP_NO_ER		0x020	/* do not generate ERs */
+#define CLNP_SEND_RAW		0x080	/* send pkt as RAW DT not TP DT */
+#define	CLNP_NO_CKSUM		0x100	/* don't use clnp checksum */
+#define CLNP_ECHO		0x200	/* send echo request */
+#define	CLNP_NOCACHE		0x400	/* don't store cache information */
+#define CLNP_ECHOR		0x800	/* send echo reply */
+
+/* valid clnp flags */
+#define CLNP_VFLAGS \
+	(CLNP_SEND_RAW|CLNP_NO_SEG|CLNP_NO_ER|CLNP_NO_CKSUM|\
+	 CLNP_ECHO|CLNP_NOCACHE|CLNP_ECHOR)
+
+/*
+ * Constants used by clnp
+ */
+#define	CLNP_HDR_MIN	(sizeof (struct clnp_fixed))
+#define	CLNP_HDR_MAX	(254)
+#define	CLNP_TTL_UNITS	2	/* 500 milliseconds */
+#define CLNP_TTL	15*CLNP_TTL_UNITS	/* time to live (seconds) */
+#define	ISO8473_V1	0x01
+
+/*
+ *	Clnp packet types
+ *	In order to test raw clnp and tp/clnp simultaneously, a third type of
+ *	packet has been defined: CLNP_RAW. This is done so that the input
+ *	routine can switch to the correct input routine (rclnp_input or
+ *	tpclnp_input) based on the type field. If clnp had a higher level
+ *	protocol field, this would not be necessary.
+ */
+#define	CLNP_DT			0x1C	/* normal data */
+#define	CLNP_ER			0x01	/* error report */
+#define	CLNP_RAW		0x1D	/* debug only */
+#define CLNP_EC			0x1E	/* echo packet */
+#define CLNP_ECR		0x1F	/* echo reply */
+
+/*
+ *	ER pdu error codes
+ */
+#define GEN_NOREAS		0x00	/* reason not specified */
+#define GEN_PROTOERR		0x01	/* protocol procedure error */
+#define GEN_BADCSUM		0x02	/* incorrect checksum */
+#define GEN_CONGEST		0x03	/* pdu discarded due to congestion */
+#define GEN_HDRSYNTAX		0x04	/* header syntax error */
+#define GEN_SEGNEEDED		0x05	/* need segmentation but not allowed */
+#define GEN_INCOMPLETE		0x06	/* incomplete pdu received */
+#define GEN_DUPOPT		0x07	/* duplicate option */
+
+/* address errors */
+#define ADDR_DESTUNREACH	0x80	/* destination address unreachable */
+#define ADDR_DESTUNKNOWN	0x81	/* destination address unknown */
+
+/* source routing */
+#define SRCRT_UNSPECERR		0x90	/* unspecified src rt error */
+#define SRCRT_SYNTAX		0x91	/* syntax error in src rt field */
+#define SRCRT_UNKNOWNADDR	0x92	/* unknown addr in src rt field */
+#define SRCRT_BADPATH		0x93	/* path not acceptable */
+
+/* lifetime */
+#define TTL_EXPTRANSIT		0xa0	/* lifetime expired during transit */
+#define TTL_EXPREASS		0xa1	/* lifetime expired during reassembly */
+
+/* pdu discarded */
+#define DISC_UNSUPPOPT		0xb0	/* unsupported option not specified? */
+#define DISC_UNSUPPVERS		0xb1	/* unsupported protocol version */
+#define DISC_UNSUPPSECURE	0xb2	/* unsupported security option */
+#define DISC_UNSUPPSRCRT	0xb3	/* unsupported src rt option */
+#define DISC_UNSUPPRECRT	0xb4	/* unsupported rec rt option */
+
+/* reassembly */
+#define REASS_INTERFERE		0xc0	/* reassembly interference */
+#define CLNP_ERRORS		22
+
+
+#ifdef CLNP_ER_CODES
+u_char          clnp_er_codes[CLNP_ERRORS] = {
+	GEN_NOREAS, GEN_PROTOERR, GEN_BADCSUM, GEN_CONGEST,
+	GEN_HDRSYNTAX, GEN_SEGNEEDED, GEN_INCOMPLETE, GEN_DUPOPT,
+	ADDR_DESTUNREACH, ADDR_DESTUNKNOWN,
+	SRCRT_UNSPECERR, SRCRT_SYNTAX, SRCRT_UNKNOWNADDR, SRCRT_BADPATH,
+	TTL_EXPTRANSIT, TTL_EXPREASS,
+	DISC_UNSUPPOPT, DISC_UNSUPPVERS, DISC_UNSUPPSECURE,
+	DISC_UNSUPPSRCRT, DISC_UNSUPPRECRT, REASS_INTERFERE
+};
+#endif
+
+#ifdef	TROLL
+
+#define	TR_DUPEND		0x01	/* duplicate end of fragment */
+#define TR_DUPPKT		0x02	/* duplicate entire packet */
+#define	TR_DROPPKT		0x04	/* drop packet on output */
+#define TR_TRIM			0x08	/* trim bytes from packet */
+#define TR_CHANGE		0x10	/* change bytes in packet */
+#define TR_MTU			0x20	/* delta to change device mtu */
+#define	TR_CHUCK		0x40	/* drop packet in rclnp_input */
+#define	TR_BLAST		0x80	/* force rclnp_output to blast many
+					 * packet */
+#define	TR_RAWLOOP		0x100	/* make if_loop call clnpintr
+					 * directly */
+struct troll {
+	int             tr_ops;	/* operations to perform */
+	float           tr_dup_size;	/* % to duplicate */
+	float           tr_dup_freq;	/* frequency to duplicate packets */
+	float           tr_drop_freq;	/* frequence to drop packets */
+	int             tr_mtu_adj;	/* delta to adjust if mtu */
+	int             tr_blast_cnt;	/* # of pkts to blast out */
+};
+
+#define	SN_OUTPUT(clcp, m)\
+	troll_output(clcp->clc_ifp, m, clcp->clc_firsthop, clcp->clc_rt)
+
+#define	SN_MTU(ifp, rt) (((rt && rt->rt_rmx.rmx_mtu) ?\
+	rt->rt_rmx.rmx_mtu : clnp_badmtu(ifp, rt, __LINE__, __FILE__))\
+		- trollctl.tr_mtu_adj)
+
+#ifdef _KERNEL
+extern float    troll_random;
+#endif
+
+#else				/* NO TROLL */
+
+#define	SN_OUTPUT(clcp, m)\
+	(*clcp->clc_ifp->if_output)(clcp->clc_ifp, m, clcp->clc_firsthop, \
+				    clcp->clc_rt)
+
+#define	SN_MTU(ifp, rt) (((rt && rt->rt_rmx.rmx_mtu) ?\
+	rt->rt_rmx.rmx_mtu : clnp_badmtu(ifp, rt, __LINE__, __FILE__)))
+
+#endif				/* TROLL */
+
+/*
+ *	Macro to remove an address from a clnp header
+ */
+#define CLNP_EXTRACT_ADDR(isoa, hoff, hend)\
+	{\
+		isoa.isoa_len = (u_char)*hoff;\
+		if ((((++hoff) + isoa.isoa_len) > hend) ||\
+			(isoa.isoa_len > 20) || (isoa.isoa_len == 0)) {\
+			hoff = (caddr_t)0;\
+		} else {\
+			(void) bcopy(hoff, (caddr_t)isoa.isoa_genaddr, \
+				     isoa.isoa_len);\
+			hoff += isoa.isoa_len;\
+		}\
+	}
+
+/*
+ *	Macro to insert an address into a clnp header
+ */
+#define CLNP_INSERT_ADDR(hoff, isoa)\
+	*hoff++ = (isoa).isoa_len;\
+	(void) bcopy((caddr_t)((isoa).isoa_genaddr), hoff, (isoa).isoa_len);\
+	hoff += (isoa).isoa_len;
+
+/*
+ *	Clnp hdr cache.	Whenever a clnp packet is sent, a copy of the
+ *	header is made and kept in this cache. In addition to a copy of
+ *	the cached clnp hdr, the cache contains
+ *	information necessary to determine whether the new packet
+ *	to send requires a new header to be built.
+ */
+struct clnp_cache {
+	/* these fields are used to check the validity of the cache */
+	struct iso_addr clc_dst;/* destination of packet */
+	struct mbuf    *clc_options;	/* ptr to options mbuf */
+	int             clc_flags;	/* flags passed to clnp_output */
+
+	/* these fields are state that clnp_output requires to finish the pkt */
+	int             clc_segoff;	/* offset of seg part of header */
+	struct rtentry *clc_rt;	/* ptr to rtentry (points into the route
+				 * structure) */
+	struct sockaddr *clc_firsthop;	/* first hop of packet */
+	struct ifnet   *clc_ifp;/* ptr to interface structure */
+	struct iso_ifaddr
+	               *clc_ifa;/* ptr to interface address */
+	struct mbuf    *clc_hdr;/* cached pkt hdr (finally)! */
+};
+
+#ifdef	_KERNEL
+struct iso_addr;
+struct sockaddr_iso;
+struct mbuf;
+struct clnp_segment;
+struct sockaddr;
+struct rt_entry;
+struct clnp_fragl;
+struct clnp_optidx;
+struct isopcb;
+struct snpa_hdr;
+struct iso_ifaddr;
+struct route_iso;
+
+/* clnp_debug.c */
+char *clnp_hexp __P((char *, int, char *));
+char *clnp_iso_addrp __P((struct iso_addr *));
+char *clnp_saddr_isop __P((struct sockaddr_iso *));
+
+/* clnp_er.c */
+void clnp_er_input __P((struct mbuf *, struct iso_addr *, u_int));
+void clnp_discard __P((struct mbuf *, u_int));
+void clnp_emit_er __P((struct mbuf *, u_int));
+int clnp_er_index __P((u_int));
+
+int clnp_fragment __P((struct ifnet *, struct mbuf *, struct sockaddr *,
+		       int, int, int, struct rtentry *));
+struct mbuf *clnp_reass __P((struct mbuf *, struct iso_addr *,
+			     struct iso_addr *, struct clnp_segment *));
+int clnp_newpkt __P((struct mbuf *, struct iso_addr *, struct iso_addr *,
+		     struct clnp_segment *));
+void clnp_insert_frag __P((struct clnp_fragl *, struct mbuf *,
+			   struct clnp_segment *));
+struct mbuf    *clnp_comp_pdu __P((struct clnp_fragl *));
+#ifdef TROLL
+float troll_random __P((void));
+int troll_output __P((struct ifnet *, struct mbuf *, struct sockaddr *,
+		      struct rtentry *));
+#endif
+
+/* clnp_input.c */
+void clnp_init  __P((void));
+void clnlintr    __P((void));
+void clnp_input __P((struct mbuf *, ...));
+
+/* clnp_options.c */
+void clnp_update_srcrt __P((struct mbuf *, struct clnp_optidx *));
+void clnp_dooptions __P((struct mbuf *, struct clnp_optidx *, struct ifnet *,
+			 struct iso_addr *));
+int clnp_set_opts __P((struct mbuf **, struct mbuf **));
+int clnp_opt_sanity __P((struct mbuf *, caddr_t, int, struct clnp_optidx *));
+
+/* clnp_output.c */
+int clnp_output __P((struct mbuf *, ...));
+void clnp_ctloutput __P((void));
+
+/* clnp_raw.c */
+void rclnp_input __P((struct mbuf *, ...));
+int rclnp_output __P((struct mbuf *, ...));
+int rclnp_ctloutput __P((int, struct socket *, int, int, struct mbuf **));
+int clnp_usrreq __P((struct socket *, int, struct mbuf *, struct mbuf *,
+		     struct mbuf *, struct proc *));
+
+/* clnp_subr.c */
+struct mbuf    *clnp_data_ck __P((struct mbuf *, int));
+caddr_t clnp_extract_addr __P((caddr_t, int, struct iso_addr *,
+			       struct iso_addr *));
+int clnp_ours   __P((struct iso_addr *));
+void clnp_forward __P((struct mbuf *, int, struct iso_addr *,
+		       struct clnp_optidx *, int, struct snpa_hdr *));
+caddr_t clnp_insert_addr __P((caddr_t, struct iso_addr *, struct iso_addr *));
+int clnp_route  __P((struct iso_addr *, struct route_iso *, int,
+		     struct sockaddr **, struct iso_ifaddr **));
+int clnp_srcroute __P((struct mbuf *, struct clnp_optidx *, struct route_iso *,
+		       struct sockaddr **, struct iso_ifaddr **,
+		       struct iso_addr *));
+int clnp_echoreply __P((struct mbuf *, int, struct sockaddr_iso *,
+		        struct sockaddr_iso *, struct clnp_optidx *));
+int clnp_badmtu __P((struct ifnet *, struct rtentry *, int, char *));
+void clnp_ypocb  __P((caddr_t, caddr_t, u_int));
+
+/* clnp_timer.c */
+struct clnp_fragl *clnp_freefrags __P((struct clnp_fragl *));
+void clnp_slowtimo __P((void));
+void clnp_drain __P((void));
+
+#ifdef	TROLL
+struct troll    trollctl;
+#endif /* TROLL */
+
+#endif /* _KERNEL */

+ 146 - 0
isisd/include-netbsd/esis.h

@@ -0,0 +1,146 @@
+/*	$NetBSD: esis.h,v 1.11 1997/11/03 15:01:19 is Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)esis.h	8.1 (Berkeley) 6/10/93
+ */
+
+/***********************************************************
+		Copyright IBM Corporation 1987
+
+                      All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of IBM not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+/*
+ * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
+ */
+
+#include <machine/endian.h>
+
+#define	SNPAC_AGE		60	/* seconds */
+#define	ESIS_CONFIG		60	/* seconds */
+#define	ESIS_HT			(ESIS_CONFIG * 2)
+
+/*
+ *	Fixed part of an ESIS header
+ */
+struct esis_fixed {
+	u_char          esis_proto_id;	/* network layer protocol identifier */
+	u_char          esis_hdr_len;	/* length indicator (octets) */
+	u_char          esis_vers;	/* version/protocol identifier
+					 * extension */
+	u_char          esis_res1;	/* reserved */
+	u_char          esis_type;	/* type code */
+	/* technically, type should be &='d 0x1f */
+#define ESIS_ESH	0x02	/* End System Hello */
+#define ESIS_ISH	0x04	/* Intermediate System Hello */
+#define ESIS_RD		0x06	/* Redirect */
+	u_char          esis_ht_msb;	/* holding time (seconds) high byte */
+	u_char          esis_ht_lsb;	/* holding time (seconds) low byte */
+	u_char          esis_cksum_msb;	/* checksum high byte */
+	u_char          esis_cksum_lsb;	/* checksum low byte */
+} __attribute__((packed));
+/*
+ * Values for ESIS datagram options
+ */
+#define ESISOVAL_NETMASK	0xe1	/* address mask option, RD PDU only */
+#define ESISOVAL_SNPAMASK	0xe2	/* snpa mask option, RD PDU only */
+#define ESISOVAL_ESCT		0xc6	/* end system conf. timer, ISH PDU
+					 * only */
+
+
+#define	ESIS_CKSUM_OFF		0x07
+#define ESIS_CKSUM_REQUIRED(pdu)\
+	((pdu->esis_cksum_msb != 0) || (pdu->esis_cksum_lsb != 0))
+
+#define	ESIS_VERSION	1
+
+struct esis_stat {
+	u_short         es_nomem;	/* insufficient memory to send hello */
+	u_short         es_badcsum;	/* incorrect checksum */
+	u_short         es_badvers;	/* incorrect version number */
+	u_short         es_badtype;	/* unknown pdu type field */
+	u_short         es_toosmall;	/* packet too small */
+	u_short         es_eshsent;	/* ESH sent */
+	u_short         es_eshrcvd;	/* ESH rcvd */
+	u_short         es_ishsent;	/* ISH sent */
+	u_short         es_ishrcvd;	/* ISH rcvd */
+	u_short         es_rdsent;	/* RD sent */
+	u_short         es_rdrcvd;	/* RD rcvd */
+};
+
+#ifdef	_KERNEL
+struct esis_stat esis_stat;
+struct socket;
+struct mbuf;
+struct snpa_hdr;
+struct clnp_optidx;
+struct iso_addr;
+struct rtentry;
+struct sockaddr_dl;
+
+void esis_init __P((void));
+int esis_usrreq __P((struct socket *, int, struct mbuf *, struct mbuf *,
+		     struct mbuf *, struct proc *));
+void esis_input __P((struct mbuf *, ...));
+void esis_rdoutput __P((struct snpa_hdr *, struct mbuf *, struct clnp_optidx *,
+			struct iso_addr *, struct rtentry *));
+int esis_insert_addr __P((caddr_t *, int *, struct iso_addr *, struct mbuf *,
+			  int));
+void esis_eshinput __P((struct mbuf *, struct snpa_hdr *));
+void esis_ishinput __P((struct mbuf *, struct snpa_hdr *));
+void esis_rdinput __P((struct mbuf *, struct snpa_hdr *));
+void esis_config __P((void *));
+void esis_shoutput __P((struct ifnet *, int, int, caddr_t, int,
+	               struct iso_addr *));
+void isis_input __P((struct mbuf *, ...));
+int isis_output __P((struct mbuf *, ...));
+void *esis_ctlinput __P((int, struct sockaddr *, void *));
+#endif /* _KERNEL */

+ 208 - 0
isisd/include-netbsd/iso.h

@@ -0,0 +1,208 @@
+/*	$NetBSD: iso.h,v 1.13 2000/07/28 12:13:34 kleink Exp $	*/
+
+/*-
+ * Copyright (c) 1991, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)iso.h	8.1 (Berkeley) 6/10/93
+ */
+
+/***********************************************************
+		Copyright IBM Corporation 1987
+
+                      All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of IBM not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+/*
+ * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
+ */
+
+#ifndef _NETISO_ISO_H_
+#define _NETISO_ISO_H_
+
+#if 0
+#include <sys/ansi.h>
+#endif
+
+#if 0
+#ifndef sa_family_t
+typedef __sa_family_t	sa_family_t;
+#define sa_family_t	__sa_family_t
+#endif
+#endif
+/*
+ *	Return true if this is a multicast address
+ *	This assumes that the bit transmission is lsb first. This
+ *	assumption is valid for 802.3 but not 802.5. There is a
+ *	kludge to get around this for 802.5 -- see if_lan.c
+ *	where subnetwork header is setup.
+ */
+#define	IS_MULTICAST(snpa)\
+	((snpa)[0] & 0x01)
+
+/*
+ * Protocols
+ */
+#define	ISOPROTO_TCP	6	/* IETF experiment */
+#define	ISOPROTO_UDP	17	/* IETF experiment */
+#define	ISOPROTO_TP0	25	/* connection oriented transport protocol */
+#define	ISOPROTO_TP1	26	/* not implemented */
+#define	ISOPROTO_TP2	27	/* not implemented */
+#define	ISOPROTO_TP3	28	/* not implemented */
+#define	ISOPROTO_TP4	29	/* connection oriented transport protocol */
+#define	ISOPROTO_TP		ISOPROTO_TP4	/* tp-4 with negotiation */
+#define	ISOPROTO_CLTP	30	/* connectionless transport (not yet impl.) */
+#define	ISOPROTO_CLNP	31	/* connectionless internetworking protocol */
+#define	ISOPROTO_X25	32	/* cons */
+#define	ISOPROTO_INACT_NL	33	/* inactive network layer! */
+#define	ISOPROTO_ESIS	34	/* ES-IS protocol */
+#define	ISOPROTO_INTRAISIS	35	/* IS-IS protocol */
+#define	ISOPROTO_IDRP	36	/* Interdomain Routing Protocol */
+
+#define	ISOPROTO_RAW	255	/* raw clnp */
+#define	ISOPROTO_MAX	256
+
+#define	ISO_PORT_RESERVED		1024
+#define	ISO_PORT_USERRESERVED	5000
+/*
+ * Port/socket numbers: standard network functions
+ * NOT PRESENTLY USED
+ */
+#define	ISO_PORT_MAINT		501
+#define	ISO_PORT_ECHO		507
+#define	ISO_PORT_DISCARD	509
+#define	ISO_PORT_SYSTAT		511
+#define	ISO_PORT_NETSTAT	515
+/*
+ * Port/socket numbers: non-standard application functions
+ */
+#define ISO_PORT_LOGIN		513
+/*
+ * Port/socket numbers: public use
+ */
+#define ISO_PORT_PUBLIC		1024	/* high bit set --> public */
+
+/*
+ *	Network layer protocol identifiers
+ */
+#define ISO8473_CLNP	0x81
+#define	ISO9542_ESIS	0x82
+#define ISO9542X25_ESIS	0x8a
+#define ISO10589_ISIS	0x83
+#define ISO8878A_CONS	0x84
+#define ISO10747_IDRP	0x85
+
+
+#ifndef IN_CLASSA_NET
+#include <netinet/in.h>
+#endif				/* IN_CLASSA_NET */
+
+
+
+/*
+ * The following looks like a sockaddr to facilitate using tree lookup
+ * routines
+ */
+struct iso_addr {
+	u_char          isoa_len;	/* length (in bytes) */
+	char            isoa_genaddr[20];	/* general opaque address */
+};
+
+struct sockaddr_iso {
+	u_char          siso_len;	/* length */
+	sa_family_t     siso_family;	/* family */
+	u_char          siso_plen;	/* presentation selector length */
+	u_char          siso_slen;	/* session selector length */
+	u_char          siso_tlen;	/* transport selector length */
+	struct iso_addr siso_addr;	/* network address */
+	u_char          siso_pad[6];	/* space for gosip v2 sels */
+	/* makes struct 32 bytes long */
+};
+#define siso_nlen siso_addr.isoa_len
+#define siso_data siso_addr.isoa_genaddr
+
+#define TSEL(s) ((caddr_t)((s)->siso_data + (s)->siso_nlen))
+
+#define SAME_ISOADDR(a, b) \
+	(bcmp((a)->siso_data, (b)->siso_data, (unsigned)(a)->siso_nlen)==0)
+#define SAME_ISOIFADDR(a, b) (bcmp((a)->siso_data, (b)->siso_data, \
+	(unsigned)((b)->siso_nlen - (b)->siso_tlen)) == 0)
+/*
+ * The following are specific values for siso->siso_data[0],
+ * otherwise known as the AFI:
+ */
+#define	AFI_37		0x37	/* bcd of "37" */
+#define AFI_OSINET	0x47	/* bcd of "47" */
+#define AFI_RFC986	0x47	/* bcd of "47" */
+#define	AFI_SNA		0x00	/* SubNetwork Address; invalid really... */
+
+#ifdef _KERNEL
+
+extern struct domain isodomain;
+extern struct protosw isosw[];
+
+#define	satosiso(sa)	((struct sockaddr_iso *)(sa))
+#define	sisotosa(siso)	((struct sockaddr *)(siso))
+
+#else
+/* user utilities definitions from the iso library */
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+struct iso_addr *iso_addr __P((const char *));
+char           *iso_ntoa __P((const struct iso_addr *));
+
+/* THESE DON'T EXIST YET */
+struct hostent *iso_gethostbyname __P((const char *));
+struct hostent *iso_gethostbyaddr __P((const char *, int, int));
+__END_DECLS
+
+#endif /* _KERNEL */
+
+#endif /* _NETISO_ISO_H_ */

+ 508 - 0
isisd/isis_adjacency.c

@@ -0,0 +1,508 @@
+/*
+ * IS-IS Rout(e)ing protocol - isis_adjacency.c   
+ *                             handling of IS-IS adjacencies
+ *
+ * Copyright (C) 2001,2002   Sampo Saaristo
+ *                           Tampere University of Technology      
+ *                           Institute of Communications Engineering
+ *
+ * This program is free software; you can redistribute it and/or modify it 
+ * under the terms of the GNU General Public Licenseas published by the Free 
+ * Software Foundation; either version 2 of the License, or (at your option) 
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT 
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+ * more details.
+
+ * You should have received a copy of the GNU General Public License along 
+ * with this program; if not, write to the Free Software Foundation, Inc., 
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#include <stdio.h>
+#include <limits.h>
+#include <string.h>
+#include <zebra.h>
+#include <net/ethernet.h>
+
+
+#include "log.h"
+#include "memory.h"
+#include "hash.h"
+#include "vty.h"
+#include "linklist.h"
+#include "thread.h"
+#include "if.h"
+#include "stream.h"
+
+#include "isisd/dict.h"
+#include "isisd/include-netbsd/iso.h"
+#include "isisd/isis_constants.h"
+#include "isisd/isis_common.h"
+#include "isisd/isisd.h"
+#include "isisd/isis_circuit.h"
+#include "isisd/isis_adjacency.h"
+#include "isisd/isis_misc.h"
+#include "isisd/isis_dr.h"
+#include "isisd/isis_dynhn.h"
+#include "isisd/isis_pdu.h"
+
+
+extern struct isis *isis;
+
+
+struct isis_adjacency *
+adj_alloc (u_char *id)
+{
+    struct isis_adjacency *adj;
+
+    adj = XMALLOC (MTYPE_ISIS_ADJACENCY, sizeof (struct isis_adjacency));
+    memset (adj, 0, sizeof (struct isis_adjacency));
+    memcpy (adj->sysid, id, ISIS_SYS_ID_LEN);
+    
+    return adj;
+}
+
+struct isis_adjacency *
+isis_new_adj (u_char *id, u_char *snpa, int level, 
+	      struct isis_circuit *circuit)
+{
+
+  struct isis_adjacency *adj;
+  int i;  
+
+  adj = adj_alloc (id); /* P2P kludge */
+  
+  if (adj == NULL){
+    zlog_err ("Out of memory!");
+    return NULL;
+  }
+
+  memcpy (adj->snpa, snpa, 6);
+  adj->circuit = circuit;
+  adj->level = level;
+  adj->flaps = 0;
+  adj->last_flap = time (NULL);
+  if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
+    listnode_add (circuit->u.bc.adjdb[level-1], adj);
+    adj->dischanges[level - 1] = 0;
+    for (i = 0; i < DIS_RECORDS; i++) /* clear N DIS state change records */
+	{
+	  adj->dis_record[(i * ISIS_LEVELS) + level - 1].dis 
+	    = ISIS_UNKNOWN_DIS;
+	  adj->dis_record[(i * ISIS_LEVELS) + level - 1].last_dis_change 
+            = time (NULL);
+	}
+  }
+
+  return adj;
+}
+
+struct isis_adjacency *
+isis_adj_lookup (u_char *sysid,  struct list *adjdb)
+{
+  struct isis_adjacency *adj;
+  struct listnode *node;
+
+  for (node = listhead (adjdb); node; nextnode (node)) {
+    adj = getdata (node);
+    if (memcmp (adj->sysid, sysid, ISIS_SYS_ID_LEN) == 0)
+      return adj;
+  }
+  
+  return NULL;
+}
+
+
+struct isis_adjacency *
+isis_adj_lookup_snpa (u_char *ssnpa, struct list *adjdb)
+{
+  struct listnode *node;
+  struct isis_adjacency *adj;
+
+  for (node = listhead (adjdb); node; nextnode (node)) {
+    adj = getdata (node);
+    if (memcmp (adj->snpa, ssnpa, ETH_ALEN) == 0)
+      return adj;
+  }
+  
+  return NULL;
+}
+
+/*
+ * When we recieve a NULL list, we will know its p2p
+ */
+void 
+isis_delete_adj (struct isis_adjacency *adj, struct list *adjdb)
+{
+  struct isis_adjacency *adj2;
+  struct listnode *node;
+  
+  if (adjdb) {
+    for (node = listhead (adjdb); node; nextnode (node)) {
+      adj2 = getdata (node);
+      if (adj2 == adj)
+        break;
+    }
+    listnode_delete (adjdb, node);
+  }
+  
+  if (adj->ipv4_addrs)
+    list_delete (adj->ipv4_addrs);
+#ifdef HAVE_IPV6
+  if (adj->ipv6_addrs)
+    list_delete (adj->ipv6_addrs);
+#endif
+  if (adj) {
+    XFREE (MTYPE_ISIS_ADJACENCY,adj);
+  } else {
+    zlog_info ("tried to delete a non-existent adjacency");
+  }
+  
+  
+
+  return;
+}
+
+void 
+isis_adj_state_change (struct isis_adjacency *adj, enum isis_adj_state state, 
+                       char *reason)
+
+{
+  int old_state;
+  int level = adj->level;
+  struct isis_circuit *circuit;
+  
+  old_state = adj->adj_state;
+  adj->adj_state = state;
+
+  circuit = adj->circuit;
+  
+  if (isis->debugs & DEBUG_ADJ_PACKETS) {
+    zlog_info ("ISIS-Adj (%s): Adjacency state change %d->%d: %s",
+               circuit->area->area_tag,
+               old_state,
+               state, 
+               reason ? reason : "unspecified");
+  }
+
+  if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
+    if (state == ISIS_ADJ_UP)
+      circuit->upadjcount[level-1]++;
+    if (state == ISIS_ADJ_DOWN) {
+      isis_delete_adj (adj, adj->circuit->u.bc.adjdb[level - 1]);
+      circuit->upadjcount[level-1]--;
+    }
+
+    list_delete_all_node (circuit->u.bc.lan_neighs[level - 1]);
+    isis_adj_build_neigh_list (circuit->u.bc.adjdb[level - 1],
+                               circuit->u.bc.lan_neighs[level - 1]);
+  } else if (state == ISIS_ADJ_UP) { /* p2p interface */
+    if (adj->sys_type == ISIS_SYSTYPE_UNKNOWN)
+      send_hello (circuit, 1);
+    
+    /* update counter & timers for debugging purposes */
+    adj->last_flap = time(NULL);
+    adj->flaps++;
+
+    /* 7.3.17 - going up on P2P -> send CSNP */
+    /* FIXME: yup, I know its wrong... but i will do it! (for now) */
+    send_csnp (circuit,1);
+    send_csnp (circuit,2);
+  } else if (state == ISIS_ADJ_DOWN) { /* p2p interface */
+    adj->circuit->u.p2p.neighbor = NULL;
+    isis_delete_adj (adj, NULL);
+  }
+  return;
+}
+
+
+void
+isis_adj_print (struct isis_adjacency *adj)
+{
+  struct isis_dynhn *dyn;
+  struct listnode *node;
+  struct in_addr *ipv4_addr;
+#ifdef HAVE_IPV6 
+  struct in6_addr *ipv6_addr;
+  u_char ip6 [INET6_ADDRSTRLEN];
+#endif /* HAVE_IPV6 */
+  
+  if(!adj)
+    return;
+  dyn = dynhn_find_by_id (adj->sysid);
+  if (dyn)
+    zlog_info ("%s", dyn->name.name);
+  
+  zlog_info ("SystemId %20s SNPA %s, level %d\nHolding Time %d",
+             adj->sysid ? sysid_print (adj->sysid) : "unknown" , 
+             snpa_print (adj->snpa),
+             adj->level, adj->hold_time);
+  if (adj->ipv4_addrs && listcount (adj->ipv4_addrs) > 0) {
+    zlog_info ("IPv4 Addresses:");
+    
+    for (node = listhead (adj->ipv4_addrs); node; nextnode (node)) {
+      ipv4_addr = getdata (node);
+      zlog_info ("%s", inet_ntoa(*ipv4_addr));
+    }
+  }
+
+#ifdef HAVE_IPV6  
+  if (adj->ipv6_addrs && listcount (adj->ipv6_addrs) > 0) {
+    zlog_info ("IPv6 Addresses:");
+    for (node = listhead (adj->ipv6_addrs); node; nextnode (node)) {
+      ipv6_addr = getdata (node);
+      inet_ntop (AF_INET6, ipv6_addr, ip6, INET6_ADDRSTRLEN); 
+      zlog_info ("%s", ip6);
+    }
+  }
+#endif /* HAVE_IPV6 */
+  zlog_info ("Speaks: %s", nlpid2string(&adj->nlpids));
+  
+
+  return;
+}
+
+int 
+isis_adj_expire (struct thread *thread)
+{
+  struct isis_adjacency *adj;
+  int level;
+
+  /*
+   * Get the adjacency
+   */
+  adj = THREAD_ARG (thread);
+  assert (adj);
+  level = adj->level;
+
+  /* trigger the adj expire event */
+  isis_adj_state_change (adj, ISIS_ADJ_DOWN, "holding time expired");
+
+  return 0;
+}
+
+const char *
+adj_state2string (int state)
+{
+  
+  switch (state) {
+  case ISIS_ADJ_INITIALIZING:
+    return "Initializing";
+  case ISIS_ADJ_UP:
+    return "Up";
+  case ISIS_ADJ_DOWN:
+    return "Down";
+  default:
+    return "Unknown";
+  }
+  
+  return NULL; /* not reached */
+}
+
+/*
+ * show clns/isis neighbor (detail)
+ */
+void
+isis_adj_print_vty2 (struct isis_adjacency *adj, struct vty *vty, char detail)
+{
+
+#ifdef HAVE_IPV6
+  struct in6_addr *ipv6_addr;
+  u_char ip6 [INET6_ADDRSTRLEN];
+#endif /* HAVE_IPV6 */
+  struct in_addr *ip_addr;
+  time_t now;
+  struct isis_dynhn *dyn;
+  int level;
+  struct listnode *node;
+
+  dyn = dynhn_find_by_id (adj->sysid);
+  if (dyn)
+    vty_out (vty, "  %-20s", dyn->name.name);
+  else if (adj->sysid){
+    vty_out (vty, "  %-20s", sysid_print (adj->sysid));
+  } else {
+    vty_out (vty, "  unknown ");
+  }
+
+  if (detail == ISIS_UI_LEVEL_BRIEF) {
+    if (adj->circuit)
+      vty_out (vty, "%-12s",adj->circuit->interface->name); 
+    else
+      vty_out (vty, "NULL circuit!");
+    vty_out (vty, "%-3u", adj->level); /* level */
+    vty_out (vty, "%-13s", adj_state2string (adj->adj_state));
+    now = time (NULL);
+    vty_out (vty, "%-9lu", adj->last_upd + adj->hold_time - now);
+    vty_out (vty, "%-10s", snpa_print (adj->snpa)); 
+    vty_out (vty, "%s", VTY_NEWLINE);
+  }
+
+  if (detail == ISIS_UI_LEVEL_DETAIL) {
+    level = adj->level;
+    if (adj->circuit)
+      vty_out (vty, "%s    Interface: %s",
+               VTY_NEWLINE,
+               adj->circuit->interface->name); /* interface name */
+    else
+      vty_out (vty, "NULL circuit!%s", VTY_NEWLINE);
+    vty_out (vty, ", Level: %u", adj->level); /* level */
+    vty_out (vty, ", State: %s", adj_state2string (adj->adj_state));
+    now = time (NULL);
+    vty_out (vty, ", Expires in %s", 
+             time2string (adj->last_upd + adj->hold_time - now));
+    vty_out (vty, "%s    Adjacency flaps: %u",
+	     VTY_NEWLINE,
+	     adj->flaps);
+    vty_out (vty, ", Last: %s ago", time2string(now - adj->last_flap));
+    vty_out (vty, "%s    Circuit type: %s",
+	     VTY_NEWLINE,
+	     circuit_t2string(adj->circuit_t));
+    vty_out (vty, ", Speaks: %s", nlpid2string(&adj->nlpids));
+    vty_out (vty, "%s    SNPA: %s",
+	     VTY_NEWLINE,
+	     snpa_print (adj->snpa));   
+    dyn = dynhn_find_by_id (adj->lanid);
+    if (dyn)
+      vty_out (vty, ", LAN id: %s.%02x",
+	       dyn->name.name,
+	       adj->lanid[ISIS_SYS_ID_LEN]);
+    else 
+      vty_out (vty, ", LAN id: %s.%02x",
+	       sysid_print (adj->lanid),
+	       adj->lanid[ISIS_SYS_ID_LEN]);
+    
+    vty_out (vty, "%s    Priority: %u",
+	     VTY_NEWLINE,
+	     adj->prio[adj->level-1]);
+
+    vty_out (vty, ", %s, DIS flaps: %u, Last: %s ago%s",
+	     isis_disflag2string(adj->dis_record[ISIS_LEVELS+level-1].dis),
+	     adj->dischanges[level-1],
+	     time2string (now - 
+                   (adj->dis_record[ISIS_LEVELS + level - 1].last_dis_change)),
+	     VTY_NEWLINE);    
+             	
+    if (adj->ipv4_addrs && listcount (adj->ipv4_addrs) > 0) {
+      vty_out (vty, "    IPv4 Addresses:%s", VTY_NEWLINE);
+      for (node = listhead (adj->ipv4_addrs);node; nextnode (node)) {
+        ip_addr = getdata (node);
+        vty_out (vty, "      %s%s", inet_ntoa(*ip_addr), VTY_NEWLINE);
+      }
+    }
+#ifdef HAVE_IPV6  
+    if (adj->ipv6_addrs && listcount (adj->ipv6_addrs) > 0) {
+      vty_out (vty, "    IPv6 Addresses:%s", VTY_NEWLINE);
+      for (node = listhead (adj->ipv6_addrs); node; nextnode (node)) {
+        ipv6_addr = getdata (node);
+        inet_ntop (AF_INET6, ipv6_addr, ip6, INET6_ADDRSTRLEN); 
+        vty_out (vty, "      %s%s", ip6, VTY_NEWLINE);
+      }
+    }
+#endif /* HAVE_IPV6 */
+    vty_out (vty, "%s", VTY_NEWLINE);
+  }
+  return;
+}
+
+void
+isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty) {
+  isis_adj_print_vty2 (adj, vty, ISIS_UI_LEVEL_BRIEF);
+}
+
+void
+isis_adj_print_vty_detail (struct isis_adjacency *adj, struct vty *vty) {
+  isis_adj_print_vty2 (adj, vty, ISIS_UI_LEVEL_DETAIL);
+}
+
+void
+isis_adj_print_vty_extensive (struct isis_adjacency *adj, struct vty *vty) {
+  isis_adj_print_vty2 (adj, vty, ISIS_UI_LEVEL_EXTENSIVE);
+}
+
+void
+isis_adj_p2p_print_vty (struct isis_adjacency *adj, struct vty *vty)
+{
+  isis_adj_print_vty2 (adj, vty, ISIS_UI_LEVEL_BRIEF);
+}
+
+void 
+isis_adj_p2p_print_vty_detail (struct isis_adjacency *adj, struct vty *vty) 
+{
+  isis_adj_print_vty2 (adj, vty, ISIS_UI_LEVEL_DETAIL);
+}
+
+void 
+isis_adj_p2p_print_vty_extensive (struct isis_adjacency *adj, struct vty *vty)
+{
+  isis_adj_print_vty2 (adj, vty, ISIS_UI_LEVEL_EXTENSIVE);
+}
+
+void
+isis_adjdb_iterate (struct list *adjdb, void (*func)(struct isis_adjacency*, 
+                                                 void *), void *arg)
+{
+  struct listnode *node;
+  struct isis_adjacency *adj;
+  for (node = listhead (adjdb); node; nextnode (node)) {
+    adj = getdata (node);
+    (*func)(adj, arg);
+  }
+}
+
+void
+isis_adj_build_neigh_list (struct list *adjdb, struct list *list)
+
+{
+  struct isis_adjacency *adj;
+  struct listnode *node;
+  
+  
+  if (!list) {
+    zlog_warn ("isis_adj_build_neigh_list(): NULL list");
+    return;
+  }
+  
+  for (node = listhead (adjdb); node; nextnode (node)) {
+    adj = getdata (node);
+    if (!adj) {
+      zlog_warn ("isis_adj_build_neigh_list(): NULL adj");
+      return;
+    }
+  
+    if ((adj->adj_state == ISIS_ADJ_UP || 
+       adj->adj_state == ISIS_ADJ_INITIALIZING))
+      listnode_add (list, adj->snpa);
+  }
+  return;
+}
+
+void
+isis_adj_build_up_list (struct list *adjdb, struct list *list)
+{
+  struct isis_adjacency *adj;
+  struct listnode *node;
+
+  if (!list) {
+    zlog_warn ("isis_adj_build_up_list(): NULL list");
+    return;
+  }
+
+  for (node = listhead (adjdb); node; nextnode (node)) {
+    adj = getdata (node);
+    
+    if (!adj) {
+      zlog_warn ("isis_adj_build_up_list(): NULL adj");
+      return;
+    }
+
+    if (adj->adj_state == ISIS_ADJ_UP)
+      listnode_add (list, adj);
+  }
+  
+  return;
+}
+

+ 126 - 0
isisd/isis_adjacency.h

@@ -0,0 +1,126 @@
+/*
+ * IS-IS Rout(e)ing protocol - isis_adjacency.h   
+ *                             IS-IS adjacency handling
+ *
+ * Copyright (C) 2001,2002   Sampo Saaristo
+ *                           Tampere University of Technology      
+ *                           Institute of Communications Engineering
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it 
+ * under the terms of the GNU General Public Licenseas published by the Free 
+ * Software Foundation; either version 2 of the License, or (at your option) 
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT 
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+ * more details.
+
+ * You should have received a copy of the GNU General Public License along 
+ * with this program; if not, write to the Free Software Foundation, Inc., 
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef _ZEBRA_ISIS_ADJACENCY_H
+#define _ZEBRA_ISIS_ADJACENCY_H
+
+enum isis_adj_usage
+{
+  ISIS_ADJ_NONE,
+  ISIS_ADJ_LEVEL1,
+  ISIS_ADJ_LEVEL2,
+  ISIS_ADJ_LEVEL1AND2
+};
+
+enum isis_system_type 
+{
+  ISIS_SYSTYPE_UNKNOWN,
+  ISIS_SYSTYPE_ES,
+  ISIS_SYSTYPE_IS,
+  ISIS_SYSTYPE_L1_IS,
+  ISIS_SYSTYPE_L2_IS
+};
+
+enum isis_adj_state 
+{
+  ISIS_ADJ_INITIALIZING,
+  ISIS_ADJ_UP,
+  ISIS_ADJ_DOWN
+};
+
+/*
+ * we use the following codes to give an indication _why_
+ * a specific adjacency is up or down
+ */
+enum isis_adj_updown_reason
+{
+  ISIS_ADJ_REASON_SEENSELF,
+  ISIS_ADJ_REASON_AREA_MISMATCH,
+  ISIS_ADJ_REASON_HOLDTIMER_EXPIRED,
+  ISIS_ADJ_REASON_AUTH_FAILED,
+  ISIS_ADJ_REASON_CHECKSUM_FAILED
+};
+
+#define DIS_RECORDS 8 /* keep the last 8 DIS state changes on record */
+
+struct isis_dis_record {
+  int                              dis; /* is our neighbor the DIS ? */          time_t               last_dis_change; /* timestamp for last dis change */
+};
+
+struct isis_adjacency{
+  u_char snpa[ETH_ALEN];           /* NeighbourSNPAAddress */ 
+  u_char sysid[ISIS_SYS_ID_LEN];   /* neighbourSystemIdentifier */
+  u_char lanid[ISIS_SYS_ID_LEN+1]; /* LAN id on bcast circuits */
+  int dischanges[ISIS_LEVELS];     /* how many DIS changes ?*/ 
+  /* an array of N levels for M records */
+  struct isis_dis_record  dis_record[DIS_RECORDS * ISIS_LEVELS]; 
+  enum isis_adj_state adj_state;  /* adjacencyState */
+  enum isis_adj_usage adj_usage;  /* adjacencyUsage */
+  struct list *area_addrs;        /* areaAdressesOfNeighbour */
+  struct nlpids nlpids;           /* protocols spoken ... */
+  struct list *ipv4_addrs;
+#ifdef HAVE_IPV6
+  struct list *ipv6_addrs;
+#endif /* HAVE_IPV6 */
+  u_char prio[ISIS_LEVELS];        /* priorityOfNeighbour for DIS*/
+  int circuit_t;                   /* from hello PDU hdr */
+  int level;                       /* level (1 or 2) */
+  enum  isis_system_type sys_type; /* neighbourSystemType */
+  u_int16_t hold_time;             /* entryRemainingTime */
+  u_int32_t last_upd;
+  u_int32_t last_flap;             /* last time the adj flapped */
+  int flaps;                       /* number of adjacency flaps  */
+  struct thread *t_expire;         /* expire after hold_time  */
+  struct isis_circuit *circuit;    /* back pointer */     
+};
+
+
+struct isis_adjacency *isis_adj_lookup (u_char *sysid, struct list *adjdb);
+struct isis_adjacency *isis_adj_lookup_snpa (u_char *ssnpa, 
+					     struct list *adjdb);
+struct isis_adjacency *isis_new_adj (u_char *id, u_char *snpa, int level, 
+                                     struct isis_circuit *circuit); 
+void isis_delete_adj (struct isis_adjacency *adj, struct list *adjdb); 
+void isis_adj_state_change (struct isis_adjacency *adj, 
+                            enum isis_adj_state state, char *reason); 
+void isis_adj_print (struct isis_adjacency *adj); 
+int  isis_adj_expire (struct thread *thread);
+void isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty);
+void isis_adj_print_vty_detail (struct isis_adjacency *adj, struct vty *vty);
+void isis_adj_print_vty_extensive (struct isis_adjacency *adj, 
+                                   struct vty *vty);
+void isis_adj_p2p_print_vty (struct isis_adjacency *adj, struct vty *vty);
+void isis_adj_p2p_print_vty_detail (struct isis_adjacency *adj, 
+                                    struct vty *vty);
+void isis_adj_p2p_print_vty_extensive (struct isis_adjacency *adj, 
+                                       struct vty *vty);
+
+void isis_adj_build_neigh_list (struct list *adjdb, struct list *list);
+void isis_adj_build_up_list (struct list *adjdb, struct list *list);
+void isis_adjdb_iterate (struct list *adjdb, 
+                         void (*func)(struct isis_adjacency*, 
+                                      void *), void *arg);
+
+#endif /* ISIS_ADJACENCY_H */
+

File diff suppressed because it is too large
+ 2200 - 0
isisd/isis_circuit.c


+ 158 - 0
isisd/isis_circuit.h

@@ -0,0 +1,158 @@
+/*
+ * IS-IS Rout(e)ing protocol - isis_circuit.h
+ *
+ * Copyright (C) 2001,2002   Sampo Saaristo
+ *                           Tampere University of Technology      
+ *                           Institute of Communications Engineering
+ *
+ * This program is free software; you can redistribute it and/or modify it 
+ * under the terms of the GNU General Public Licenseas published by the Free 
+ * Software Foundation; either version 2 of the License, or (at your option) 
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT 
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+ * more details.
+
+ * You should have received a copy of the GNU General Public License along 
+ * with this program; if not, write to the Free Software Foundation, Inc., 
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef ISIS_CIRCUIT_H
+#define ISIS_CIRCUIT_H
+
+#define CIRCUIT_MAX 255
+
+struct password {
+  struct password *next;
+  int               len;
+  u_char          *pass;
+};
+
+struct metric {
+  u_char metric_default;
+  u_char metric_error;
+  u_char metric_expense;
+  u_char metric_delay;
+};
+
+struct isis_bcast_info {
+  u_char snpa [ETH_ALEN];                  /* SNPA of this circuit */
+  char run_dr_elect[2];                    /* Should we run dr election ? */
+  struct thread *t_run_dr[2];              /* DR election thread */
+  struct thread *t_send_lan_hello[2];      /* send LAN IIHs in this thread */
+  struct list *adjdb[2];                   /* adjacency dbs */
+  struct list *lan_neighs[2];              /* list of lx neigh snpa */
+  char is_dr[2];                           /* Are we level x DR ? */
+  u_char l1_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-1 DR */
+  u_char l2_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-2 DR */
+  struct thread *t_refresh_pseudo_lsp[2];  /* refresh pseudo-node LSPs */
+  int pad_hellos;                          /* add padding to Hello PDUs ? */
+  u_char priority[2];                      /* l1/2 IS Priority */
+};
+
+struct isis_p2p_info {
+  struct isis_adjacency    *neighbor;
+  struct thread *t_send_p2p_hello;         /* send P2P IIHs in this thread  */
+};
+
+struct isis_circuit {
+  int state;
+  u_char circuit_id;             /* l1/l2 p2p/bcast CircuitID */
+  struct isis_area *area;        /* back pointer to the area */
+  struct interface *interface;   /* interface info from z */
+  int fd;                        /* IS-IS l1/2 socket */
+  struct nlpids nlpids;    
+  /*
+   * Threads
+   */
+  struct thread *t_read;
+  struct thread *t_send_csnp[2];
+  struct thread *t_send_psnp[2];
+  struct list *lsp_queue;        /* LSPs to be txed (both levels) */
+  /* there is no real point in two streams, just for programming kicker */
+  int (* rx) (struct isis_circuit *circuit, u_char *ssnpa);
+  struct stream *rcv_stream;     /* Stream for receiving */
+  int (* tx) (struct isis_circuit *circuit, int level);
+  struct stream *snd_stream;     /* Stream for sending */
+  int idx;                       /* idx in S[RM|SN] flags */
+#define CIRCUIT_T_BROADCAST  0 
+#define CIRCUIT_T_P2P        1
+#define CIRCUIT_T_STATIC_IN  2
+#define CIRCUIT_T_STATIC_OUT 3
+#define CIRCUIT_T_DA         4
+  int        circ_type;          /* type of the physical interface */
+  union {
+    struct isis_bcast_info bc;
+    struct isis_p2p_info p2p;
+  } u;
+  char ext_domain;               /* externalDomain   (boolean) */
+  /* 
+   * Configurables 
+   */
+  struct isis_passwd passwd;      /* Circuit rx/tx password */
+  long lsp_interval;            
+  int manual_l2_only;             /* manualL2OnlyMode (boolean) */
+  int circuit_is_type;            /* circuit is type == level of circuit
+                                   * diffrenciated from circuit type (media) */
+  u_int32_t hello_interval[2];    /* l1HelloInterval in msecs */
+  u_int16_t hello_multiplier[2];  /* l1HelloMultiplier */
+  u_int16_t csnp_interval[2];     /* level-1 csnp-interval in seconds */
+  u_int16_t psnp_interval[2];     /* level-1 psnp-interval in seconds */
+  struct metric metrics[2];       /* l1XxxMetric */
+  struct password *c_rx_passwds;  /* circuitReceivePasswords */
+  struct password *c_tc_passwd;   /* circuitTransmitPassword */
+  int ip_router;                  /* Route IP ? */
+  struct list *ip_addrs;          /* our IP addresses */
+#ifdef HAVE_IPV6
+  int ipv6_router;                /* Route IPv6 ? */
+  struct list *ipv6_link;         /* our link local IPv6 addresses */
+  struct list *ipv6_non_link;     /* our non-link local IPv6 addresses */
+#endif /* HAVE_IPV6 */
+  /* 
+   * RFC 2973 IS-IS Mesh Groups 
+   */
+#define MESH_INACTIVE 0
+#define MESH_BLOCKED  1
+#define MESH_SET      2
+  int mesh_enabled;               /* meshGroupEnabled */
+  u_int16_t mesh_group;           /* meshGroup */
+  u_int16_t upadjcount[2];
+  /*
+   * Counters as in 10589--11.2.5.9
+   */
+  u_int32_t adj_state_changes;    /* changesInAdjacencyState */
+  u_int32_t init_failures;        /* intialisationFailures */
+  u_int32_t ctrl_pdus_rxed;       /* controlPDUsReceived */
+  u_int32_t ctrl_pdus_txed;       /* controlPDUsSent */
+  u_int32_t desig_changes[2];     /* lanLxDesignatedIntermediateSystemChanges*/
+  u_int32_t rej_adjacencies;      /* rejectedAdjacencies */
+};
+
+
+void                 isis_circuit_init        (void);
+struct isis_circuit *isis_circuit_new         (void);
+struct isis_circuit *circuit_lookup_by_ifp    (struct interface *ifp, 
+                                               struct list *list);
+struct isis_circuit *circuit_scan_by_ifp      (struct interface *ifp);
+void                 isis_circuit_del         (struct isis_circuit *circuit);
+void                 isis_circuit_configure   (struct isis_circuit *circuit, 
+                                               struct isis_area *area);
+void                 isis_circuit_up          (struct isis_circuit *circuit);
+void                 isis_circuit_deconfigure (struct isis_circuit *circuit, 
+                                               struct isis_area *area);
+
+int                  isis_circuit_destroy     (struct isis_circuit *circuit);
+void                 isis_circuit_if_add      (struct isis_circuit *circuit,
+                                               struct interface *ifp);
+void                 isis_circuit_if_del      (struct isis_circuit *circuit);
+void                 circuit_update_nlpids    (struct isis_circuit *circuit);
+void                 isis_circuit_update_params (struct isis_circuit *circuit,
+                                                 struct interface *ifp);
+void                 isis_circuit_add_addr (struct isis_circuit *circuit, 
+                                            struct connected *conn);
+void                 isis_circuit_del_addr (struct isis_circuit *circuit, 
+                                            struct connected *conn);
+#endif /* _ZEBRA_ISIS_CIRCUIT_H */

+ 65 - 0
isisd/isis_common.h

@@ -0,0 +1,65 @@
+/*
+ * IS-IS Rout(e)ing protocol - isis_common.h