From: g0dil Date: Tue, 22 Jan 2008 23:34:25 +0000 (+0000) Subject: doclib: Clean up documentation generation X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=77191ea0291fb6c2ad0a472c83258722bf221f8f;p=senf.git doclib: Clean up documentation generation Examples: Autogenerate Mainpage.dox HowTos/NewPacket: Start new howto git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@633 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Doxyfile b/Doxyfile index 9a9633c..2aee5f4 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,8 +1,9 @@ @INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global" +INPUT = . doclib + PROJECT_NAME = Overview PROJECT_NUMBER = "(Version $(REVISION))" -HTML_HEADER = doclib/doxy-header-overview.html GENERATE_XML = NO GENERATE_TAGFILE = doc/overview.tag @@ -10,5 +11,6 @@ TAGFILES = \ "$(TOPDIR)/PPI/doc/PPI.tag" \ "$(TOPDIR)/Scheduler/doc/Scheduler.tag" \ "$(TOPDIR)/Packets/doc/Packets.tag" \ + "$(TOPDIR)/Packets/DefaultBundle/doc/DefaultBundle.tag" \ "$(TOPDIR)/Socket/doc/Socket.tag" \ "$(TOPDIR)/Utils/doc/Utils.tag" diff --git a/Examples/Mainpage.dox b/Examples/Mainpage.dox deleted file mode 100644 index b1272b8..0000000 --- a/Examples/Mainpage.dox +++ /dev/null @@ -1,50 +0,0 @@ -// $Id$ -// -// Copyright (C) 2007 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY -// Stefan Bund -// -// 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., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -/** \mainpage Examples - - \htmlonly -
- -
Sniffer
Simple packet sniffer - reading packets from a packet socket and dumping packet parse to stdout
- -
RateStuffer
Example application - showing of the PPI infrastructure
- -
UDPClientServer
Example for an - UDP Client Server application
- -
- \endhtmlonly -*/ - - -// Local Variables: -// mode: c++ -// fill-column: 100 -// c-file-style: "senf" -// indent-tabs-mode: nil -// ispell-local-dictionary: "american" -// mode: flyspell -// mode: auto-fill -// End: diff --git a/Examples/RateStuffer/Mainpage.dox b/Examples/RateStuffer/Mainpage.dox index ea7bb05..c17c9b4 100644 --- a/Examples/RateStuffer/Mainpage.dox +++ b/Examples/RateStuffer/Mainpage.dox @@ -20,7 +20,7 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/** \mainpage RateStuffer: A simple example featuring the Packet Processing Infrastructure +/** \mainpage Example introducing the Packet Processing Infrastructure This example application implements a simple PPI application: It will read UDP packets from an input port and will forward them to another port at a fixed packet rate. If the input stream diff --git a/Examples/SConscript b/Examples/SConscript index cdb256a..d36619f 100644 --- a/Examples/SConscript +++ b/Examples/SConscript @@ -5,6 +5,32 @@ import SENFSCons ########################################################################### +import yaptu + +HOWTOS = [] +for dox in sorted(glob.glob("*/Mainpage.dox")): + title = ([None] + [ line.split('\\mainpage',1)[-1].strip() for line in file(dox) + if '\\mainpage' in line ])[-1] + if title: + HOWTOS.append( (dox.split('/',1)[0], title) ) + +MAINPAGE=""" +/** \mainpage Examples + + \htmlonly +
+ +{{ for name, title in HOWTOS: +
${name}
${title}
+}} + +
+ \endhtmlonly + */ +""" + +file("Mainpage.dox","w").write(yaptu.process(MAINPAGE, globals(), env.Dictionary())) + SConscript(glob.glob("*/SConscript")) -SENFSCons.Doxygen(env) \ No newline at end of file +SENFSCons.Doxygen(env) diff --git a/Examples/Sniffer/Mainpage.dox b/Examples/Sniffer/Mainpage.dox index a9e2d90..e867432 100644 --- a/Examples/Sniffer/Mainpage.dox +++ b/Examples/Sniffer/Mainpage.dox @@ -20,7 +20,7 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/** \mainpage Sniffer: A simple example application +/** \mainpage Simple packet sniffer reading and dumping raw network packets \dontinclude Sniffer.cc diff --git a/HowTos/Doxyfile b/HowTos/Doxyfile new file mode 100644 index 0000000..991df8a --- /dev/null +++ b/HowTos/Doxyfile @@ -0,0 +1,3 @@ +@INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global" + +PROJECT_NAME = "HowTo's" diff --git a/HowTos/NewPacket/Doxyfile b/HowTos/NewPacket/Doxyfile new file mode 100644 index 0000000..c23a0db --- /dev/null +++ b/HowTos/NewPacket/Doxyfile @@ -0,0 +1,12 @@ +@INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global" + +PROJECT_NAME = "HowTo: Defining and using a new libPackets packet type" +EXAMPLE_PATH = . + +TAGFILES = \ + "$(TOPDIR)/PPI/doc/PPI.tag" \ + "$(TOPDIR)/Scheduler/doc/Scheduler.tag" \ + "$(TOPDIR)/Packets/doc/Packets.tag" \ + "$(TOPDIR)/Packets/DefaultBundle/doc/DefaultBundle.tag" \ + "$(TOPDIR)/Socket/doc/Socket.tag" \ + "$(TOPDIR)/Utils/doc/Utils.tag" diff --git a/HowTos/NewPacket/Mainpage.dox b/HowTos/NewPacket/Mainpage.dox new file mode 100644 index 0000000..482c84e --- /dev/null +++ b/HowTos/NewPacket/Mainpage.dox @@ -0,0 +1,255 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// 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., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \mainpage libPackets: How to define and use a new Packet Type + + This howto will introduce the facilities needed to define a new packet type. As example, the + \c GREPacket type is defined. + + \section howto_newpacket_start Getting started + + Before starting with the implementation, we look at the specification of the GRE packet. This is + found in RFC 2784 in Section 2.1: + +
+     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+    |C|       Reserved0       | Ver |         Protocol Type         |
+    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+    |      Checksum (optional)      |       Reserved1 (Optional)    |
+    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+    
+ + Using this protocol definition, we can decide the first important question: Whether the packet + header is fixed size or dynamically sized. As we see above, the header incorporates optional + fields. Therefore it must be dynamically sized. The RFC further details, that if the \a Checksum + \a Present bit \a C is set, both \a Checksum and \a Reserved1 are present, otherwise they must + both be omitted. + + Another information we take from the RFC is, that the \a Protocol \a Type is used to define the + type of payload which directly follows the GRE header. This value is the ETHERTYPE value. To allow the packet + library to automatically parse the GRE payload data, we need to tell the packet library which + ETHERTYPE represents which packet type. This association already exists in form of the + senf::EtherTypes registry. Our GRE packet will therefore utilize this registry. + + To summarize, we have gathered the following information: + + \li The GRE packet header is a dynamically sized header. + \li The GRE packet header utilizes the senf::EtherTypes registry for next-header selection + + \section howto_newpacket_impl Implementing the GRE Parser + + The next step in creating a new packet type is to implement the parser. The parser is + responsible for turning a bunch of bytes into an interpreted header with specific fields. The + parser will later be constructed with an iterator (pointer) to the first byte to be interpreted + as a GRE header and will provide member functions to access the header fields. You can implement + these members manually but the SENF library provides a large set of helper macros which simplify + this task considerably. + + \code + struct GREParser : public senf::PacketParser + { + # include SENF_PARSER() + + // Define fields + + SENF_PARSER_FINALIZE(GREParser); + }; + \endcode + + This is the standard skeleton of any parser class: We need to inherit senf::PacketParser and + start out by including either \ref SENF_PARSER() or \ref SENF_FIXED_PARSER(). Which, depends on + whether we define a fixed size or a dynamically sized parser. As \c GREParser is dynamically + sized, we include \ref SENF_PARSER(). + + After the fields are defined, we need to call the \ref SENF_PARSER_FINALIZE() macro to close of + the parser definition. This call takes the name of the parser being defined as it's sole + argument. + + This is already a valid parser, albeit not a very usable one since it defines no fields. We now + go back to define the parser fields and begin with the simple part: Those fields which are + always present. + + \code + SENF_PARSER_BITFIELD ( checksumPresent, 1, bool ); + SENF_PARSER_SKIP_BITS ( 12 ); + SENF_PARSER_BITFIELD ( version, 3, unsigned ); + SENF_PARSER_BITFIELD ( protocolType, 16, unsigned ); + \endcode + + This is a direct transcript of the field definition above. However, we can optimize this a + little bit: Since the \a protocolType field is aligned on a byte boundary, instead of defining + it as a bitfield, we can define it as a UInt16 field: + + \code + SENF_PARSER_BITFIELD ( checksumPresent, 1, bool ); + SENF_PARSER_SKIP_BITS ( 12 ); + SENF_PARSER_BITFIELD ( version, 3, unsigned ); + + SENF_PARSER_FIELD ( protocolType, senf::UInt16Parser ); + \endcode + + There are quite a number of such \c SENF_PARSER_ macros. They are all listed in \ref + packetparsermacros. The basic field types (like senf::UInt16Parser) are listed in \ref parseint. + + What happens in the above macros? Most of the macros define an accessor for a specific field: \a + checksumPresent() or \a protocolType(). They also manage a current Offset. This value + is advanced according to the field size whenever a new field is defined (and since this parser + is defined as a dynamically sized parser, this offset is not a constant, it is an expression + which calculates the offset of a field depending on the preceding data). + + It is important to understand, that the accessors do \e not return the parsed field value. They + return another \e parser which is used to further interpret the value. This is the inherent + recursive nature of the SENF packet parsers. This allows to define wildly complex header formats + if needed. Of course, at some point we need the real value. This is, what the so called + value parsers do: They interpret some bytes or bits and return the value of that field + (not a parser). Examples are the bitfield parsers returnd by the accessors generated by + SENF_PARSER_BITFIELD (like senf::UIntFieldParser) or the senf::UInt16Parser. + + We now come to the optional fields. Since there are two fields which need to be disabled/enabled + together, we first need to define an additional sub-parser which parses those two fields. After + this parser is defined, we can use \ref SENF_PARSER_VARIANT() to add this parser as an optional + parser to the GRE header. + + \code + struct GREParser_OptFields : public senf::PacketParser + { + # include SENF_FIXED_PARSER() + + SENF_PARSER_FIELD ( checksum, senf::UInt16Parser ); + SENF_PARSER_SKIP ( 2 ); + + SENF_PARSER_FINALIZE(GREParser_OptFields); + }; + \endcode + + This parser only parses the two optional fields of which the reserved field is just skipped. The + parser this time is a fixed size parser. We can now use this parser to continue the \c GREParser + implementation: + + \code + SENF_PARSER_BITFIELD ( checksumPresent, 1, bool ); + SENF_PARSER_SKIP_BITS ( 12 ); + SENF_PARSER_BITFIELD ( version, 3, unsigned ); + + SENF_PARSER_FIELD ( protocolType, senf::UInt16Parser ); + + SENF_PARSER_VARIANT ( optionalFields, checksumPresent, + (senf::VoidPacketParser) + (GREParser_OptFields) ); + \endcode + + How does this work? For a variant parser, two things need to be specified: A selector and a list + of variant parsers. The selector is another parser field which is used to decide, which variant + to choose. In this simple case, the field must be an unsigned integer (more precisely a value + parser which returns a value which is implicitly convertible to \c unsigned). This value is used + as index into the list of variant types. So in our case, 0 is associated with + senf::VoidPacketParser whereas 1 is associated with \c GREParser_OptFields. + + This parser will work, it is however not very safe and not very usable. If \a p is a GREParser + instance, than we access the fields via: + \code + p.checksumPresent() + p.version() + p.protocolType() + p.optionalFields().get<1>().checksum() + \endcode + + There are two problems here: + \li accessing the checksum field is not straight forward + \li changing the checksumPresent() value will break the parser + + The reason for the second problem lies in the fact, that the variant parser needs to be informed + whenever the selector (here \a checksumPresent) is changed since the variant parser must ensure, + that the header data stays consistent. In this example, whenever the checksumPresent field is + enabled, the variant parser needs to insert additional 4 bytes of data and remove those bytes, + when the checksumPresent field is disabled. We therefore make the checksumPresent field + read-only: + + \code + SENF_PARSER_BITFIELD_RO ( checksumPresent, 1, bool ); + \endcode + + To change the checksumPresent value, we now need to use the variant parsers \a init member: + + \code + p.optionalFields().init<0>(); + p.optionalFields().init<1>(); + \endcode + + The first statements switches to the first variant and therefore in this case disables the + checksum field. The second statement will switch to the second variant and enable the checksum + field. This again is not very usable. So we complete the parser by providing simple additional + members which access the fields in a more readable way. While doing this, we also mark the + variant as a private field so it is not directly accessible any more. Here the final \c + GREParser + + \code + struct GREParser_OptFields : public senf::PacketParser + { + # include SENF_FIXED_PARSER() + + SENF_PARSER_FIELD ( checksum, senf::UInt16Parser ); + SENF_PARSER_SKIP ( 2 ); + + SENF_PARSER_FINALIZE(GREParser_OptFields); + }; + + struct GREParser : public senf::PacketParser + { + # include SENF_PARSER() + + SENF_PARSER_BITFIELD_RO ( checksumPresent, 1, bool ); + SENF_PARSER_SKIP_BITS ( 12 ); + SENF_PARSER_BITFIELD ( version, 3, unsigned ); + + SENF_PARSER_FIELD ( protocolType, senf::UInt16Parser ); + + SENF_PARSER_PRIVATE_VARIANT ( optionalFields_, checksumPresent, + (senf::VoidPacketParser) + (GREParser_OptFields) ); + + typedef GREParser_OptFields::checksum_t checksum_t; + checksum_t checksum() const + { return optionalFields_().get<1>().checksum(); } + + void enableChecksum() const { optionalFields_().init<1>(); } + void disableChecksum() const { optionalFields_().init<0>(); } + + SENF_PARSER_FINALIZE(GREParser); + }; + \endcode + */ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u doc" +// mode: flyspell +// mode: auto-fill +// End: diff --git a/HowTos/NewPacket/SConscript b/HowTos/NewPacket/SConscript new file mode 100644 index 0000000..d4cc4aa --- /dev/null +++ b/HowTos/NewPacket/SConscript @@ -0,0 +1,6 @@ +Import('env') +import SENFSCons + +########################################################################### + +SENFSCons.Doxygen(env) diff --git a/HowTos/SConscript b/HowTos/SConscript new file mode 100644 index 0000000..d17ac8b --- /dev/null +++ b/HowTos/SConscript @@ -0,0 +1,36 @@ +# -*- python -*- + +Import('env') +import SENFSCons, glob + +########################################################################### + +import yaptu + +HOWTOS = [] +for dox in sorted(glob.glob("*/Mainpage.dox")): + title = ([None] + [ line.split('\\mainpage',1)[-1].strip() for line in file(dox) + if '\\mainpage' in line ])[-1] + if title: + HOWTOS.append( (dox.split('/',1)[0], title) ) + +MAINPAGE=""" +/** \mainpage HowTo's + + \htmlonly +
+ +{{ for name, title in HOWTOS: +
${name}
${title}
+}} + +
+ \endhtmlonly + */ +""" + +file("Mainpage.dox","w").write(yaptu.process(MAINPAGE, globals(), env.Dictionary())) + +SConscript(glob.glob("*/SConscript")) + +SENFSCons.Doxygen(env) diff --git a/Packets/ParseHelpers.hh b/Packets/ParseHelpers.hh index 40403ab..85ab056 100644 --- a/Packets/ParseHelpers.hh +++ b/Packets/ParseHelpers.hh @@ -671,9 +671,9 @@ This macro will return the current fixed offset, a compile-time constant expression. This is always possible when defining a fixed size parser. - Even in dynamically sized parsers this macro will work, up tp now only fixed size fields have - been defined. This macro does \e not validate this condition, it will return an arbitrary - incorrect value otherwise. + Even in dynamically sized parsers this macro will work, if all parser defined \e before the + current position are fixed-size parsers. This macro does \e not validate this condition, it will + return an arbitrary incorrect value otherwise. \pre Current position preceded by fixed-size parsers only \returns compile-time constant offset from parsers start diff --git a/SConstruct b/SConstruct index c02b7cc..cc4dc67 100644 --- a/SConstruct +++ b/SConstruct @@ -227,9 +227,9 @@ PhonyTarget(env, 'debbin', [ PhonyTarget(env, 'linklint', [ 'rm -rf linklint', 'linklint -doc linklint -limit 99999999 `find -type d -name html -printf "/%P/@ "`', - '[ ! -r linklint/errorX.html ] || python linklint_addnames.py linklint/errorX.html.new', + '[ ! -r linklint/errorX.html ] || python doclib/linklint_addnames.py linklint/errorX.html.new', '[ ! -r linklint/errorX.html.new ] || mv linklint/errorX.html.new linklint/errorX.html', - '[ ! -r linklint/errorAX.html ] || python linklint_addnames.py linklint/errorAX.html.new', + '[ ! -r linklint/errorAX.html ] || python doclib/linklint_addnames.py linklint/errorAX.html.new', '[ ! -r linklint/errorAX.html.new ] || mv linklint/errorAX.html.new linklint/errorAX.html', 'echo -e "\\nLokal link check results: linklint/index.html\\nRemote link check results: linklint/urlindex.html\\n"', ]) diff --git a/Socket/SocketProtocol.hh b/Socket/SocketProtocol.hh index fa8d0ff..7c34b3a 100644 --- a/Socket/SocketProtocol.hh +++ b/Socket/SocketProtocol.hh @@ -162,8 +162,8 @@ namespace senf { appropriate type. */ virtual unsigned available() const = 0; - ///< Return number of bytes available for reading without - ///< blocking + ///< Return (maximum) number of bytes available for reading + ///< without < blocking /**< This member will check in a (very, sigh) protocol dependent way, how many bytes may be read from a socket in a single (non-blocking) read operation. If the @@ -176,9 +176,9 @@ namespace senf { returns ethernet frames, returning 1500 from available() is ok). However, this should only be done as a last resort. Also beware, that this number should - not be to large since the socket layer will always need - to allocate that number of bytes for the data to be - read. */ + not be too large since the socket layer will always + need to allocate that number of bytes for the data to + be read. */ virtual bool eof() const = 0; ///< Check for end-of-file condition /**< This is another check which (like available()) is diff --git a/_templates/Example.dox b/_templates/Example.dox index f168059..9e45153 100644 --- a/_templates/Example.dox +++ b/_templates/Example.dox @@ -33,7 +33,7 @@ // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" -// compile-command: "scons -u test" +// compile-command: "scons -u doc" // mode: flyspell // mode: auto-fill // End: diff --git a/_templates/Example.test.cc b/_templates/Example.test.cc index ac3d410..1544b69 100644 --- a/_templates/Example.test.cc +++ b/_templates/Example.test.cc @@ -3,7 +3,7 @@ // Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY -// Stefan Bund +// @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 @@ -21,13 +21,13 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief Example.test unit tests */ + \brief @NAME@ unit tests */ -//#include "Example.test.hh" -//#include "Example.test.ih" +//#include "@NAME@.test.hh" +//#include "@NAME@.test.ih" // Custom includes -#include "Example.hh" +#include "@NAME@.hh" #include #include diff --git a/_templates/add.sh b/_templates/add.sh index 4aae1bf..af6b2d8 100755 --- a/_templates/add.sh +++ b/_templates/add.sh @@ -39,11 +39,11 @@ fi name="`basename "$1"`" case "$name" in - *.*) type="${name#*.}"; name="${name%.$type}" ;; + *.*) type=".${name#*.}"; name="${name%.$type}" ;; *) type="" ;; esac -if [ ! -r "$base/Example.$type" ] ; then +if [ ! -r "$base/Example$type" ] ; then echo "Don't know about file type '$type'" exit 1 fi @@ -56,7 +56,7 @@ if [ -z "$force" -a -r "$1" ] ; then fi sed -e "s/@NAME@/$name/g" -e "s/@AUTHOR@/${SENF_AUTHOR:-@AUTHOR@}/g" \ - < "$base/Example.$type" \ + < "$base/Example$type" \ > "$1" svn add "$1" diff --git a/doclib/Doxyfile.global b/doclib/Doxyfile.global index 8b6455f..3184f92 100644 --- a/doclib/Doxyfile.global +++ b/doclib/Doxyfile.global @@ -30,6 +30,8 @@ EXPAND_ONLY_PREDEF = YES PREDEFINED = \ DOXYGEN \ "SENF_PPI_MODULE(x)=" \ + "SENF_PARSER()=" \ + "SENF_FIXED_PARSER()=" \ "SENF_PARSER_INHERIT(name)=" \ "SENF_PARSER_FIELD(name,type)=type name() const" \ "SENF_PARSER_FIELD_RO(name,type)=type::value_type name() const" \ diff --git a/doclib/SConscript b/doclib/SConscript index 7844638..926b576 100644 --- a/doclib/SConscript +++ b/doclib/SConscript @@ -77,6 +77,7 @@ writeTemplate = env.Action(writeTemplate, varlist = [ 'TEMPLATE' ]) EXTRA_MODULES = [ ('Overview', '#/doc/html'), ('Examples', '#/Examples/doc/html'), + ('HowTo\'s', '#/HowTos/doc/html'), ('SENFSCons', '#/senfscons/doc/html') ] HEADER = """ @@ -127,8 +128,6 @@ div.tabs ul li.$projectname a { background-color: #EDE497; } """ -OVERVIEW_EXTRA_HEADER="" - FOOTER = """
@@ -157,9 +156,6 @@ function paths() { env.Command('doxy-header.html', 'SConscript', writeTemplate, TEMPLATE = Literal(HEADER), TITLE = "Documentation and API reference") -env.Command('doxy-header-overview.html', 'SConscript', writeTemplate, - TEMPLATE = Literal(HEADER+OVERVIEW_EXTRA_HEADER), - TITLE = "Introduction and Overview") env.Command('doxy-footer.html', 'SConscript', writeTemplate, TEMPLATE = Literal(FOOTER)) env.Alias('all_docs', @@ -173,7 +169,6 @@ env.Alias('all_docs', + "> ${TARGETS[0]}.tmp", 'mv ${TARGET}.tmp ${TARGET}' ], TEMPLATE = Literal(HEADER - + OVERVIEW_EXTRA_HEADER + SEARCH_PHP.replace('',']]') + FOOTER), TITLE = "Search results")) diff --git a/linklint_addnames.py b/doclib/linklint_addnames.py similarity index 100% rename from linklint_addnames.py rename to doclib/linklint_addnames.py diff --git a/senf.dict b/senf.dict index 9787634..181aec0 100644 --- a/senf.dict +++ b/senf.dict @@ -18,6 +18,7 @@ alloc arg args async +Augustin autoThrottling aVectorCollection BaseParser @@ -76,6 +77,7 @@ EthernetPacket EthernetPacketType EthernetParser ethertype +EtherTypes EthVLan EUI EUID @@ -105,6 +107,8 @@ ForwardingRoute fraunhofer FroblizerArea GlobalScope +GRE +GREPacket hangup HangupException hh @@ -112,12 +116,14 @@ hideinitializer Hmm hostname hostnames +howto href htm html http IANA IdleEvent +ietf ih impl INet @@ -142,6 +148,7 @@ iterator join key li +libPackets LinkScope ListB ListN @@ -163,6 +170,7 @@ namespace nc netcat NETwork +newpacket NextPacket nextPacketKey nextPacketRange @@ -248,7 +256,7 @@ registerPacketType registerSomePacket RegistrationProxy rerference -RFC +rfc RO RP SafePacketParser @@ -316,6 +324,7 @@ unthrottled unthrottles unthrottling VectorN +Ver vlanId VLanId VoidPacketParser diff --git a/senfscons/Doxygen.py b/senfscons/Doxygen.py index 3508be5..bff85de 100644 --- a/senfscons/Doxygen.py +++ b/senfscons/Doxygen.py @@ -234,7 +234,7 @@ class DoxyfileParser: for d in [ self._dir ] + self._include_path: p = os.path.join(d,value[0]) if os.path.exists(p): - self._items.setdefault('@INCLDUE',[]).append(p) + self._items.setdefault('@INCLUDE',[]).append(p) parser = DoxyfileParser(p, self._env, self._include_path, self._items) parser.parse() return @@ -305,10 +305,8 @@ def DoxySourceScan(node, env, path): for root, dirs, files in entries: for f in files: filename = os.path.normpath(os.path.join(root, f)) - if ( reduce(lambda x, y: x or fnmatch(f, y), - file_patterns, False) - and not reduce(lambda x, y: x or fnmatch(f, y), - exclude_patterns, False) ): + if ( reduce(lambda x, y: x or fnmatch(f, y), file_patterns, False) + and not reduce(lambda x, y: x or fnmatch(f, y), exclude_patterns, False) ): sources.append(filename) for key in dep_add_keys: diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index 61f07ea..b6e1c0e 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -478,7 +478,7 @@ def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []): for type in env.get("DOXY_XREF_TYPES",[ "bug", "todo" ]): xref = os.path.join(xmlnode.dir.abspath,type+".xml") xref_pp = env.Command(xref+'i', [ xref, os.path.join(basedir,'xrefxtract.xslt'), xmlnode ], - [ "test -s $SOURCE && xsltproc -o $TARGET" + + [ "test -s $SOURCE && xsltproc --nonet -o $TARGET" + " --stringparam module $MODULE" + " --stringparam type $TYPE" + " ${SOURCES[1]} $SOURCE || touch $TARGET" ], diff --git a/unchecked-includes.sh b/unchecked-includes.sh deleted file mode 100755 index 7b63382..0000000 --- a/unchecked-includes.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -cd "`dirname "$0"`" - -trap 'rm -f installed_includes source_includes' 0 1 2 15 - -scons -n install_all PREFIX="non-existing-target" \ - | awk -F \" '/^Install file:/ && $2~/\.(h|hh|ih|ct|cti|cci|mpp)$/ {print $2}' \ - | sort > installed_includes - -./find-sources.sh -c ! -name "*.cc" ! -path "./debian/*" ! -name "*.test.*" -printf "%P\n" \ - | sort > source_includes - -comm -13 installed_includes source_includes -