Permalink
Browse files

Initial revision

  • Loading branch information...
0 parents commit e46528aae42aa8fd882cb38646fb198668f983c0 Ricardo Oliveira committed Sep 1, 2009
Showing with 23,026 additions and 0 deletions.
  1. +13 −0 COMPILE
  2. +26 −0 LICENSE
  3. +94 −0 Makefile.in
  4. +43 −0 README
  5. +6,792 −0 configure
  6. +100 −0 configure.in
  7. +103 −0 dumper/AttributeTypeASPathDumper.cpp
  8. +60 −0 dumper/AttributeTypeAggregatorDumper.cpp
  9. +54 −0 dumper/AttributeTypeAtomicAggregateDumper.cpp
  10. +92 −0 dumper/AttributeTypeCommunitiesDumper.cpp
  11. +136 −0 dumper/AttributeTypeDumper.cpp
  12. +52 −0 dumper/AttributeTypeLocalPrefDumper.cpp
  13. +100 −0 dumper/AttributeTypeMPReachNLRIDumper.cpp
  14. +82 −0 dumper/AttributeTypeMPUnreachNLRIDumper.cpp
  15. +52 −0 dumper/AttributeTypeMultiExitDiscDumper.cpp
  16. +68 −0 dumper/AttributeTypeNextHopDumper.cpp
  17. +65 −0 dumper/AttributeTypeOriginDumper.cpp
  18. +81 −0 dumper/BGPAttributeDumper.cpp
  19. +138 −0 dumper/BGPDumper.cpp
  20. +43 −0 dumper/BGPKeepAliveDumper.cpp
  21. +99 −0 dumper/BGPMessageDumper.cpp
  22. +43 −0 dumper/BGPNotificationDumper.cpp
  23. +43 −0 dumper/BGPOpenDumper.cpp
  24. +43 −0 dumper/BGPRouteRefreshDumper.cpp
  25. +103 −0 dumper/BGPStateChangeDumper.cpp
  26. +120 −0 dumper/BGPUpdateDumper.cpp
  27. +50 −0 dumper/Dumper.cpp
  28. +69 −0 dumper/MRTBgp4MPMessageDumper.cpp
  29. +69 −0 dumper/MRTBgp4MPStateChangeDumper.cpp
  30. +115 −0 dumper/MRTTblDumpV1Dumper.cpp
  31. +154 −0 dumper/MRTTblDumpV2Dumper.cpp
  32. +57 −0 dumper/Makefile.in
  33. +687 −0 dumper/cfile_tools.c
  34. +129 −0 dumper/config.h.in
  35. +347 −0 dumper/mrt2xml.cpp
  36. +864 −0 dumper/testdump.cpp
  37. +552 −0 dumper/xmlinternal.c
  38. +106 −0 include/AttributeType.h
  39. +112 −0 include/AttributeTypeAS4Path.h
  40. +106 −0 include/AttributeTypeASPath.h
  41. +61 −0 include/AttributeTypeAggregator.h
  42. +51 −0 include/AttributeTypeAtomicAggregate.h
  43. +72 −0 include/AttributeTypeCommunities.h
  44. +143 −0 include/AttributeTypeDumper.h
  45. +68 −0 include/AttributeTypeExtCommunities.h
  46. +54 −0 include/AttributeTypeLocalPref.h
  47. +84 −0 include/AttributeTypeMPReachNLRI.h
  48. +71 −0 include/AttributeTypeMPUnreachNLRI.h
  49. +57 −0 include/AttributeTypeMultiExitDisc.h
  50. +60 −0 include/AttributeTypeNextHop.h
  51. +65 −0 include/AttributeTypeOrigin.h
  52. +109 −0 include/BGPAttribute.h
  53. +55 −0 include/BGPAttributeDumper.h
  54. +225 −0 include/BGPCommonHeader.h
  55. +113 −0 include/BGPDumper.h
  56. +57 −0 include/BGPKeepAlive.h
  57. +91 −0 include/BGPMessageDumper.h
  58. +62 −0 include/BGPNotification.h
  59. +58 −0 include/BGPOpen.h
  60. +56 −0 include/BGPRouteRefresh.h
  61. +96 −0 include/BGPStateChangeDumper.h
  62. +193 −0 include/BGPStructure.h
  63. +75 −0 include/BGPUpdate.h
  64. +59 −0 include/Dumper.h
  65. +60 −0 include/Logger.h
  66. +61 −0 include/MRTBgp4MPEntry.h
  67. +71 −0 include/MRTBgp4MPMessage.h
  68. +63 −0 include/MRTBgp4MPMessageDumper.h
  69. +61 −0 include/MRTBgp4MPSnapshot.h
  70. +78 −0 include/MRTBgp4MPStateChange.h
  71. +63 −0 include/MRTBgp4MPStateChangeDumper.h
  72. +81 −0 include/MRTCommonHeader.h
  73. +442 −0 include/MRTStructure.h
  74. +88 −0 include/MRTTblDump.h
  75. +66 −0 include/MRTTblDumpV1Dumper.h
  76. +75 −0 include/MRTTblDumpV2Dumper.h
  77. +73 −0 include/MRTTblDumpV2PeerIndexTbl.h
  78. +56 −0 include/MRTTblDumpV2RibGeneric.h
  79. +101 −0 include/MRTTblDumpV2RibHeader.h
  80. +63 −0 include/MRTTblDumpV2RibIPv4Multicast.h
  81. +62 −0 include/MRTTblDumpV2RibIPv4Unicast.h
  82. +61 −0 include/MRTTblDumpV2RibIPv6Multicast.h
  83. +62 −0 include/MRTTblDumpV2RibIPv6Unicast.h
  84. +78 −0 include/TblDumpV2RibEntry.h
  85. +97 −0 include/cfile_tools.h
  86. +55 −0 include/xml.h
  87. +50 −0 include/xmldata.h
  88. +149 −0 include/xmlinternal.h
  89. +323 −0 install-sh
  90. +143 −0 parser/AttributeType.cpp
  91. +253 −0 parser/AttributeTypeAS4Path.cpp
  92. +340 −0 parser/AttributeTypeASPath.cpp
  93. +88 −0 parser/AttributeTypeAggregator.cpp
  94. +58 −0 parser/AttributeTypeAtomicAggregate.cpp
  95. +115 −0 parser/AttributeTypeCommunities.cpp
  96. +105 −0 parser/AttributeTypeExtCommunities.cpp
  97. +64 −0 parser/AttributeTypeLocalPref.cpp
  98. +214 −0 parser/AttributeTypeMPReachNLRI.cpp
  99. +137 −0 parser/AttributeTypeMPUnreachNLRI.cpp
  100. +64 −0 parser/AttributeTypeMultiExitDisc.cpp
  101. +84 −0 parser/AttributeTypeNextHop.cpp
  102. +80 −0 parser/AttributeTypeOrigin.cpp
  103. +90 −0 parser/BGPAttribute.cpp
  104. +105 −0 parser/BGPCommonHeader.cpp
  105. +48 −0 parser/BGPKeepAlive.cpp
  106. +181 −0 parser/BGPNotification.cpp
  107. +58 −0 parser/BGPOpen.cpp
  108. +52 −0 parser/BGPRouteRefresh.cpp
  109. +229 −0 parser/BGPUpdate.cpp
  110. +103 −0 parser/Logger.cpp
  111. +77 −0 parser/MRTBgp4MPEntry.cpp
  112. +178 −0 parser/MRTBgp4MPMessage.cpp
  113. +74 −0 parser/MRTBgp4MPSnapshot.cpp
  114. +157 −0 parser/MRTBgp4MPStateChange.cpp
  115. +197 −0 parser/MRTCommonHeader.cpp
  116. +185 −0 parser/MRTTblDump.cpp
  117. +179 −0 parser/MRTTblDumpV2PeerIndexTbl.cpp
  118. +95 −0 parser/MRTTblDumpV2RibGeneric.cpp
  119. +180 −0 parser/MRTTblDumpV2RibHeader.cpp
  120. +157 −0 parser/MRTTblDumpV2RibIPv4Multicast.cpp
  121. +160 −0 parser/MRTTblDumpV2RibIPv4Unicast.cpp
  122. +171 −0 parser/MRTTblDumpV2RibIPv6Multicast.cpp
  123. +172 −0 parser/MRTTblDumpV2RibIPv6Unicast.cpp
  124. +95 −0 parser/Makefile.in
  125. +99 −0 parser/TblDumpV2RibEntry.cpp
  126. +560 −0 parser/bgpparser.cpp
  127. +687 −0 parser/cfile_tools.c
  128. +106 −0 parser/config.h.in
  129. BIN sample/updates.20090501.0000.bz2
  130. +25 −0 test-scripts/README
  131. +70 −0 test-scripts/cmp.pl
  132. +16 −0 test-scripts/comp-rib.sh
  133. +37 −0 test-scripts/comp-up.sh
  134. +101 −0 test-scripts/cvRib2Bgpdump.pl
  135. +101 −0 test-scripts/cvUp2Bgpdump.pl
13 COMPILE
@@ -0,0 +1,13 @@
+The BGP parser needs the following libraries to compile:
+---------------------------------------------------------
+
++ libxml2
+download from http://xmlsoft.org/ or use a package management util to install libxml2-2.x
+
+Installation:
+---------------------------------------------------------
+./configure
+make
+sudo make install
+
+Please report bugs to rveloso@cs.ucla.edu
26 LICENSE
@@ -0,0 +1,26 @@
+Copyright (c) 2008,2009, University of California, Los Angeles All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+* 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.
+* Neither the name of NLnetLabs 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
+
@@ -0,0 +1,94 @@
+ #
+ # Copyright (c) 2008,2009, University of California, Los Angeles All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are met:
+ #
+ # * Redistributions of source code must retain the above copyright notice,
+ # this list of conditions and the following disclaimer.
+ # * 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.
+ # * Neither the name of NLnetLabs 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
+ #
+
+PROG = bgpparser
+
+CC = @CC@
+CXX = @CXX@
+DEFINES = @DEFS@
+CFLAGS = @CFLAGS@ @CPPFLAGS@ $(DEFINES)
+CXXFLAGS = @CXXFLAGS@
+LDFLAGS = @LDFLAGS@ @LIBS@
+
+CFLAGS += -Wall -Werror -D_REENTRANT
+CFLAGS += -DDEBUG -g
+
+CXXFLAGS += $(CFLAGS)
+
+RM = rm -f
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+RANLIB = @RANLIB@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_MODE= -m 0755
+DOC_MODE= -m 0644
+
+libtool = @libtool@
+LIBTOOL = $(libtool) --tag=CXX
+
+# Include some boilerplate Gnu makefile definitions.
+prefix = @prefix@
+
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+libdir = @libdir@
+infodir = @infodir@
+includedir = @includedir@
+datarootdir = @datarootdir@
+datadir = @datadir@
+docdir = $(datadir)/doc/bgp-parser
+localedir = $(datadir)/locale
+
+mandir = $(prefix)/man
+manpfx = man
+
+man1ext = .1
+man1dir = $(mandir)/$(manpfx)1
+man5ext = .5
+man5dir = $(mandir)/$(manpfx)5
+man8ext = .8
+man8dir = $(mandir)/$(manpfx)8
+
+htmldir = @htmldir@
+
+all:
+ -( mkdir -p bin )
+ $(MAKE) -C parser
+ $(MAKE) -C dumper
+ -(cp dumper/mrt2xml bin/$(PROG))
+
+$(PROG): $(OBJS)
+ $(CXX) $(CXXFLAGS) -o $@ $(OBJS) $(LDFLAGS)
+
+clean:
+ $(MAKE) clean -C parser
+ $(MAKE) clean -C dumper
+
+install: all
43 README
@@ -0,0 +1,43 @@
+BGP Parser Library Readme
+==========================
+BGP Praser is an extensible MRT BGP message parser implemented in C++.
+
+-----------------------------------
+Library Use
+-----------------------------------
+The purpose of this library is to parser MRT messages.
+
+Currently three types of messages are supported.
+12 - Table dump
+13 - Table dump v2
+16 - BGP4MP
+(the MRT format is at http://tools.ietf.org/html/draft-ietf-grow-mrt-09)
+Details of supported subtypes which are handled can be viewed in the
+inc/MRTStructure.h file.
+
+The MRTCommonHeader.h file contains the structure for the outermost layer of
+a MRT message. The static interface function, newMessage, is used to parse
+through the given message, and generate the appropriate message structure. Each
+structure then contains the appropriate getter functions to retrieve any
+specific information that is desired. For instance, initially, one would use
+getType() on the MRTMessage returned from calling newMessage in order to
+determine the type of the incoming message.
+
+For handling just BGP Message data, the BGPCommonHeader.h defines a similar
+newMessage function that can be used in a similar fashion. The appropriate
+getters for each field are defined in all derived classes, which retrieve any
+data which is initially parsed from creating the structure.
+
+-----------------------------------
+Example Application
+-----------------------------------
+Note that the purpose of this library is merely to parser each *individual* MRT
+message efficently and correctly. For a given MRT file, users are required to
+extract each MRT message before using the library.
+
+For demo purpose, an example program 'mrt2xml' is also included, which takes a
+BGP MRT file as an input, uses the library to parses it, and outputs the parsed
+data in xml format.
+The explanation of the xml format could be obtained at
+http://bgpmon.netsec.colostate.edu/publications/draft-ietf-bgp-xml.txt
+
Oops, something went wrong.

0 comments on commit e46528a

Please sign in to comment.