Packets: Add MPLSPacket image
g0dil [Tue, 30 Jun 2009 08:34:18 +0000 (08:34 +0000)]
doclib: Fix pkgdraw list field parsing

git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1249 270642c3-0616-0410-b53a-bc976706d245

Packets/DefaultBundle/MPLSPacket.hh
Packets/SConscript
doclib/dot
doclib/pkgdraw

index 8ee0a1c..5413f3b 100644 (file)
@@ -39,6 +39,8 @@ namespace senf {
 
         Parser implementing an MPLS header.
 
+        \image html MPLSPacket.png
+
         \see MPLSPacketType
      */
     struct MPLSPacketParser : public PacketParserBase
index 5039f22..1732162 100644 (file)
@@ -56,6 +56,7 @@ SENFSCons.Doxygen(env, extra_sources = [
     env.PkgDraw("MPEGDVBBundle/MPESection.hh"),
     env.PkgDraw("MPEGDVBBundle/SNDUPacket.hh"),
     env.PkgDraw("MPEGDVBBundle/TransportPacket.hh"),
+    env.PkgDraw("DefaultBundle/MPLSPacket.hh"),
 ])
 SENFSCons.InstallIncludeFiles(env, includes)
 
index 4ec3c34..c6bdbe4 100755 (executable)
@@ -7,7 +7,7 @@ if head -4 "$1" | grep -q nomunge; then
 fi
 sed -i -e 's/rankdir=LR/rankdir=TB/' "$1"
 "$topdir/doclib/dot-munge.pl" "$1"
-unflatten -l3 -c3 -f -o "$1".unflat "$1"
+unflatten -l2 -c2 -f -o "$1".unflat "$1"
 mv "$1".unflat "$1"
 
 case "$2" in
index 4f80472..efff924 100755 (executable)
@@ -304,6 +304,7 @@ def parse_VECTOR(args, flags):
         sys.stderr.write("Failed to aprse VECTOR: %s\n" % args)
         return None
     field = dict(FIELD_TYPES.get(args[-1].split(':')[-1], {}))
+    print args,repr(field);
     field['name'] = args[0]
     field['repeat'] = True
     return field
@@ -400,15 +401,21 @@ def scanPackets(data):
         packetOrder.append(name)
         minsize = maxsize = 0
         for field in packets[name]:
-            if field.get('size', None) is not None:
-                maxsize += field['size']
-            elif field.get('minsize', None) is not None:
-                maxsize += field['maxsize']
+            if maxsize is not None:
+                if field.get('repeat', False):
+                    maxsize = None
+                elif field.get('size', None) is not None:
+                    maxsize += field['size']
+                elif field.get('minsize', None) is not None:
+                    maxsize += field['maxsize']
+                else:
+                    maxsize = None
             if not field.get('optional', False):
                 if field.get('size', None) is not None:
                     minsize += field['size']
                 elif field.get('minsize', None) is not None:
                     minsize += field['minsize']
+        print name,minsize,maxsize
         if minsize is not None and maxsize is not None:
             if minsize == maxsize:
                 FIELD_TYPES[name] = { 'size' : minsize }