Add tvbuff class.
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 11 May 2000 08:18:09 +0000 (08:18 +0000)
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 11 May 2000 08:18:09 +0000 (08:18 +0000)
Add exceptions routines.
Convert proto_tree_add_*() routines to require tvbuff_t* argument.
Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as
the tvbuff_t* argument to proto_tree_add_*() routines.

dissect_packet() creates a tvbuff_t, wraps the next dissect call in
a TRY block, will print "Short Frame" on the proto_tree if a BoundsError
exception is caught.

The FDDI dissector is converted to use tvbuff's.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1939 f5534014-38df-0310-8fa8-9805f1628bb7

132 files changed:
Makefile.am
Makefile.nmake
except.c [new file with mode: 0644]
except.h [new file with mode: 0644]
exceptions.h [new file with mode: 0644]
packet-aarp.c
packet-afs.c
packet-arp.c
packet-ascend.c
packet-atalk.c
packet-atm.c
packet-auto_rp.c
packet-bgp.c
packet-bootp.c
packet-bootparams.c
packet-bpdu.c
packet-cdp.c
packet-cgmp.c
packet-clip.c
packet-clnp.c
packet-data.c
packet-ddtp.c
packet-dns.c
packet-esis.c
packet-eth.c
packet-ethertype.c
packet-fddi.c
packet-fddi.h
packet-ftp.c
packet-giop.c
packet-gre.c
packet-h1.c
packet-hsrp.c
packet-http.c
packet-icmpv6.c
packet-icp.c
packet-icq.c
packet-imap.c
packet-ip.c
packet-ipp.c
packet-ipsec.c
packet-ipv6.c
packet-ipx.c
packet-irc.c
packet-isakmp.c
packet-isis-clv.c
packet-isis-hello.c
packet-isis-lsp.c
packet-isis-snp.c
packet-isis.c
packet-isl.c
packet-l2tp.c
packet-lapb.c
packet-lapd.c
packet-ldap.c
packet-llc.c
packet-lpd.c
packet-mapi.c
packet-mount.c
packet-mpls.c
packet-msproxy.c
packet-nbipx.c
packet-nbns.c
packet-ncp.c
packet-netbios.c
packet-nfs.c
packet-nntp.c
packet-ntp.c
packet-null.c
packet-osi-options.c
packet-ospf.c
packet-pim.c
packet-pop.c
packet-portmap.c
packet-ppp.c
packet-pppoe.c
packet-pptp.c
packet-q2931.c
packet-q931.c
packet-radius.c
packet-raw.c
packet-rip.c
packet-ripng.c
packet-rlogin.c
packet-rpc.c
packet-rsvp.c
packet-rtcp.c
packet-rtp.c
packet-rtsp.c
packet-rx.c
packet-sap.c
packet-sdp.c
packet-smb-browse.c
packet-smb-common.c
packet-smb-common.h
packet-smb-logon.c
packet-smb-mailslot.c
packet-smb-pipe.c
packet-smb.c
packet-sna.c
packet-snmp.c
packet-socks.c
packet-srvloc.c
packet-sscop.c
packet-tacacs.c
packet-tcp.c
packet-telnet.c
packet-tftp.c
packet-time.c
packet-tns.c
packet-tr.c
packet-trmac.c
packet-udp.c
packet-v120.c
packet-vines.c
packet-vlan.c
packet-vrrp.c
packet-vtp.c
packet-wccp.c
packet-who.c
packet-x25.c
packet-yhoo.c
packet-ypserv.c
packet.c
packet.h
plugins/gryphon/packet-gryphon.c
proto.c
proto.h
tvbtest.c [new file with mode: 0644]
tvbuff.c [new file with mode: 0644]
tvbuff.h [new file with mode: 0644]
xdlc.c

index 3783bdae6f676fa13d360e715e4436afd7e74662..e8006b25223d1d6ae93b86ef71e9168a5c24543b 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile.am
 # Automake file for Ethereal
 #
-# $Id: Makefile.am,v 1.194 2000/05/11 07:34:31 guy Exp $
+# $Id: Makefile.am,v 1.195 2000/05/11 08:14:47 gram Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Gerald Combs <gerald@zing.org>
@@ -248,6 +248,9 @@ ETHEREAL_COMMON_SOURCES = \
        dfilter.c      \
        dfilter.h      \
        etypes.h       \
+       except.c        \
+       except.h        \
+       exceptions.h    \
        follow.c       \
        follow.h       \
        inet_v6defs.h  \
@@ -276,6 +279,8 @@ ETHEREAL_COMMON_SOURCES = \
        resolv.h       \
        smb.h          \
        timestamp.h    \
+       tvbuff.c        \
+       tvbuff.h        \
        util.c         \
        util.h         \
        xdlc.c         \
@@ -438,6 +443,8 @@ randpkt.o: randpkt.c
 randpkt: randpkt.o wiretap/libwiretap.a
        $(LINK) -o randpkt randpkt.o wiretap/libwiretap.a `glib-config --libs` -lz
 
+tvbtest: tvbtest.o tvbuff.o except.o
+
 DISTCLEANFILES =       \
        register.c      \
        rdps            \
index 17b999063d9c1bb2ee0724adbce08670b1ae394b..9c9bd606cb2f07b40a5978aa418b4fa9e9af5377 100644 (file)
@@ -1,7 +1,7 @@
 ## Makefile for building ethereal.exe with Microsoft C and nmake
 ## Use: nmake -f makefile.nmake
 #
-# $Id: Makefile.nmake,v 1.36 2000/05/11 07:34:32 guy Exp $
+# $Id: Makefile.nmake,v 1.37 2000/05/11 08:14:48 gram Exp $
 
 include config.nmake
 
@@ -148,6 +148,7 @@ ETHEREAL_COMMON_OBJECTS = \
        dfilter-grammar.obj \
        dfilter-scanner.obj \
        dfilter.obj      \
+       except.obj       \
        follow.obj       \
        getopt.obj       \
        ipproto.obj      \
@@ -160,6 +161,7 @@ ETHEREAL_COMMON_OBJECTS = \
        ps.obj           \
        register.obj     \
        resolv.obj       \
+       tvbuff.obj       \
        util.obj         \
        xdlc.obj         \
 
diff --git a/except.c b/except.c
new file mode 100644 (file)
index 0000000..14440aa
--- /dev/null
+++ b/except.c
@@ -0,0 +1,415 @@
+/*
+ * Portable Exception Handling for ANSI C.
+ * Copyright (C) 1999 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: except.c,v 1.1 2000/05/11 08:14:49 gram Exp $
+ * $Name:  $
+ */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <limits.h>
+#include "except.h"
+
+#define XCEPT_BUFFER_SIZE      1024
+
+#ifdef KAZLIB_RCSID
+static const char rcsid[] = "$Id: except.c,v 1.1 2000/05/11 08:14:49 gram Exp $";
+#endif
+
+#define group except_group
+#define code except_code
+#define id except_id
+#define message except_message
+#define dyndata except_dyndata
+#define func except_func
+#define context except_context
+#define id except_id
+#define size except_size
+#define obj except_obj
+#define jmp except_jmp
+#define down except_down
+#define type except_type
+#define catcher except_catcher
+#define cleanup except_cleanup
+#define info except_info
+
+#ifdef KAZLIB_POSIX_THREADS
+
+#include <pthread.h>
+
+static pthread_mutex_t init_mtx = PTHREAD_MUTEX_INITIALIZER;
+static int init_counter;
+static pthread_key_t top_key;
+static pthread_key_t uh_key;
+static pthread_key_t alloc_key;
+static pthread_key_t dealloc_key;
+static void unhandled_catcher(except_t *);
+
+#define get_top() ((struct except_stacknode *) pthread_getspecific(top_key))
+#define set_top(T) (pthread_setspecific(top_key, (T)), (void)((T) == (struct except_stacknode *) 0))
+#define set_catcher(C) (pthread_setspecific(uh_key, (void *) (C)), (void)((C) == (void (*)(except_t *)) 0))
+#define set_alloc(A) (pthread_setspecific(alloc_key, (void *) (A)), (void)((A) == (void *(*)(size_t)) 0))
+#define set_dealloc(D) (pthread_setspecific(dealloc_key, (void *) (D)), (void)((D) == (void (*)(void *)) 0))
+
+static void (*get_catcher(void))(except_t *)
+{
+    void (*catcher)(except_t *) = (void (*)(except_t *)) pthread_getspecific(uh_key);
+    return (catcher == 0) ? unhandled_catcher : catcher;
+}
+
+static void *(*get_alloc(void))(size_t)
+{
+    void *(*alloc)(size_t) = (void *(*)(size_t)) pthread_getspecific(alloc_key);
+    return (alloc == 0) ? malloc : alloc;
+}
+
+static void (*get_dealloc(void))(void *)
+{
+    void (*dealloc)(void *) = (void (*)(void *)) pthread_getspecific(dealloc_key);
+    return (dealloc == 0) ? free : dealloc;
+}
+
+int except_init(void)
+{
+    int retval = 1;
+
+    pthread_mutex_lock(&init_mtx);
+
+    assert (init_counter < INT_MAX);
+
+    if (init_counter++ == 0) {
+       int top_ok = (pthread_key_create(&top_key, 0) == 0);
+       int uh_ok = (pthread_key_create(&uh_key, 0) == 0);
+       int alloc_ok = (pthread_key_create(&alloc_key, 0) == 0);
+       int dealloc_ok = (pthread_key_create(&dealloc_key, 0) == 0);
+       
+       if (!top_ok || !uh_ok || !alloc_ok || !dealloc_ok) {
+           retval = 0;
+           init_counter = 0;
+           if (top_ok)
+               pthread_key_delete(top_key);
+           if (uh_ok)
+               pthread_key_delete(uh_key);
+           if (alloc_ok)
+               pthread_key_delete(alloc_key);
+           if (dealloc_ok)
+               pthread_key_delete(dealloc_key);
+       }
+    }
+
+    pthread_mutex_unlock(&init_mtx);
+
+    return retval;
+}
+
+void except_deinit(void)
+{
+    pthread_mutex_lock(&init_mtx);
+
+    assert (init_counter > 0);
+
+    if (--init_counter == 0) {
+       pthread_key_delete(top_key);
+       pthread_key_delete(uh_key);
+       pthread_key_delete(alloc_key);
+       pthread_key_delete(dealloc_key);
+    }
+
+    pthread_mutex_unlock(&init_mtx);
+}
+
+#else  /* no thread support */
+
+static int init_counter;
+static void unhandled_catcher(except_t *);
+static void (*uh_catcher_ptr)(except_t *) = unhandled_catcher;
+static void *(*allocator)(size_t) = malloc;
+static void (*deallocator)(void *) = free;
+static struct except_stacknode *stack_top;
+
+#define get_top() (stack_top)
+#define set_top(T) (stack_top = (T))
+#define get_catcher() (uh_catcher_ptr)
+#define set_catcher(C) (uh_catcher_ptr = (C))
+#define get_alloc() (allocator)
+#define set_alloc(A) (allocator = (A))
+#define get_dealloc() (deallocator)
+#define set_dealloc(D) (deallocator = (D))
+
+int except_init(void)
+{
+    assert (init_counter < INT_MAX);
+    init_counter++;
+    return 1;
+}
+
+void except_deinit(void)
+{
+    assert (init_counter > 0);
+    init_counter--;
+}
+
+#endif
+
+
+static int match(const except_id_t *thrown, const except_id_t *caught)
+{
+    int group_match = (caught->group == XCEPT_GROUP_ANY || caught->group == thrown->group);
+    int code_match = (caught->code == XCEPT_CODE_ANY || caught->code == thrown->code);
+
+    return group_match && code_match;
+}
+
+static void do_throw(except_t *except)
+{
+    struct except_stacknode *top;
+
+    assert (except->id.group != 0 && except->id.code != 0);
+
+    for (top = get_top(); top != 0; top = top->down) {
+       if (top->type == XCEPT_CLEANUP) {
+           top->info.cleanup->func(top->info.cleanup->context);
+       } else {
+           struct except_catch *catcher = top->info.catcher;
+           const except_id_t *pi = catcher->id;
+           size_t i;
+       
+           assert (top->type == XCEPT_CATCHER);
+           except_free(catcher->obj.dyndata);
+
+           for (i = 0; i < catcher->size; pi++, i++) {
+               if (match(&except->id, pi)) {
+                   catcher->obj = *except;
+                   set_top(top);
+                   longjmp(catcher->jmp, 1);
+               }
+           }
+       }
+    }
+
+    set_top(top);
+    get_catcher()(except);     /* unhandled exception */
+    abort();
+}
+
+static void unhandled_catcher(except_t *except)
+{
+    fprintf(stderr, "Unhandled exception (\"%s\", group=%ld, code=%ld)\n",
+           except->message, except->id.group, except->id.code);
+    abort();
+}
+
+static void stack_push(struct except_stacknode *node)
+{
+    node->down = get_top();
+    set_top(node);
+}
+
+void except_setup_clean(struct except_stacknode *esn,
+       struct except_cleanup *ecl, void (*cleanf)(void *), void *context)
+{
+    esn->type = XCEPT_CLEANUP;
+    ecl->func = cleanf;
+    ecl->context = context;
+    esn->info.cleanup = ecl;
+    stack_push(esn);
+}
+
+void except_setup_try(struct except_stacknode *esn,
+       struct except_catch *ech, const except_id_t id[], size_t size)
+{
+   ech->id = id;
+   ech->size = size;
+   ech->obj.dyndata = 0;
+   esn->type = XCEPT_CATCHER;
+   esn->info.catcher = ech;
+   stack_push(esn);
+}
+
+struct except_stacknode *except_pop(void)
+{
+    struct except_stacknode *top = get_top();
+    set_top(top->down);
+    return top;
+}
+
+void except_rethrow(except_t *except)
+{
+    struct except_stacknode *top = get_top();
+    assert (top != 0);
+    assert (top->type == XCEPT_CATCHER);
+    assert (&top->info.catcher->obj == except);
+    set_top(top->down);
+    do_throw(except);
+}
+
+void except_throw(long group, long code, const char *msg)
+{
+    except_t except;
+
+    except.id.group = group;
+    except.id.code = code;
+    except.message = msg;
+    except.dyndata = 0;
+
+    do_throw(&except);
+}
+
+void except_throwd(long group, long code, const char *msg, void *data)
+{
+    except_t except;
+
+    except.id.group = group;
+    except.id.code = code;
+    except.message = msg;
+    except.dyndata = data;
+
+    do_throw(&except);
+}
+
+void except_throwf(long group, long code, const char *fmt, ...)
+{
+    char *buf = except_alloc(XCEPT_BUFFER_SIZE);
+    va_list vl;
+
+    va_start (vl, fmt);
+    vsprintf(buf, fmt, vl);
+    va_end (vl);
+    except_throwd(group, code, buf, buf);
+}
+
+void (*except_unhandled_catcher(void (*new_catcher)(except_t *)))(except_t *)
+{
+    void (*old_catcher)(except_t *) = get_catcher();
+    set_catcher(new_catcher);
+    return old_catcher;
+}
+
+#undef except_code
+#undef except_group
+#undef except_message
+#undef except_data
+
+unsigned long except_code(except_t *ex)
+{
+    return ex->id.code;
+}
+
+unsigned long except_group(except_t *ex)
+{
+    return ex->id.group;
+}
+
+const char *except_message(except_t *ex)
+{
+    return ex->message;
+}
+
+void *except_data(except_t *ex)
+{
+    return ex->dyndata;
+}
+
+void *except_take_data(except_t *ex)
+{
+    void *data = ex->dyndata;
+    ex->dyndata = 0;
+    return data;
+}
+
+void except_set_allocator(void *(*alloc)(size_t), void (*dealloc)(void *))
+{
+    set_alloc(alloc);
+    set_dealloc(dealloc);
+}
+
+void *except_alloc(size_t size)
+{
+    void *ptr = get_alloc()(size);
+
+    if (ptr == 0)
+       except_throw(XCEPT_BAD_ALLOC, 0, "out of memory");
+    return ptr;
+}
+
+void except_free(void *ptr)
+{
+    get_dealloc()(ptr);
+}
+
+#ifdef KAZLIB_TEST_MAIN
+
+#include <stdio.h>
+#include <ctype.h>
+
+static void cleanup(void *arg)
+{
+    printf("cleanup(\"%s\") called\n", (char *) arg);
+}
+
+static void bottom_level(void)
+{
+    char buf[256];
+    printf("throw exception? "); fflush(stdout);
+    fgets(buf, sizeof buf, stdin);
+
+    if (toupper(buf[0]) == 'Y')
+       except_throw(1, 1, "nasty exception");
+}
+
+static void top_level(void)
+{
+    except_cleanup_push(cleanup, "argument");
+    bottom_level();
+    except_cleanup_pop(0);
+}
+
+int main(int argc, char **argv)
+{
+    static const except_id_t catch[] = { { 1, 1 }, { 1, 2 } };
+    except_t *ex;
+
+    /*
+     * Nested exception ``try blocks''
+     */
+
+    /* outer */
+    except_try_push(catch, 2, &ex);
+    if (!ex) {
+       /* inner */
+       except_try_push(catch, 2, &ex);
+       if (!ex) {
+           top_level();
+       } else {
+           /* inner catch */
+           printf("caught exception (inner): \"%s\", s=%ld, c=%ld\n",
+                   except_message(ex), except_group(ex), except_code(ex));
+           except_rethrow(ex);
+       }
+       except_try_pop();
+    } else {
+       /* outer catch */
+       printf("caught exception (outer): \"%s\", s=%ld, c=%ld\n",
+               except_message(ex), except_group(ex), except_code(ex));
+    }
+    except_try_pop();
+    except_throw(99, 99, "exception in main");
+    return 0;
+}
+
+
+#endif
diff --git a/except.h b/except.h
new file mode 100644 (file)
index 0000000..f551c9d
--- /dev/null
+++ b/except.h
@@ -0,0 +1,149 @@
+/*
+ * Portable Exception Handling for ANSI C.
+ * Copyright (C) 1999 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: except.h,v 1.1 2000/05/11 08:14:49 gram Exp $
+ * $Name:  $
+ */
+
+#ifndef XCEPT_H
+#define XCEPT_H
+
+#include <setjmp.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#define XCEPT_GROUP_ANY        0
+#define XCEPT_CODE_ANY 0
+#define XCEPT_BAD_ALLOC 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum { except_no_call, except_call };
+
+typedef struct {
+    unsigned long except_group;
+    unsigned long except_code;
+} except_id_t;
+
+typedef struct {
+    except_id_t except_id;
+    const char *except_message;
+    void *except_dyndata;
+} except_t;
+
+struct except_cleanup {
+    void (*except_func)(void *);
+    void *except_context;
+};
+
+struct except_catch {
+    const except_id_t *except_id;
+    size_t except_size;
+    except_t except_obj;
+    jmp_buf except_jmp;
+};
+
+enum except_stacktype {
+    XCEPT_CLEANUP, XCEPT_CATCHER
+};
+
+struct except_stacknode {
+    struct except_stacknode *except_down;
+    enum except_stacktype except_type;
+    union {
+       struct except_catch *except_catcher;    
+       struct except_cleanup *except_cleanup;
+    } except_info;
+};
+
+/* private functions made external so they can be used in macros */
+void except_setup_clean(struct except_stacknode *,
+       struct except_cleanup *, void (*)(void *), void *);
+void except_setup_try(struct except_stacknode *,
+       struct except_catch *, const except_id_t [], size_t);
+struct except_stacknode *except_pop(void);
+
+/* public interface functions */
+int except_init(void);
+void except_deinit(void);
+void except_rethrow(except_t *);
+void except_throw(long, long, const char *);
+void except_throwd(long, long, const char *, void *);
+void except_throwf(long, long, const char *, ...);
+void (*except_unhandled_catcher(void (*)(except_t *)))(except_t *);
+unsigned long except_code(except_t *);
+unsigned long except_group(except_t *);
+const char *except_message(except_t *);
+void *except_data(except_t *);
+void *except_take_data(except_t *);
+void except_set_allocator(void *(*)(size_t), void (*)(void *));
+void *except_alloc(size_t);
+void except_free(void *);
+
+#define except_code(E) ((E)->except_id.except_code)
+#define except_group(E) ((E)->except_id.except_group)
+#define except_message(E) ((E)->except_message)
+#define except_data(E) ((E)->except_dyndata)
+
+#ifdef __cplusplus
+}
+#endif
+
+/*
+ * void except_cleanup_push(void (*)(void *), void *); 
+ * void except_cleanup_pop(int);
+ * void except_checked_cleanup_pop(void (*)(void *), int);
+ * void except_try_push(const except_id_t [], size_t, except_t **);
+ * void except_try_pop(void);
+ */
+
+#define except_cleanup_push(F, C)                              \
+    {                                                          \
+       struct except_stacknode except_sn;                      \
+       struct except_cleanup except_cl;                        \
+       except_setup_clean(&except_sn, &except_cl, F, C)
+
+#define except_cleanup_pop(E)                                  \
+       except_pop();                                           \
+       if (E)                                                  \
+           except_cl.except_func(except_cl.except_context);    \
+    }
+
+#define except_checked_cleanup_pop(F, E)                       \
+       except_pop();                                           \
+       assert (except_cl.except_func == (F));                  \
+       if (E)                                                  \
+           except_cl.except_func(except_cl.except_context);    \
+    }
+       
+#define except_try_push(ID, NUM, PPE)                          \
+     {                                                         \
+       struct except_stacknode except_sn;                      \
+       struct except_catch except_ch;                          \
+       except_setup_try(&except_sn, &except_ch, ID, NUM);      \
+       if (setjmp(except_ch.except_jmp))                       \
+           *(PPE) = &except_ch.except_obj;                     \
+       else                                                    \
+           *(PPE) = 0
+
+#define except_try_pop()                                       \
+       except_free(except_ch.except_obj.except_dyndata);       \
+       except_pop();                                           \
+    } 
+
+#endif
diff --git a/exceptions.h b/exceptions.h
new file mode 100644 (file)
index 0000000..07de983
--- /dev/null
@@ -0,0 +1,131 @@
+#ifndef __EXCEPTIONS_H__
+#define __EXCEPTIONS_H__
+
+#ifndef XCEPT_H
+#include "except.h"
+#endif
+
+/* Ethereal has only one exception group, to make these macros simple */
+#define XCEPT_GROUP_ETHEREAL 1
+
+/* Ethereal's exceptions */
+#define BoundsError            1       /* Index is out of range */
+
+/* Usage:
+ *
+ * TRY {
+ *     code;
+ * }
+ *
+ * CATCH(exception) {
+ *     code;
+ * }
+ *
+ * CATCH_ALL {
+ *     code;
+ * }
+ *
+ * FINALLY {
+ *     code;
+ * }
+ *
+ * ENDTRY;
+ *
+ * ********* Never use 'goto' or 'return' inside the TRY, CATCH, CATCH_ALL,
+ * ********* or FINALLY blocks. Execution must proceed through ENDTRY before
+ * ********* branching out.
+ *
+ * This is really something like:
+ *
+ * {
+ *     x = setjmp()
+ *     if (x == 0) {
+ *             <TRY code>
+ *     }
+ *     else if (x == 1) {
+ *             <CATCH(1) code>
+ *     }
+ *     else if (x == 2) {
+ *             <CATCH(2) code>
+ *     }
+ *     else {
+ *             <CATCH_ALL code> {
+ *     }
+ *     <FINALLY code>
+ * }<ENDTRY tag>
+ *
+ * All CATCH's must precede a CATCH_ALL.
+ * FINALLY must occur after any CATCH or CATCH_ALL.
+ * ENDTRY marks the end of the TRY code.
+ * TRY and ENDTRY are the mandatory parts of a TRY block.
+ * CATCH, CATCH_ALL, and FINALLY are all optional (although
+ * you'll probably use at least one, otherwise why "TRY"?)
+ *
+ * GET_MESSAGE returns string ptr to exception message
+ *             when exception is thrown via THROW_MESSAGE()
+ *
+ * To throw/raise an exception.
+ *
+ * THROW(exception)
+ * RETHROW                             rethrow the caught exception
+ *
+ * A cleanup callback is a function called in case an exception occurs
+ * and is not caught. It should be used to free any dynamically-allocated data.
+ * A pop or call_and_pop should occur at the same statement-nesting level
+ * as the push.
+ *
+ * CLEANUP_CB_PUSH(func, data)
+ * CLEANUP_CB_POP
+ * CLEANUP_CB_CALL_AND_POP
+ */
+
+
+
+#define TRY \
+{\
+       except_t *exc; \
+       int caught = 0; \
+       static const except_id_t catch_spec[] = { \
+               { XCEPT_GROUP_ETHEREAL, XCEPT_CODE_ANY } }; \
+       except_try_push(catch_spec, 1, &exc); \
+       if (exc == 0) { \
+               /* user's code goes here */
+
+#define ENDTRY \
+       } \
+       except_try_pop();\
+}
+
+#define CATCH(x) \
+       } \
+       else if (exc->except_id.except_code == (x)) { \
+               caught = 1;
+               /* user's code goes here */
+
+
+#define CATCH_ALL \
+       } \
+       else { \
+               caught = 1;
+               /* user's code goes here */
+
+#define FINALLY \
+       } \
+       { \
+               /* user's code goes here */
+
+#define THROW(x) \
+       except_throw(XCEPT_GROUP_ETHEREAL, (x), "XCEPT_GROUP_ETHEREAL")
+
+#define THROW_MESSAGE(x, y) \
+       except_throw(XCEPT_GROUP_ETHEREAL, (x), (y))
+
+#define GET_MESSAGE                    except_message(exc)
+
+#define RETHROW                                except_rethrow(exc)
+
+#define CLEANUP_CB_PUSH(x,y)           except_cleanup_push((x),(y)
+#define CLEANUP_CB_POP                 except_cleanup_push(0)
+#define CLEANUP_CB_CALL_AND_POP                except_cleanup_push(1)
+
+#endif /* __EXCEPTIONS_H__ */
index 8190707d421a063691a2d7ccefd379ce21375fab..0f4dab66a887466305028e9affa450d8e8ec84c0 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-aarp.c
  * Routines for Appletalk ARP packet disassembly
  *
- * $Id: packet-aarp.c,v 1.18 2000/04/13 18:18:43 gram Exp $
+ * $Id: packet-aarp.c,v 1.19 2000/05/11 08:14:49 gram Exp $
  *
  * Simon Wilkinson <sxw@dcs.ed.ac.uk>
  *
@@ -191,35 +191,35 @@ dissect_aarp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
 
   if (tree) {
     if ((op_str = match_strval(ar_op, op_vals)))
-      ti = proto_tree_add_protocol_format(tree, proto_aarp, offset,
+      ti = proto_tree_add_protocol_format(tree, proto_aarp, NullTVB, offset,
                                      MIN_AARP_HEADER_SIZE + 2*ar_hln + 
                                      2*ar_pln, "AppleTalk Address Resolution Protocol (%s)", op_str);
     else
-      ti = proto_tree_add_protocol_format(tree, proto_aarp, offset,
+      ti = proto_tree_add_protocol_format(tree, proto_aarp, NullTVB, offset,
                                      MIN_AARP_HEADER_SIZE + 2*ar_hln + 
                                      2*ar_pln,
                                      "AppleTalk Address Resolution Protocol (opcode 0x%04x)", ar_op);
     aarp_tree = proto_item_add_subtree(ti, ett_aarp);
-    proto_tree_add_item(aarp_tree, hf_aarp_hard_type, offset + AR_HRD, 2,
+    proto_tree_add_item(aarp_tree, hf_aarp_hard_type, NullTVB, offset + AR_HRD, 2,
                               ar_hrd);
-    proto_tree_add_item(aarp_tree, hf_aarp_proto_type, offset + AR_PRO, 2, 
+    proto_tree_add_item(aarp_tree, hf_aarp_proto_type, NullTVB, offset + AR_PRO, 2, 
                               ar_pro);
-    proto_tree_add_item(aarp_tree, hf_aarp_hard_size, offset + AR_HLN, 1,
+    proto_tree_add_item(aarp_tree, hf_aarp_hard_size, NullTVB, offset + AR_HLN, 1,
                               ar_hln);
-    proto_tree_add_item(aarp_tree, hf_aarp_proto_size, offset + AR_PLN, 1,
+    proto_tree_add_item(aarp_tree, hf_aarp_proto_size, NullTVB, offset + AR_PLN, 1,
                               ar_pln);
-    proto_tree_add_item(aarp_tree, hf_aarp_opcode, offset + AR_OP, 2,
+    proto_tree_add_item(aarp_tree, hf_aarp_opcode, NullTVB, offset + AR_OP, 2,
                               ar_op);
-    proto_tree_add_bytes_format(aarp_tree, hf_aarp_src_ether, sha_offset, ar_hln,
+    proto_tree_add_bytes_format(aarp_tree, hf_aarp_src_ether, NullTVB, sha_offset, ar_hln,
                               &pd[sha_offset],
                               "Sender hardware address: %s", sha_str);
-    proto_tree_add_bytes_format(aarp_tree, hf_aarp_src_id, spa_offset, ar_pln,
+    proto_tree_add_bytes_format(aarp_tree, hf_aarp_src_id, NullTVB, spa_offset, ar_pln,
                               &pd[spa_offset],
                               "Sender ID: %s", spa_str);
-    proto_tree_add_bytes_format(aarp_tree, hf_aarp_dst_ether, tha_offset, ar_hln,
+    proto_tree_add_bytes_format(aarp_tree, hf_aarp_dst_ether, NullTVB, tha_offset, ar_hln,
                               &pd[tha_offset],
                               "Target hardware address: %s", tha_str);
-    proto_tree_add_bytes_format(aarp_tree, hf_aarp_dst_id, tpa_offset, ar_pln,
+    proto_tree_add_bytes_format(aarp_tree, hf_aarp_dst_id, NullTVB, tpa_offset, ar_pln,
                               &pd[tpa_offset],
                               "Target ID: %s", tpa_str);
   }
index 120002e529274305b4b1fad92b8e991b27647c80..0fe12a4e5a5b96353931cc347e6076bf06f5e4fc 100644 (file)
@@ -6,7 +6,7 @@
  * Portions based on information retrieved from the RX definitions
  *   in Arla, the free AFS client at http://www.stacken.kth.se/project/arla/
  *
- * $Id: packet-afs.c,v 1.9 2000/01/15 04:17:36 guy Exp $
+ * $Id: packet-afs.c,v 1.10 2000/05/11 08:14:49 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -886,13 +886,13 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
        }
 
        if (tree) {
-               ti = proto_tree_add_item(tree, proto_afs, doffset, END_OF_FRAME);
+               ti = proto_tree_add_item(tree, proto_afs, NullTVB, doffset, END_OF_FRAME);
                afs_tree = proto_item_add_subtree(ti, ett_afs);
 
                if ( !BYTES_ARE_IN_FRAME(offset, sizeof(struct rx_header) +
                        sizeof(struct afs_header)) )
                {
-                       proto_tree_add_text(afs_tree, doffset, END_OF_FRAME,
+                       proto_tree_add_text(afs_tree, NullTVB, doffset, END_OF_FRAME,
                                "Service: %s %s (Truncated)",
                                val_to_str(port, port_types, "Unknown(%d)"),
                                reply ? "Reply" : "Request");
@@ -900,7 +900,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                }
                else
                {
-                       proto_tree_add_text(afs_tree, doffset, END_OF_FRAME,
+                       proto_tree_add_text(afs_tree, NullTVB, doffset, END_OF_FRAME,
                                "Service: %s %s",
                                val_to_str(port, port_types, "Unknown(%d)"),
                                reply ? "Reply" : "Request");
@@ -911,17 +911,17 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                if ( !reply && node != 0 )
                {
                        ti = proto_tree_add_item(afs_tree,
-                               node, doffset, 4, opcode);
+                               node, NullTVB, doffset, 4, opcode);
                }
                else if ( reply && node != 0 )
                {
                        /* the opcode isn't in this packet */
                        ti = proto_tree_add_item(afs_tree,
-                               node, doffset, 0, opcode);
+                               node, NullTVB, doffset, 0, opcode);
                }
                else
                {
-                       ti = proto_tree_add_text(afs_tree,
+                       ti = proto_tree_add_text(afs_tree, NullTVB,
                                doffset, 0, "Operation: Unknown");
                }
 
@@ -931,7 +931,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                if ( typenode != 0 )
                {
                        /* indicate the type of request */
-                       proto_tree_add_item_hidden(afs_tree, typenode, doffset, 0, 1);
+                       proto_tree_add_item_hidden(afs_tree, typenode, NullTVB, doffset, 0, 1);
                }
 
                /* Process the packet according to what service it is */
@@ -965,21 +965,21 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
    after adding a 'Truncated' message to tree */
 #define TRUNC(bytes) \
        if(!BYTES_ARE_IN_FRAME(curoffset,(bytes))) \
-       { proto_tree_add_text(tree,curoffset,END_OF_FRAME,"Truncated"); \
+       { proto_tree_add_text(tree, NullTVB,curoffset,END_OF_FRAME,"Truncated"); \
        return; }
 
 /* Output a unsigned integer, stored into field 'field'
    Assumes it is in network byte order, converts to host before using */
 #define UINTOUT(field) \
        TRUNC(sizeof(guint32)) \
-       proto_tree_add_item(tree,field,curoffset,sizeof(guint32), GETINT()); \
+       proto_tree_add_item(tree,field, NullTVB,curoffset,sizeof(guint32), GETINT()); \
        curoffset += 4;
 
 /* Output a unsigned integer, stored into field 'field'
    Assumes it is in network byte order, converts to host before using */
 #define IPOUT(field) \
        TRUNC(sizeof(gint32)) \
-       proto_tree_add_item(tree,field,curoffset,sizeof(gint32),\
+       proto_tree_add_item(tree,field, NullTVB,curoffset,sizeof(gint32),\
                *((int*)&pd[curoffset]));\
        curoffset += 4;
 
@@ -989,7 +989,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
        TRUNC(2*sizeof(guint32)); \
        tv.tv_sec = GETINT(); \
        tv.tv_usec = GETINT(); \
-       proto_tree_add_item(tree,field,curoffset,2*sizeof(guint32),&tv); \
+       proto_tree_add_item(tree,field, NullTVB,curoffset,2*sizeof(guint32),&tv); \
        curoffset += 8; \
        }
 
@@ -999,14 +999,14 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
        TRUNC(sizeof(guint32)); \
        tv.tv_sec = GETINT(); \
        tv.tv_usec = 0; \
-       proto_tree_add_item(tree,field,curoffset,sizeof(guint32),&tv); \
+       proto_tree_add_item(tree,field, NullTVB,curoffset,sizeof(guint32),&tv); \
        curoffset += 4; \
        }
 
 /* Output a callback */
 #define FS_CALLBACKOUT() \
        {       proto_tree *save, *ti; \
-               ti = proto_tree_add_text(tree, curoffset, 3*4, "Callback"); \
+               ti = proto_tree_add_text(tree, NullTVB, curoffset, 3*4, "Callback"); \
                save = tree; \
                tree = proto_item_add_subtree(ti, ett_afs_callback); \
                TRUNC(3*sizeof(guint32)); \
@@ -1019,7 +1019,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
 /* Output a callback */
 #define CB_CALLBACKOUT() \
        {       proto_tree *save, *ti; \
-               ti = proto_tree_add_text(tree, curoffset, 3*4, "Callback"); \
+               ti = proto_tree_add_text(tree, NullTVB, curoffset, 3*4, "Callback"); \
                save = tree; \
                tree = proto_item_add_subtree(ti, ett_afs_callback); \
                TRUNC(3*sizeof(guint32)); \
@@ -1033,7 +1033,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
 /* Output a File ID */
 #define FS_FIDOUT(label) \
        {       proto_tree *save, *ti; \
-               ti = proto_tree_add_text(tree, curoffset, 3*4, \
+               ti = proto_tree_add_text(tree, NullTVB, curoffset, 3*4, \
                        "FileID (%s)", label); \
                save = tree; \
                tree = proto_item_add_subtree(ti, ett_afs_fid); \
@@ -1046,7 +1046,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
 /* Output a File ID */
 #define CB_FIDOUT(label) \
        {       proto_tree *save, *ti; \
-               ti = proto_tree_add_text(tree, curoffset, 3*4, \
+               ti = proto_tree_add_text(tree, NullTVB, curoffset, 3*4, \
                        "FileID (%s)", label); \
                save = tree; \
                tree = proto_item_add_subtree(ti, ett_afs_fid); \
@@ -1070,21 +1070,21 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                if ( acl & PRSFS_WRITE ) strcat(tmp, "w"); \
                if ( acl & PRSFS_LOCK ) strcat(tmp, "k"); \
                if ( acl & PRSFS_ADMINISTER ) strcat(tmp, "a"); \
-               ti = proto_tree_add_text(tree, curoffset, bytes, \
+               ti = proto_tree_add_text(tree, NullTVB, curoffset, bytes, \
                        "ACL:  %s %s%s", \
                        who, tmp, positive ? "" : " (negative)"); \
                save = tree; \
                tree = proto_item_add_subtree(ti, ett_afs_acl); \
-               proto_tree_add_item(tree,hf_afs_fs_acl_entity,curoffset,strlen(who), who);\
+               proto_tree_add_item(tree,hf_afs_fs_acl_entity, NullTVB,curoffset,strlen(who), who);\
                tmpoffset = curoffset + strlen(who) + 1; \
                acllen = bytes - strlen(who) - 1; \
-               proto_tree_add_item(tree,hf_afs_fs_acl_r,tmpoffset,acllen,acl);\
-               proto_tree_add_item(tree,hf_afs_fs_acl_l,tmpoffset,acllen,acl);\
-               proto_tree_add_item(tree,hf_afs_fs_acl_i,tmpoffset,acllen,acl);\
-               proto_tree_add_item(tree,hf_afs_fs_acl_d,tmpoffset,acllen,acl);\
-               proto_tree_add_item(tree,hf_afs_fs_acl_w,tmpoffset,acllen,acl);\
-               proto_tree_add_item(tree,hf_afs_fs_acl_k,tmpoffset,acllen,acl);\
-               proto_tree_add_item(tree,hf_afs_fs_acl_a,tmpoffset,acllen,acl);\
+               proto_tree_add_item(tree,hf_afs_fs_acl_r, NullTVB,tmpoffset,acllen,acl);\
+               proto_tree_add_item(tree,hf_afs_fs_acl_l, NullTVB,tmpoffset,acllen,acl);\
+               proto_tree_add_item(tree,hf_afs_fs_acl_i, NullTVB,tmpoffset,acllen,acl);\
+               proto_tree_add_item(tree,hf_afs_fs_acl_d, NullTVB,tmpoffset,acllen,acl);\
+               proto_tree_add_item(tree,hf_afs_fs_acl_w, NullTVB,tmpoffset,acllen,acl);\
+               proto_tree_add_item(tree,hf_afs_fs_acl_k, NullTVB,tmpoffset,acllen,acl);\
+               proto_tree_add_item(tree,hf_afs_fs_acl_a, NullTVB,tmpoffset,acllen,acl);\
                tree = save; \
        }
 
@@ -1099,7 +1099,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
 /* Raw data */
 #define BYTESOUT(field, bytes) \
        TRUNC(bytes); \
-       proto_tree_add_item(tree,field,curoffset,bytes,\
+       proto_tree_add_item(tree,field, NullTVB,curoffset,bytes,\
                (void *)&pd[curoffset]); \
        curoffset += bytes;
 
@@ -1112,10 +1112,10 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                curoffset += 4; \
                TRUNC(i); \
                if ( i > 0 ) { \
-                       proto_tree_add_item(tree, field, curoffset-4, i+4, \
+                       proto_tree_add_item(tree, field, NullTVB, curoffset-4, i+4, \
                        (void *)&pd[curoffset]); \
                } else { \
-                       proto_tree_add_item(tree, field, curoffset-4, 4, \
+                       proto_tree_add_item(tree, field, NullTVB, curoffset-4, 4, \
                        ""); \
                } \
                curoffset += i; \
@@ -1133,7 +1133,7 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                        curoffset += sizeof(guint32);\
                }\
                tmp[length] = '\0';\
-               proto_tree_add_item(tree, field, soff, length, tmp);\
+               proto_tree_add_item(tree, field, NullTVB, soff, length, tmp);\
        }
 
 /* Output a UBIK version code */
@@ -1148,13 +1148,13 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                curoffset += 4; \
                tv.tv_sec = epoch; \
                tv.tv_usec = 0; \
-               ti = proto_tree_add_text(tree, curoffset, 3*4, \
+               ti = proto_tree_add_text(tree, NullTVB, curoffset, 3*4, \
                        "UBIK Version (%s): %u.%u", label, epoch, counter ); \
                save = tree; \
                tree = proto_item_add_subtree(ti, ett_afs_ubikver); \
-               proto_tree_add_item(tree,hf_afs_ubik_version_epoch,curoffset-8, \
+               proto_tree_add_item(tree,hf_afs_ubik_version_epoch, NullTVB,curoffset-8, \
                        sizeof(guint32),&tv); \
-               proto_tree_add_item(tree,hf_afs_ubik_version_counter,curoffset-4, \
+               proto_tree_add_item(tree,hf_afs_ubik_version_counter, NullTVB,curoffset-4, \
                        sizeof(guint32),counter); \
                tree = save; \
        }
@@ -1203,14 +1203,14 @@ static void dissect_acl(const u_char *pd, int offset, frame_data *fd, proto_tree
                return;
        s += n;
        TRUNC(1);
-       proto_tree_add_item(tree, hf_afs_fs_acl_count_positive, curoffset, n, pos);
+       proto_tree_add_item(tree, hf_afs_fs_acl_count_positive, NullTVB, curoffset, n, pos);
        curoffset += n;
 
        if (sscanf((char *) s, "%d %n", &neg, &n) != 1)
                return;
        s += n;
        TRUNC(1);
-       proto_tree_add_item(tree, hf_afs_fs_acl_count_negative, curoffset, n, neg);
+       proto_tree_add_item(tree, hf_afs_fs_acl_count_negative, NullTVB, curoffset, n, neg);
        curoffset += n;
 
 
@@ -1887,7 +1887,7 @@ dissect_vldb_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tre
                                                if ( i<nservers && j<=26 )
                                                {
                                                        part[6] = (char) j;
-                                                       proto_tree_add_item(tree, hf_afs_vldb_partition,
+                                                       proto_tree_add_item(tree, hf_afs_vldb_partition, NullTVB,
                                                                curoffset, 4, part);
                                                }
                                                SKIP(4);
@@ -1934,7 +1934,7 @@ dissect_vldb_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tre
                                                if ( i<nservers && j<=26 )
                                                {
                                                        part[6] = (char) j;
-                                                       proto_tree_add_item(tree, hf_afs_vldb_partition,
+                                                       proto_tree_add_item(tree, hf_afs_vldb_partition, NullTVB,
                                                                curoffset, 4, part);
                                                }
                                                SKIP(4);
@@ -1973,7 +1973,7 @@ dissect_vldb_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tre
                                                if ( i<nservers && j<=26 )
                                                {
                                                        part[6] = (char) j;
-                                                       proto_tree_add_item(tree, hf_afs_vldb_partition,
+                                                       proto_tree_add_item(tree, hf_afs_vldb_partition, NullTVB,
                                                                curoffset, 4, part);
                                                }
                                                SKIP(4);
@@ -2064,7 +2064,7 @@ dissect_ubik_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tre
                switch ( opcode )
                {
                        case 10000: /* beacon */
-                               proto_tree_add_item(tree,hf_afs_ubik_votetype,0,0,0);
+                               proto_tree_add_item(tree,hf_afs_ubik_votetype, NullTVB,0,0,0);
                                break;
                        case 20004: /* get version */
                                UBIK_VERSIONOUT("DB Version");
@@ -2076,7 +2076,7 @@ dissect_ubik_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tre
                switch ( opcode )
                {
                        case 10000:
-                               proto_tree_add_item(tree,hf_afs_ubik_votetype,0,0,1);
+                               proto_tree_add_item(tree,hf_afs_ubik_votetype, NullTVB,0,0,1);
                                DATEOUT(hf_afs_ubik_voteend);
                                break;
                        default:
index f56010cd5e38609ed7cf1177ffc87a51d1309a94..f066ef938a2126cf5a17544953f6f42af3cb44f8 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-arp.c
  * Routines for ARP packet disassembly
  *
- * $Id: packet-arp.c,v 1.28 2000/04/16 22:59:36 guy Exp $
+ * $Id: packet-arp.c,v 1.29 2000/05/11 08:14:51 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -285,9 +285,9 @@ dissect_atm_number(const u_char *pd, int offset, int tl, int hf_e164,
        proto_tree *nsap_tree;
 
        if (tl & ATMARP_IS_E164)
-               proto_tree_add_item(tree, hf_e164, offset, len, &pd[offset]);
+               proto_tree_add_item(tree, hf_e164, NullTVB, offset, len, &pd[offset]);
        else {
-               ti = proto_tree_add_item(tree, hf_nsap, offset, len,
+               ti = proto_tree_add_item(tree, hf_nsap, NullTVB, offset, len,
                    &pd[offset]);
                if (len >= 20) {
                        nsap_tree = proto_item_add_subtree(ti, ett_atmarp_nsap);
@@ -303,56 +303,56 @@ dissect_atm_nsap(const u_char *pd, int offset, int len, proto_tree *tree)
 
        case 0x39:      /* DCC ATM format */
        case 0xBD:      /* DCC ATM group format */
-               proto_tree_add_text(tree, offset + 0, 3,
+               proto_tree_add_text(tree, NullTVB, offset + 0, 3,
                    "Data Country Code%s: 0x%04X",
                    (pd[offset] == 0xBD) ? " (group)" : "",
                    pntohs(&pd[offset + 1]));
-               proto_tree_add_text(tree, offset + 3, 10,
+               proto_tree_add_text(tree, NullTVB, offset + 3, 10,
                    "High Order DSP: %s",
                    bytes_to_str(&pd[offset + 3], 10));
-               proto_tree_add_text(tree, offset + 13, 6,
+               proto_tree_add_text(tree, NullTVB, offset + 13, 6,
                    "End System Identifier: %s",
                    bytes_to_str(&pd[offset + 13], 6));
-               proto_tree_add_text(tree, offset + 19, 1,
+               proto_tree_add_text(tree, NullTVB, offset + 19, 1,
                    "Selector: 0x%02X", pd[offset + 19]);
                break;
 
        case 0x47:      /* ICD ATM format */
        case 0xC5:      /* ICD ATM group format */
-               proto_tree_add_text(tree, offset + 0, 3,
+               proto_tree_add_text(tree, NullTVB, offset + 0, 3,
                    "International Code Designator%s: 0x%04X",
                    (pd[offset] == 0xC5) ? " (group)" : "",
                    pntohs(&pd[offset + 1]));
-               proto_tree_add_text(tree, offset + 3, 10,
+               proto_tree_add_text(tree, NullTVB, offset + 3, 10,
                    "High Order DSP: %s",
                    bytes_to_str(&pd[offset + 3], 10));
-               proto_tree_add_text(tree, offset + 13, 6,
+               proto_tree_add_text(tree, NullTVB, offset + 13, 6,
                    "End System Identifier: %s",
                    bytes_to_str(&pd[offset + 13], 6));
-               proto_tree_add_text(tree, offset + 19, 1,
+               proto_tree_add_text(tree, NullTVB, offset + 19, 1,
                    "Selector: 0x%02X", pd[offset + 19]);
                break;
 
        case 0x45:      /* E.164 ATM format */
        case 0xC3:      /* E.164 ATM group format */
-               proto_tree_add_text(tree, offset + 0, 9,
+               proto_tree_add_text(tree, NullTVB, offset + 0, 9,
                    "E.164 ISDN%s: %s",
                    (pd[offset] == 0xC3) ? " (group)" : "",
                    bytes_to_str(&pd[offset + 1], 8));
-               proto_tree_add_text(tree, offset + 9, 4,
+               proto_tree_add_text(tree, NullTVB, offset + 9, 4,
                    "High Order DSP: %s",
                    bytes_to_str(&pd[offset + 3], 10));
-               proto_tree_add_text(tree, offset + 13, 6,
+               proto_tree_add_text(tree, NullTVB, offset + 13, 6,
                    "End System Identifier: %s",
                    bytes_to_str(&pd[offset + 13], 6));
-               proto_tree_add_text(tree, offset + 19, 1,
+               proto_tree_add_text(tree, NullTVB, offset + 19, 1,
                    "Selector: 0x%02X", pd[offset + 19]);
                break;
 
        default:
-               proto_tree_add_text(tree, offset, 1,
+               proto_tree_add_text(tree, NullTVB, offset, 1,
                    "Unknown AFI: 0x%02X", pd[offset]);
-               proto_tree_add_text(tree, offset + 1, len - 1,
+               proto_tree_add_text(tree, NullTVB, offset + 1, len - 1,
                    "Rest of address: %s",
                    bytes_to_str(&pd[offset + 1], len - 1));
                break;
@@ -496,53 +496,53 @@ dissect_atmarp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
 
   if (tree) {
     if ((op_str = match_strval(ar_op, atmop_vals)))
-      ti = proto_tree_add_protocol_format(tree, proto_arp, offset, tot_len,
+      ti = proto_tree_add_protocol_format(tree, proto_arp, NullTVB, offset, tot_len,
                                        "ATM Address Resolution Protocol (%s)", 
                                        op_str);
     else
-      ti = proto_tree_add_protocol_format(tree, proto_arp, offset, tot_len,
+      ti = proto_tree_add_protocol_format(tree, proto_arp, NullTVB, offset, tot_len,
                                      "ATM Address Resolution Protocol (opcode 0x%04x)", ar_op);
     arp_tree = proto_item_add_subtree(ti, ett_arp);
-    proto_tree_add_item(arp_tree, hf_arp_hard_type, offset + ATM_AR_HRD, 2,
+    proto_tree_add_item(arp_tree, hf_arp_hard_type, NullTVB, offset + ATM_AR_HRD, 2,
                               ar_hrd);
-    proto_tree_add_item(arp_tree, hf_arp_proto_type, offset + ATM_AR_PRO, 2,
+    proto_tree_add_item(arp_tree, hf_arp_proto_type, NullTVB, offset + ATM_AR_PRO, 2,
                               ar_pro);
-    proto_tree_add_item(arp_tree, hf_atmarp_shtl, offset + ATM_AR_SHTL, 1,
+    proto_tree_add_item(arp_tree, hf_atmarp_shtl, NullTVB, offset + ATM_AR_SHTL, 1,
                               ar_shtl);
-    proto_tree_add_item(arp_tree, hf_atmarp_ssl, offset + ATM_AR_SSL, 1,
+    proto_tree_add_item(arp_tree, hf_atmarp_ssl, NullTVB, offset + ATM_AR_SSL, 1,
                               ar_ssl);
-    proto_tree_add_item(arp_tree, hf_arp_opcode, offset + AR_OP,  2,
+    proto_tree_add_item(arp_tree, hf_arp_opcode, NullTVB, offset + AR_OP,  2,
                               ar_op);
-    proto_tree_add_item(arp_tree, hf_atmarp_spln, offset + ATM_AR_SPLN, 1,
+    proto_tree_add_item(arp_tree, hf_atmarp_spln, NullTVB, offset + ATM_AR_SPLN, 1,
                               ar_spln);
-    proto_tree_add_item(arp_tree, hf_atmarp_thtl, offset + ATM_AR_THTL, 1,
+    proto_tree_add_item(arp_tree, hf_atmarp_thtl, NullTVB, offset + ATM_AR_THTL, 1,
                               ar_thtl);
-    proto_tree_add_item(arp_tree, hf_atmarp_tsl, offset + ATM_AR_TSL, 1,
+    proto_tree_add_item(arp_tree, hf_atmarp_tsl, NullTVB, offset + ATM_AR_TSL, 1,
                               ar_tsl);
-    proto_tree_add_item(arp_tree, hf_atmarp_tpln, offset + ATM_AR_TPLN, 1,
+    proto_tree_add_item(arp_tree, hf_atmarp_tpln, NullTVB, offset + ATM_AR_TPLN, 1,
                               ar_tpln);
     if (ar_shl != 0)
       dissect_atm_number(pd, sha_offset, ar_shtl, hf_atmarp_src_atm_num_e164,
                               hf_atmarp_src_atm_num_nsap, arp_tree);
     if (ar_ssl != 0)
-      proto_tree_add_bytes_format(arp_tree, hf_atmarp_src_atm_subaddr, ssa_offset,
+      proto_tree_add_bytes_format(arp_tree, hf_atmarp_src_atm_subaddr, NullTVB, ssa_offset,
                               ar_ssl,
                               &pd[ssa_offset],
                               "Sender ATM subaddress: %s", ssa_str);
     if (ar_spln != 0)
-      proto_tree_add_bytes_format(arp_tree, hf_arp_src_proto, spa_offset, ar_spln,
+      proto_tree_add_bytes_format(arp_tree, hf_arp_src_proto, NullTVB, spa_offset, ar_spln,
                               &pd[spa_offset],
                               "Sender protocol address: %s", spa_str);
     if (ar_thl != 0)
       dissect_atm_number(pd, tha_offset, ar_thtl, hf_atmarp_dst_atm_num_e164,
                               hf_atmarp_dst_atm_num_nsap, arp_tree);
     if (ar_tsl != 0)
-      proto_tree_add_bytes_format(arp_tree, hf_atmarp_dst_atm_subaddr, tsa_offset,
+      proto_tree_add_bytes_format(arp_tree, hf_atmarp_dst_atm_subaddr, NullTVB, tsa_offset,
                               ar_tsl,
                               &pd[tsa_offset],
                               "Target ATM subaddress: %s", tsa_str);
     if (ar_tpln != 0)
-      proto_tree_add_bytes_format(arp_tree, hf_arp_dst_proto, tpa_offset, ar_tpln,
+      proto_tree_add_bytes_format(arp_tree, hf_arp_dst_proto, NullTVB, tpa_offset, ar_tpln,
                               &pd[tpa_offset],
                               "Target protocol address: %s", tpa_str);
   }
@@ -639,36 +639,36 @@ dissect_arp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
 
   if (tree) {
     if ((op_str = match_strval(ar_op, op_vals)))
-      ti = proto_tree_add_protocol_format(tree, proto_arp, offset, tot_len,
+      ti = proto_tree_add_protocol_format(tree, proto_arp, NullTVB, offset, tot_len,
                                        "Address Resolution Protocol (%s)", op_str);
     else
-      ti = proto_tree_add_protocol_format(tree, proto_arp, offset, tot_len,
+      ti = proto_tree_add_protocol_format(tree, proto_arp, NullTVB, offset, tot_len,
                                      "Address Resolution Protocol (opcode 0x%04x)", ar_op);
     arp_tree = proto_item_add_subtree(ti, ett_arp);
-    proto_tree_add_item(arp_tree, hf_arp_hard_type, offset + AR_HRD, 2,
+    proto_tree_add_item(arp_tree, hf_arp_hard_type, NullTVB, offset + AR_HRD, 2,
                               ar_hrd);
-    proto_tree_add_item(arp_tree, hf_arp_proto_type, offset + AR_PRO, 2,
+    proto_tree_add_item(arp_tree, hf_arp_proto_type, NullTVB, offset + AR_PRO, 2,
                               ar_pro);
-    proto_tree_add_item(arp_tree, hf_arp_hard_size, offset + AR_HLN, 1,
+    proto_tree_add_item(arp_tree, hf_arp_hard_size, NullTVB, offset + AR_HLN, 1,
                               ar_hln);
-    proto_tree_add_item(arp_tree, hf_arp_proto_size, offset + AR_PLN, 1,
+    proto_tree_add_item(arp_tree, hf_arp_proto_size, NullTVB, offset + AR_PLN, 1,
                               ar_pln);
-    proto_tree_add_item(arp_tree, hf_arp_opcode, offset + AR_OP,  2,
+    proto_tree_add_item(arp_tree, hf_arp_opcode, NullTVB, offset + AR_OP,  2,
                               ar_op);
     if (ar_hln != 0)
-      proto_tree_add_bytes_format(arp_tree, hf_arp_src_ether, sha_offset, ar_hln,
+      proto_tree_add_bytes_format(arp_tree, hf_arp_src_ether, NullTVB, sha_offset, ar_hln,
                               &pd[sha_offset],
                               "Sender hardware address: %s", sha_str);
     if (ar_pln != 0)
-      proto_tree_add_bytes_format(arp_tree, hf_arp_src_proto, spa_offset, ar_pln,
+      proto_tree_add_bytes_format(arp_tree, hf_arp_src_proto, NullTVB, spa_offset, ar_pln,
                               &pd[spa_offset],
                               "Sender protocol address: %s", spa_str);
     if (ar_hln != 0)
-      proto_tree_add_bytes_format(arp_tree, hf_arp_dst_ether, tha_offset, ar_hln,
+      proto_tree_add_bytes_format(arp_tree, hf_arp_dst_ether, NullTVB, tha_offset, ar_hln,
                               &pd[tha_offset],
                               "Target hardware address: %s", tha_str);
     if (ar_pln != 0)
-      proto_tree_add_bytes_format(arp_tree, hf_arp_dst_proto, tpa_offset, ar_pln,
+      proto_tree_add_bytes_format(arp_tree, hf_arp_dst_proto, NullTVB, tpa_offset, ar_pln,
                               &pd[tpa_offset],
                               "Target protocol address: %s", tpa_str);
   }
index 079bac0e0317c3c752a2de4b88ccd587dcf9d3fa..cee11ab9f040cdea250c52aa9277340a1b1c10b0 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-ascend.c
  * Routines for decoding Lucent/Ascend packet traces
  *
- * $Id: packet-ascend.c,v 1.10 2000/03/27 17:53:18 gram Exp $
+ * $Id: packet-ascend.c,v 1.11 2000/05/11 08:14:54 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -70,24 +70,24 @@ dissect_ascend( const u_char *pd, frame_data *fd, proto_tree *tree ) {
   /* populate a tree in the second pane with the status of the link
      layer (ie none) */
   if(tree) {
-    ti = proto_tree_add_text(tree, 0, 0, "Lucent/Ascend packet trace" );
+    ti = proto_tree_add_text(tree, NullTVB, 0, 0, "Lucent/Ascend packet trace" );
     fh_tree = proto_item_add_subtree(ti, ett_raw);
-    proto_tree_add_item(fh_tree, hf_link_type, 0, 0, 
+    proto_tree_add_item(fh_tree, hf_link_type, NullTVB, 0, 0, 
                        fd->pseudo_header.ascend.type);
     if (fd->pseudo_header.ascend.type == ASCEND_PFX_WDD) {
-      proto_tree_add_item(fh_tree, hf_called_number, 0, 0, 
+      proto_tree_add_item(fh_tree, hf_called_number, NullTVB, 0, 0, 
                          fd->pseudo_header.ascend.call_num);
-      proto_tree_add_item(fh_tree, hf_chunk, 0, 0,
+      proto_tree_add_item(fh_tree, hf_chunk, NullTVB, 0, 0,
                          fd->pseudo_header.ascend.chunk);
-      proto_tree_add_item_hidden(fh_tree, hf_session_id, 0, 0, 0);
+      proto_tree_add_item_hidden(fh_tree, hf_session_id, NullTVB, 0, 0, 0);
     } else {  /* It's wandsession data */
-      proto_tree_add_item(fh_tree, hf_user_name, 0, 0, 
+      proto_tree_add_item(fh_tree, hf_user_name, NullTVB, 0, 0, 
                          fd->pseudo_header.ascend.user);
-      proto_tree_add_item(fh_tree, hf_session_id, 0, 0,
+      proto_tree_add_item(fh_tree, hf_session_id, NullTVB, 0, 0,
                          fd->pseudo_header.ascend.sess);
-      proto_tree_add_item_hidden(fh_tree, hf_chunk, 0, 0, 0);
+      proto_tree_add_item_hidden(fh_tree, hf_chunk, NullTVB, 0, 0, 0);
     }
-    proto_tree_add_item(fh_tree, hf_task, 0, 0, fd->pseudo_header.ascend.task);
+    proto_tree_add_item(fh_tree, hf_task, NullTVB, 0, 0, fd->pseudo_header.ascend.task);
   }
 
   switch (fd->pseudo_header.ascend.type) {
index b599f8483752854cf93db3393a4226afb7276274..6023821b1a52f66b2467e499dbb04321e3b600a7 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-atalk.c
  * Routines for Appletalk packet disassembly (DDP, currently).
  *
- * $Id: packet-atalk.c,v 1.33 2000/04/16 21:37:03 guy Exp $
+ * $Id: packet-atalk.c,v 1.34 2000/05/11 08:14:55 gram Exp $
  *
  * Simon Wilkinson <sxw@dcs.ed.ac.uk>
  *
@@ -172,11 +172,11 @@ int dissect_pascal_string(const u_char *pd, int offset, frame_data *fd,
                tmp = g_malloc( len+1 );
                memcpy(tmp, &pd[offset], len);
                tmp[len] = 0;
-               item = proto_tree_add_item(tree, hf_index, offset-1, len+1, tmp);
+               item = proto_tree_add_item(tree, hf_index, NullTVB, offset-1, len+1, tmp);
 
                subtree = proto_item_add_subtree(item, ett_pstring);
-               proto_tree_add_text(subtree, offset-1, 1, "Length: %d", len);
-               proto_tree_add_text(subtree, offset, len, "Data: %s", tmp);
+               proto_tree_add_text(subtree, NullTVB, offset-1, 1, "Length: %d", len);
+               proto_tree_add_text(subtree, NullTVB, offset, len, "Data: %s", tmp);
                
                g_free(tmp);
        }
@@ -223,12 +223,12 @@ dissect_rtmp_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree
                net, nodelen_bits, node);
   
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_rtmp, offset, END_OF_FRAME, NULL);
+    ti = proto_tree_add_item(tree, proto_rtmp, NullTVB, offset, END_OF_FRAME, NULL);
     rtmp_tree = proto_item_add_subtree(ti, ett_rtmp);
 
-       proto_tree_add_item(rtmp_tree, hf_rtmp_net, offset, 2, net);
-       proto_tree_add_item(rtmp_tree, hf_rtmp_node_len, offset+2, 1, nodelen_bits);
-       proto_tree_add_item(rtmp_tree, hf_rtmp_node, offset+3, nodelen, nodelen);
+       proto_tree_add_item(rtmp_tree, hf_rtmp_net, NullTVB, offset, 2, net);
+       proto_tree_add_item(rtmp_tree, hf_rtmp_node_len, NullTVB, offset+2, 1, nodelen_bits);
+       proto_tree_add_item(rtmp_tree, hf_rtmp_node, NullTVB, offset+3, nodelen, nodelen);
     offset += 3 + nodelen;
 
     i = 1;
@@ -247,14 +247,14 @@ dissect_rtmp_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree
                tuple_net = pntohs(&pd[offset]);
                tuple_dist = pd[offset+2];
 
-               tuple_item = proto_tree_add_text(rtmp_tree, offset, 3, 
+               tuple_item = proto_tree_add_text(rtmp_tree, NullTVB, offset, 3, 
                        "Tuple %d:  Net: %d  Dist: %d",
                        i, tuple_net, tuple_dist);
                tuple_tree = proto_item_add_subtree(tuple_item, ett_rtmp_tuple);
 
-               proto_tree_add_item(tuple_tree, hf_rtmp_tuple_net, offset, 2, 
+               proto_tree_add_item(tuple_tree, hf_rtmp_tuple_net, NullTVB, offset, 2, 
                        tuple_net);
-               proto_tree_add_item(tuple_tree, hf_rtmp_tuple_dist, offset+2, 1,
+               proto_tree_add_item(tuple_tree, hf_rtmp_tuple_dist, NullTVB, offset+2, 1,
                        tuple_dist);
 
                if ( tuple_dist == 0 || tuple_dist & 0x80 ) /* phase 1/2 */
@@ -268,9 +268,9 @@ dissect_rtmp_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree
                        tuple_net2 = pntohs(&pd[offset+3]);
                        tuple_dist2 = pd[offset+5];
 
-                       proto_tree_add_item(tuple_tree, hf_rtmp_tuple_net, offset, 2, 
+                       proto_tree_add_item(tuple_tree, hf_rtmp_tuple_net, NullTVB, offset, 2, 
                                tuple_net2);
-                       proto_tree_add_item(tuple_tree, hf_rtmp_tuple_dist, offset+2, 1,
+                       proto_tree_add_item(tuple_tree, hf_rtmp_tuple_dist, NullTVB, offset+2, 1,
                                tuple_dist2);
                                
                        proto_item_set_len(tuple_item, 6);
@@ -312,18 +312,18 @@ dissect_nbp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
       val_to_str(op, nbp_op_vals, "unknown (%1x)"), count);
   
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_nbp, offset, END_OF_FRAME, NULL);
+    ti = proto_tree_add_item(tree, proto_nbp, NullTVB, offset, END_OF_FRAME, NULL);
     nbp_tree = proto_item_add_subtree(ti, ett_nbp);
 
-    info_item = proto_tree_add_uint_format(nbp_tree, hf_nbp_info, offset, 1,
+    info_item = proto_tree_add_uint_format(nbp_tree, hf_nbp_info, NullTVB, offset, 1,
                pd[offset], 
                "Info: 0x%01X  Operation: %s  Count: %d", pd[offset],
                val_to_str(op, nbp_op_vals, "unknown"),
                count);
        nbp_info_tree = proto_item_add_subtree(info_item, ett_nbp_info);
-    proto_tree_add_item(nbp_info_tree, hf_nbp_op, offset, 1, pd[offset]);
-    proto_tree_add_item(nbp_info_tree, hf_nbp_count, offset, 1, pd[offset]);
-    proto_tree_add_item(nbp_tree, hf_nbp_tid, offset+1, 1, pd[offset+1]);
+    proto_tree_add_item(nbp_info_tree, hf_nbp_op, NullTVB, offset, 1, pd[offset]);
+    proto_tree_add_item(nbp_info_tree, hf_nbp_count, NullTVB, offset, 1, pd[offset]);
+    proto_tree_add_item(nbp_tree, hf_nbp_tid, NullTVB, offset+1, 1, pd[offset+1]);
        offset += 2;
 
     for (i=0; i<count; i++) {
@@ -336,7 +336,7 @@ dissect_nbp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
                        return;
                }
 
-               node_item = proto_tree_add_text(nbp_tree, offset, 4, 
+               node_item = proto_tree_add_text(nbp_tree, NullTVB, offset, 4, 
                        "Node %d", i+1);
                node_tree = proto_item_add_subtree(node_item, ett_nbp_node);
 
@@ -347,13 +347,13 @@ dissect_nbp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
                /* note, this is probably wrong, I need to look at my info at work
                        tomorrow to straighten it out */
 
-               proto_tree_add_item(node_tree, hf_nbp_node_net, offset, 2, addr.net);
+               proto_tree_add_item(node_tree, hf_nbp_node_net, NullTVB, offset, 2, addr.net);
                offset += 2;
-               proto_tree_add_item(node_tree, hf_nbp_node_node, offset, 1, addr.node);
+               proto_tree_add_item(node_tree, hf_nbp_node_node, NullTVB, offset, 1, addr.node);
                offset++;
-               proto_tree_add_item(node_tree, hf_nbp_node_port, offset, 1, addr.port);
+               proto_tree_add_item(node_tree, hf_nbp_node_port, NullTVB, offset, 1, addr.port);
                offset++;
-               proto_tree_add_item(node_tree, hf_nbp_node_enum, offset, 1, pd[offset]);
+               proto_tree_add_item(node_tree, hf_nbp_node_enum, NullTVB, offset, 1, pd[offset]);
                offset++;
 
                offset = dissect_pascal_string(pd,offset,fd,node_tree,hf_nbp_node_object);
@@ -402,20 +402,20 @@ dissect_ddp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
       val_to_str(ddp.type, op_vals, "Unknown DDP protocol (%02x)"));
   
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_ddp, offset, DDP_HEADER_SIZE, NULL);
+    ti = proto_tree_add_item(tree, proto_ddp, NullTVB, offset, DDP_HEADER_SIZE, NULL);
     ddp_tree = proto_item_add_subtree(ti, ett_ddp);
-    proto_tree_add_item(ddp_tree, hf_ddp_hopcount, offset,      1, 
+    proto_tree_add_item(ddp_tree, hf_ddp_hopcount, NullTVB, offset,      1, 
                        ddp_hops(ddp.hops_len));
-    proto_tree_add_item(ddp_tree, hf_ddp_len, offset,      2, 
+    proto_tree_add_item(ddp_tree, hf_ddp_len, NullTVB, offset,     2, 
                        ddp_len(ddp.hops_len));
-    proto_tree_add_item(ddp_tree, hf_ddp_checksum, offset + 2,  2, ddp.sum);
-    proto_tree_add_item(ddp_tree, hf_ddp_dst_net, offset + 4,  2, ddp.dnet);
-    proto_tree_add_item(ddp_tree, hf_ddp_src_net,  offset + 6,  2, ddp.snet);
-    proto_tree_add_item(ddp_tree, hf_ddp_dst_node, offset + 8,  1, ddp.dnode);
-    proto_tree_add_item(ddp_tree, hf_ddp_src_node, offset + 9,  1, ddp.snode);
-    proto_tree_add_item(ddp_tree, hf_ddp_dst_socket, offset + 10, 1, ddp.dport);
-    proto_tree_add_item(ddp_tree, hf_ddp_src_socket, offset + 11, 1, ddp.sport);
-    proto_tree_add_item(ddp_tree, hf_ddp_type, offset + 12, 1, ddp.type);  
+    proto_tree_add_item(ddp_tree, hf_ddp_checksum, NullTVB, offset + 2,  2, ddp.sum);
+    proto_tree_add_item(ddp_tree, hf_ddp_dst_net, NullTVB, offset + 4,  2, ddp.dnet);
+    proto_tree_add_item(ddp_tree, hf_ddp_src_net, NullTVB,  offset + 6,  2, ddp.snet);
+    proto_tree_add_item(ddp_tree, hf_ddp_dst_node, NullTVB, offset + 8,  1, ddp.dnode);
+    proto_tree_add_item(ddp_tree, hf_ddp_src_node, NullTVB, offset + 9,  1, ddp.snode);
+    proto_tree_add_item(ddp_tree, hf_ddp_dst_socket, NullTVB, offset + 10, 1, ddp.dport);
+    proto_tree_add_item(ddp_tree, hf_ddp_src_socket, NullTVB, offset + 11, 1, ddp.sport);
+    proto_tree_add_item(ddp_tree, hf_ddp_type, NullTVB, offset + 12, 1, ddp.type);  
   }
 
   offset += DDP_HEADER_SIZE;
index 731c7af12c8f7650dbcd4bedd0bc9ae7f3bb2144..c0a111c86cfa6fabf5d44be94fbe2ac74eb9e04e 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-atm.c
  * Routines for ATM packet disassembly
  *
- * $Id: packet-atm.c,v 1.13 2000/03/12 04:47:35 gram Exp $
+ * $Id: packet-atm.c,v 1.14 2000/05/11 08:14:56 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -153,10 +153,10 @@ dissect_le_client(const u_char *pd, int offset, frame_data *fd, proto_tree *tree
   proto_tree *lane_tree;
 
   if (tree) {
-    ti = proto_tree_add_protocol_format(tree, proto_atm_lane, offset, 2, "ATM LANE");
+    ti = proto_tree_add_protocol_format(tree, proto_atm_lane, NullTVB, offset, 2, "ATM LANE");
     lane_tree = proto_item_add_subtree(ti, ett_atm_lane);
 
-    proto_tree_add_text(lane_tree, offset, 2, "LE Client: 0x%04X",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 2, "LE Client: 0x%04X",
                        pntohs(&pd[offset]));
   }
 }
@@ -171,11 +171,11 @@ dissect_lan_destination(const u_char *pd, int offset, const char *type, proto_tr
   proto_tree *rd_tree;
   guint16 route_descriptor;
 
-  td = proto_tree_add_text(tree, offset, 8, "%s LAN destination",
+  td = proto_tree_add_text(tree, NullTVB, offset, 8, "%s LAN destination",
                        type);
   dest_tree = proto_item_add_subtree(td, ett_atm_lane_lc_lan_dest);
   tag = pntohs(&pd[offset]);
-  proto_tree_add_text(dest_tree, offset, 2, "Tag: %s",
+  proto_tree_add_text(dest_tree, NullTVB, offset, 2, "Tag: %s",
        val_to_str(tag, le_control_landest_tag_vals,
                                "Unknown (0x%04X)"));
   offset += 2;
@@ -183,20 +183,20 @@ dissect_lan_destination(const u_char *pd, int offset, const char *type, proto_tr
   switch (tag) {
 
   case TAG_MAC_ADDRESS:
-    proto_tree_add_text(dest_tree, offset, 6, "MAC address: %s",
+    proto_tree_add_text(dest_tree, NullTVB, offset, 6, "MAC address: %s",
                        ether_to_str((u_char *)&pd[offset]));
     break;
 
   case TAG_ROUTE_DESCRIPTOR:
     offset += 4;
     route_descriptor = pntohs(&pd[offset]);
-    trd = proto_tree_add_text(dest_tree, offset, 2, "Route descriptor: 0x%02X",
+    trd = proto_tree_add_text(dest_tree, NullTVB, offset, 2, "Route descriptor: 0x%02X",
                        route_descriptor);
     rd_tree = proto_item_add_subtree(td, ett_atm_lane_lc_lan_dest_rd);
-    proto_tree_add_text(rd_tree, offset, 2,
+    proto_tree_add_text(rd_tree, NullTVB, offset, 2,
            decode_numeric_bitfield(route_descriptor, 0xFFF0, 2*8,
                        "LAN ID = %u"));
-    proto_tree_add_text(rd_tree, offset, 2,
+    proto_tree_add_text(rd_tree, NullTVB, offset, 2,
            decode_numeric_bitfield(route_descriptor, 0x000F, 2*8,
                        "Bridge number = %u"));
     break;
@@ -262,23 +262,23 @@ dissect_le_control(const u_char *pd, int offset, frame_data *fd, proto_tree *tre
     col_add_str(fd, COL_INFO, "LE Control");
 
   if (tree) {
-    ti = proto_tree_add_protocol_format(tree, proto_atm_lane, offset, 108, "ATM LANE");
+    ti = proto_tree_add_protocol_format(tree, proto_atm_lane, NullTVB, offset, 108, "ATM LANE");
     lane_tree = proto_item_add_subtree(ti, ett_atm_lane);
 
-    proto_tree_add_text(lane_tree, offset, 2, "Marker: 0x%04X",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 2, "Marker: 0x%04X",
                        pntohs(&pd[offset]));
     offset += 2;
 
-    proto_tree_add_text(lane_tree, offset, 1, "Protocol: 0x%02X",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 1, "Protocol: 0x%02X",
                        pd[offset]);
     offset += 1;
 
-    proto_tree_add_text(lane_tree, offset, 1, "Version: 0x%02X",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 1, "Version: 0x%02X",
                        pd[offset]);
     offset += 1;
 
     opcode = pntohs(&pd[offset]);
-    proto_tree_add_text(lane_tree, offset, 2, "Opcode: %s",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 2, "Opcode: %s",
        val_to_str(opcode, le_control_opcode_vals,
                                "Unknown (0x%04X)"));
     offset += 2;
@@ -290,31 +290,31 @@ dissect_le_control(const u_char *pd, int offset, frame_data *fd, proto_tree *tre
 
     if (opcode & 0x0100) {
       /* Response; decode status. */
-      proto_tree_add_text(lane_tree, offset, 2, "Status: %s",
+      proto_tree_add_text(lane_tree, NullTVB, offset, 2, "Status: %s",
        val_to_str(pntohs(&pd[offset]), le_control_status_vals,
                                "Unknown (0x%04X)"));
     }
     offset += 2;
 
-    proto_tree_add_text(lane_tree, offset, 4, "Transaction ID: 0x%08X",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 4, "Transaction ID: 0x%08X",
                        pntohl(&pd[offset]));
     offset += 4;
 
-    proto_tree_add_text(lane_tree, offset, 2, "Requester LECID: 0x%04X",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 2, "Requester LECID: 0x%04X",
                        pntohs(&pd[offset]));
     offset += 2;
 
     flags = pntohs(&pd[offset]);
-    tf = proto_tree_add_text(lane_tree, offset, 2, "Flags: 0x%04X",
+    tf = proto_tree_add_text(lane_tree, NullTVB, offset, 2, "Flags: 0x%04X",
                        pntohs(&pd[offset]));
     flags_tree = proto_item_add_subtree(tf, ett_atm_lane_lc_flags);
-    proto_tree_add_text(flags_tree, offset, 2, "%s",
+    proto_tree_add_text(flags_tree, NullTVB, offset, 2, "%s",
        decode_boolean_bitfield(flags, 0x0001, 8*2,
                                "Remote address", "Local address"));
-    proto_tree_add_text(flags_tree, offset, 2, "%s",
+    proto_tree_add_text(flags_tree, NullTVB, offset, 2, "%s",
        decode_boolean_bitfield(flags, 0x0080, 8*2,
                                "Proxy", "Not proxy"));
-    proto_tree_add_text(flags_tree, offset, 2, "%s",
+    proto_tree_add_text(flags_tree, NullTVB, offset, 2, "%s",
        decode_boolean_bitfield(flags, 0x0100, 8*2,
                                "Topology change", "No topology change"));
     offset += 2;
@@ -325,45 +325,45 @@ dissect_le_control(const u_char *pd, int offset, frame_data *fd, proto_tree *tre
     dissect_lan_destination(pd, offset, "Target", lane_tree);
     offset += 8;
 
-    proto_tree_add_text(lane_tree, offset, 20, "Source ATM Address: %s",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 20, "Source ATM Address: %s",
                        bytes_to_str(&pd[offset], 20));
     offset += 20;
 
-    proto_tree_add_text(lane_tree, offset, 1, "LAN type: %s",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 1, "LAN type: %s",
        val_to_str(pd[offset], le_control_lan_type_vals,
                                "Unknown (0x%02X)"));
     offset += 1;
 
-    proto_tree_add_text(lane_tree, offset, 1, "Maximum frame size: %u",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 1, "Maximum frame size: %u",
                        pd[offset]);
     offset += 1;
 
     num_tlvs = pd[offset];
-    proto_tree_add_text(lane_tree, offset, 1, "Number of TLVs: %u",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 1, "Number of TLVs: %u",
                        num_tlvs);
     offset += 1;
 
-    proto_tree_add_text(lane_tree, offset, 1, "ELAN name size: %u",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 1, "ELAN name size: %u",
                        pd[offset]);
     offset += 1;
 
-    proto_tree_add_text(lane_tree, offset, 20, "Target ATM Address: %s",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 20, "Target ATM Address: %s",
                        bytes_to_str(&pd[offset], 20));
     offset += 20;
 
-    proto_tree_add_text(lane_tree, offset, 32, "ELAN name: %s",
+    proto_tree_add_text(lane_tree, NullTVB, offset, 32, "ELAN name: %s",
                        bytes_to_str(&pd[offset], 32));
     offset += 32;
 
     while (num_tlvs != 0) {
       tlv_type = pntohl(&pd[offset]);
       tlv_length = pd[offset+4];
-      ttlv = proto_tree_add_text(lane_tree, offset, 5+tlv_length, "TLV type: %s",
+      ttlv = proto_tree_add_text(lane_tree, NullTVB, offset, 5+tlv_length, "TLV type: %s",
        val_to_str(tlv_type, le_tlv_type_vals, "Unknown (0x%08x)"));
       tlv_tree = proto_item_add_subtree(ttlv, ett_atm_lane_lc_tlv);
-      proto_tree_add_text(tlv_tree, offset, 4, "TLV Type: %s",
+      proto_tree_add_text(tlv_tree, NullTVB, offset, 4, "TLV Type: %s",
        val_to_str(tlv_type, le_tlv_type_vals, "Unknown (0x%08x)"));
-      proto_tree_add_text(tlv_tree, offset+4, 1, "TLV Length: %u", tlv_length);
+      proto_tree_add_text(tlv_tree, NullTVB, offset+4, 1, "TLV Length: %u", tlv_length);
       offset += 5+tlv_length;
       num_tlvs--;
     }
@@ -619,58 +619,58 @@ dissect_atm(const u_char *pd, frame_data *fd, proto_tree *tree)
   }
 
   if (tree) {
-    ti = proto_tree_add_protocol_format(tree, proto_atm, 0, 0, "ATM");
+    ti = proto_tree_add_protocol_format(tree, proto_atm, NullTVB, 0, 0, "ATM");
     atm_tree = proto_item_add_subtree(ti, ett_atm);
 
-    proto_tree_add_text(atm_tree, 0, 0, "AAL: %s",
+    proto_tree_add_text(atm_tree, NullTVB, 0, 0, "AAL: %s",
        val_to_str(aal_type, aal_vals, "Unknown AAL (%x)"));
     if (aal_type == ATT_AAL5) {
-      proto_tree_add_text(atm_tree, 0, 0, "Traffic type: %s",
+      proto_tree_add_text(atm_tree, NullTVB, 0, 0, "Traffic type: %s",
        val_to_str(hl_type, aal5_hltype_vals, "Unknown AAL5 traffic type (%x)"));
       switch (hl_type) {
 
       case ATT_HL_LLCMX:
-        proto_tree_add_text(atm_tree, 0, 0, "LLC multiplexed traffic");
+        proto_tree_add_text(atm_tree, NullTVB, 0, 0, "LLC multiplexed traffic");
         break;
 
       case ATT_HL_VCMX:
-        proto_tree_add_text(atm_tree, 0, 0, "VC multiplexed traffic type: %s",
+        proto_tree_add_text(atm_tree, NullTVB, 0, 0, "VC multiplexed traffic type: %s",
                val_to_str(fd->pseudo_header.ngsniffer_atm.AppHLType,
                        vcmx_type_vals, "Unknown VCMX traffic type (%x)"));
         break;
 
       case ATT_HL_LANE:
-        proto_tree_add_text(atm_tree, 0, 0, "LANE traffic type: %s",
+        proto_tree_add_text(atm_tree, NullTVB, 0, 0, "LANE traffic type: %s",
                val_to_str(fd->pseudo_header.ngsniffer_atm.AppHLType,
                        lane_type_vals, "Unknown LANE traffic type (%x)"));
         break;
 
       case ATT_HL_IPSILON:
-        proto_tree_add_text(atm_tree, 0, 0, "Ipsilon traffic type: %s",
+        proto_tree_add_text(atm_tree, NullTVB, 0, 0, "Ipsilon traffic type: %s",
                val_to_str(fd->pseudo_header.ngsniffer_atm.AppHLType,
                        ipsilon_type_vals, "Unknown Ipsilon traffic type (%x)"));
         break;
       }
     }
-    proto_tree_add_item(atm_tree, hf_atm_vpi, 0, 0,
+    proto_tree_add_item(atm_tree, hf_atm_vpi, NullTVB, 0, 0,
                fd->pseudo_header.ngsniffer_atm.Vpi);
-    proto_tree_add_item(atm_tree, hf_atm_vci, 0, 0,
+    proto_tree_add_item(atm_tree, hf_atm_vci, NullTVB, 0, 0,
                fd->pseudo_header.ngsniffer_atm.Vci);
     switch (fd->pseudo_header.ngsniffer_atm.channel) {
 
     case 0:
       /* Traffic from DCE to DTE. */
-      proto_tree_add_text(atm_tree, 0, 0, "Channel: DCE->DTE");
+      proto_tree_add_text(atm_tree, NullTVB, 0, 0, "Channel: DCE->DTE");
       break;
 
     case 1:
       /* Traffic from DTE to DCE. */
-      proto_tree_add_text(atm_tree, 0, 0, "Channel: DTE->DCE");
+      proto_tree_add_text(atm_tree, NullTVB, 0, 0, "Channel: DTE->DCE");
       break;
 
     default:
       /* Sniffers shouldn't provide anything other than 0 or 1. */
-      proto_tree_add_text(atm_tree, 0, 0, "Channel: %u",
+      proto_tree_add_text(atm_tree, NullTVB, 0, 0, "Channel: %u",
                fd->pseudo_header.ngsniffer_atm.channel);
       break;
     }
@@ -686,14 +686,14 @@ dissect_atm(const u_char *pd, frame_data *fd, proto_tree *tree)
        * some other way of indicating whether we have the AAL5 trailer
        * information.
        */
-      proto_tree_add_text(atm_tree, 0, 0, "Cells: %u",
+      proto_tree_add_text(atm_tree, NullTVB, 0, 0, "Cells: %u",
                fd->pseudo_header.ngsniffer_atm.cells);
       if (aal_type == ATT_AAL5) {
-        proto_tree_add_text(atm_tree, 0, 0, "AAL5 U2U: %u",
+        proto_tree_add_text(atm_tree, NullTVB, 0, 0, "AAL5 U2U: %u",
                fd->pseudo_header.ngsniffer_atm.aal5t_u2u);
-        proto_tree_add_text(atm_tree, 0, 0, "AAL5 len: %u",
+        proto_tree_add_text(atm_tree, NullTVB, 0, 0, "AAL5 len: %u",
                fd->pseudo_header.ngsniffer_atm.aal5t_len);
-        proto_tree_add_text(atm_tree, 0, 0, "AAL5 checksum: 0x%08X",
+        proto_tree_add_text(atm_tree, NullTVB, 0, 0, "AAL5 checksum: 0x%08X",
                fd->pseudo_header.ngsniffer_atm.aal5t_chksum);
       }
     }
index 4f76cc8931a6e75ec2bfb1097e8cedc5219e9af7..91065a327f64bb9d6f905f95bf38627e484c0b69 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Heikki Vatiainen <hessu@cs.tut.fi>
  *
- * $Id: packet-auto_rp.c,v 1.4 2000/04/08 07:07:08 guy Exp $
+ * $Id: packet-auto_rp.c,v 1.5 2000/05/11 08:14:57 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -151,24 +151,24 @@ static void dissect_auto_rp(const u_char *pd, int offset, frame_data *fd, proto_
                         return;
                 }
 
-                ti = proto_tree_add_item(tree, proto_auto_rp, offset, END_OF_FRAME, NULL);
+                ti = proto_tree_add_item(tree, proto_auto_rp, NullTVB, offset, END_OF_FRAME, NULL);
                 auto_rp_tree = proto_item_add_subtree(ti, ett_auto_rp);
 
-                tv = proto_tree_add_uint_format(auto_rp_tree, hf_auto_rp_ver_type, offset, 1,
+                tv = proto_tree_add_uint_format(auto_rp_tree, hf_auto_rp_ver_type, NullTVB, offset, 1,
                                                 arh.ver_type, "Version: %s, Packet type: %s",
                                                 val_to_str(hi_nibble(arh.ver_type), auto_rp_ver_vals, "Unknown"),
                                                 val_to_str(lo_nibble(arh.ver_type), auto_rp_type_vals, "Unknown"));
                 ver_type_tree = proto_item_add_subtree(tv, ett_auto_rp_ver_type);
-                proto_tree_add_item(ver_type_tree, hf_auto_rp_version, offset, 1, arh.ver_type);
-                proto_tree_add_item(ver_type_tree, hf_auto_rp_type, offset, 1, arh.ver_type);
+                proto_tree_add_item(ver_type_tree, hf_auto_rp_version, NullTVB, offset, 1, arh.ver_type);
+                proto_tree_add_item(ver_type_tree, hf_auto_rp_type, NullTVB, offset, 1, arh.ver_type);
                 offset++;
 
-                proto_tree_add_text(auto_rp_tree, offset++, 1, "RP Count: %u", arh.rp_count);
-                proto_tree_add_text(auto_rp_tree, offset, 2, "Holdtime: %u second%s",
+                proto_tree_add_text(auto_rp_tree, NullTVB, offset++, 1, "RP Count: %u", arh.rp_count);
+                proto_tree_add_text(auto_rp_tree, NullTVB, offset, 2, "Holdtime: %u second%s",
                                     ntohs(arh.holdtime),
                                     plurality(ntohs(arh.holdtime), "", "s"));
                 offset+=2;
-                proto_tree_add_text(auto_rp_tree, offset, 4, "Reserved: 0x%x", arh.reserved);
+                proto_tree_add_text(auto_rp_tree, NullTVB, offset, 4, "Reserved: 0x%x", arh.reserved);
                 offset+=4;
 
                 for (i = 0; i < arh.rp_count; i++) {
@@ -262,17 +262,17 @@ static int do_auto_rp_map(const u_char *pd, int offset, frame_data *fd, proto_tr
                 return -1;
         memcpy(&m, pd+offset, sizeof(struct auto_rp_map_hdr));
 
-        ti = proto_tree_add_uint_format(auto_rp_tree, hf_auto_rp_map, offset,
+        ti = proto_tree_add_uint_format(auto_rp_tree, hf_auto_rp_map, NullTVB, offset,
                                         MIN(sizeof(m) + m.group_count*sizeof(g), END_OF_FRAME), 1,
                                         "RP %s: %u group%s", ip_to_str((void *)&m.rp_address),
                                         m.group_count, plurality(m.group_count, "", "s"));
         map_tree = proto_item_add_subtree(ti, ett_auto_rp_map);
-        proto_tree_add_text(map_tree, offset, 4, "Unicast IP address of this RP: %s (%s)",
+        proto_tree_add_text(map_tree, NullTVB, offset, 4, "Unicast IP address of this RP: %s (%s)",
                             ip_to_str((void *)&m.rp_address), get_hostname(m.rp_address));
         offset +=4;
-        proto_tree_add_item(map_tree, hf_auto_rp_pim_ver, offset, 1, pd[offset]);
+        proto_tree_add_item(map_tree, hf_auto_rp_pim_ver, NullTVB, offset, 1, pd[offset]);
         offset++;
-        proto_tree_add_text(map_tree, offset, 1, "Number of groups this RP maps to: %u", m.group_count);
+        proto_tree_add_text(map_tree, NullTVB, offset, 1, "Number of groups this RP maps to: %u", m.group_count);
         offset++;
 
         for (i = 0; i < m.group_count; i++) {
@@ -281,17 +281,17 @@ static int do_auto_rp_map(const u_char *pd, int offset, frame_data *fd, proto_tr
                 if (2*sizeof(guint8) + sizeof(guint32) > END_OF_FRAME) /* struct auto_rp_enc_grp_hdr */
                         return -1;
 
-                gi = proto_tree_add_uint_format(map_tree, hf_auto_rp_group, offset, 6, 1,
+                gi = proto_tree_add_uint_format(map_tree, hf_auto_rp_group, NullTVB, offset, 6, 1,
                                                 "group %s/%u (%s)", ip_to_str(pd + offset + 2),
                                                 pd[offset + 1],
                                                 val_to_str(pd[offset]&AUTO_RP_SIGN_MASK, auto_rp_mask_sign_vals, ""));
                 grp_tree = proto_item_add_subtree(gi, ett_auto_rp_group);
 
-                proto_tree_add_item(grp_tree, hf_auto_rp_mask_sgn, offset, 1, pd[offset]);
+                proto_tree_add_item(grp_tree, hf_auto_rp_mask_sgn, NullTVB, offset, 1, pd[offset]);
                 offset++;
-                proto_tree_add_text(grp_tree, offset, 1, "Group mask length: %u", pd[offset]);
+                proto_tree_add_text(grp_tree, NullTVB, offset, 1, "Group mask length: %u", pd[offset]);
                 offset++;
-                proto_tree_add_text(grp_tree, offset, 4, "Group prefix: %s", ip_to_str(pd + offset));
+                proto_tree_add_text(grp_tree, NullTVB, offset, 4, "Group prefix: %s", ip_to_str(pd + offset));
                 offset +=4;
          
         }
index 8117c18e029525e869e915ecc9b7f432364a707d..e7c6438afb176c159a489ba7fae52e3062c7eff5 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for BGP packet dissection.
  * Copyright 1999, Jun-ichiro itojun Hagino <itojun@itojun.org>
  *
- * $Id: packet-bgp.c,v 1.22 2000/04/11 14:21:36 itojun Exp $
+ * $Id: packet-bgp.c,v 1.23 2000/05/11 08:14:59 gram Exp $
  * 
  * Supports:
  * RFC1771 A Border Gateway Protocol 4 (BGP-4)
@@ -271,19 +271,19 @@ dissect_bgp_open(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
     memcpy(&bgpo, &pd[offset], sizeof(bgpo));
     hlen = ntohs(bgpo.bgpo_len);
 
-    proto_tree_add_text(tree,
+    proto_tree_add_text(tree, NullTVB,
        offset + offsetof(struct bgp_open, bgpo_version), 1,
        "Version: %u", bgpo.bgpo_version);
-    proto_tree_add_text(tree,
+    proto_tree_add_text(tree, NullTVB,
        offset + offsetof(struct bgp_open, bgpo_myas), 2,
        "My AS: %u", ntohs(bgpo.bgpo_myas));
-    proto_tree_add_text(tree,
+    proto_tree_add_text(tree, NullTVB,
        offset + offsetof(struct bgp_open, bgpo_holdtime), 2,
        "Hold time: %u", ntohs(bgpo.bgpo_holdtime));
-    proto_tree_add_text(tree,
+    proto_tree_add_text(tree, NullTVB,
        offset + offsetof(struct bgp_open, bgpo_id), 4,
        "BGP identifier: %s", ip_to_str((guint8 *)&bgpo.bgpo_id));
-    proto_tree_add_text(tree,
+    proto_tree_add_text(tree, NullTVB,
        offset + offsetof(struct bgp_open, bgpo_optlen), 1,
        "Optional parameters length: %u %s", bgpo.bgpo_optlen,
         (bgpo.bgpo_optlen == 1) ? "byte" : "bytes");
@@ -291,7 +291,7 @@ dissect_bgp_open(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
     if (hlen > sizeof(struct bgp_open)) {
        int openoff;
        openoff = ((char *)&bgpo.bgpo_optlen - (char *)&bgpo) + 1;
-       proto_tree_add_text(tree,
+       proto_tree_add_text(tree, NullTVB,
            offset + openoff, hlen - openoff,
            "Optional parameters");
     }
@@ -336,20 +336,20 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
 
     /* check for withdrawals */
     len = pntohs(p);
-    proto_tree_add_text(tree, p - pd, 2, 
+    proto_tree_add_text(tree, NullTVB, p - pd, 2, 
        "Unfeasible routes length: %u %s", len, (len == 1) ? "byte" : "bytes");
     p += 2;
 
     /* parse unfeasible prefixes */
     if (len > 0) {
-        ti = proto_tree_add_text(tree, p - pd, len, "Withdrawn routes:");
+        ti = proto_tree_add_text(tree, NullTVB, p - pd, len, "Withdrawn routes:");
        subtree = proto_item_add_subtree(ti, ett_bgp_unfeas);
 
         /* parse each prefixes */
         end = p + len;
         while (p < end) {
             i = decode_prefix4(p, junk_buf, sizeof(junk_buf));
-            proto_tree_add_text(subtree, p - pd, i, "%s", junk_buf);
+            proto_tree_add_text(subtree, NullTVB, p - pd, i, "%s", junk_buf);
             p += i;
         }
     }
@@ -359,12 +359,12 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
 
     /* check for advertisements */
     len = pntohs(p);
-    proto_tree_add_text(tree, p - pd, 2, "Total path attribute length: %u %s", 
+    proto_tree_add_text(tree, NullTVB, p - pd, 2, "Total path attribute length: %u %s", 
             len, (len == 1) ? "byte" : "bytes");
 
     /* path attributes */
     if (len > 0) {
-        ti = proto_tree_add_text(tree, p - pd + 2, len, "Path attributes");
+        ti = proto_tree_add_text(tree, NullTVB, p - pd + 2, len, "Path attributes");
        subtree = proto_item_add_subtree(ti, ett_bgp_attrs);
        i = 2;
        while (i < len) {
@@ -391,7 +391,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                if (alen != 1)
                    goto default_attribute_top;
                msg = val_to_str(p[i + aoff], bgpattr_origin, "Unknown");
-               ti = proto_tree_add_text(subtree, p - pd + i, alen + aoff,
+               ti = proto_tree_add_text(subtree, NullTVB, p - pd + i, alen + aoff,
                        "%s: %s (%u %s)",
                        val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                        msg, alen + aoff, (alen + aoff == 1) ? "byte" : 
@@ -451,7 +451,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                if (alen == 0)
                     strncpy(as_path_str, "empty", 6);
 
-               ti = proto_tree_add_text(subtree, p - pd + i, alen + aoff,
+               ti = proto_tree_add_text(subtree, NullTVB, p - pd + i, alen + aoff,
                         "%s: %s (%u %s)",
                         val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                         as_path_str, alen + aoff,
@@ -460,7 +460,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
            case BGPTYPE_NEXT_HOP:
                if (alen != 4)
                    goto default_attribute_top;
-               ti = proto_tree_add_text(subtree, p - pd + i, alen + aoff,
+               ti = proto_tree_add_text(subtree, NullTVB, p - pd + i, alen + aoff,
                        "%s: %s (%u %s)",
                        val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                        ip_to_str(&p[i + aoff]), alen + aoff, (alen + aoff == 1)
@@ -469,7 +469,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
            case BGPTYPE_MULTI_EXIT_DISC:
                if (alen != 4)
                    goto default_attribute_top;
-               ti = proto_tree_add_text(subtree, p - pd + i, alen + aoff,
+               ti = proto_tree_add_text(subtree, NullTVB, p - pd + i, alen + aoff,
                        "%s: %u (%u %s)",
                        val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                        pntohl(&p[i + aoff]), alen + aoff,
@@ -478,7 +478,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
            case BGPTYPE_LOCAL_PREF:
                if (alen != 4)
                    goto default_attribute_top;
-               ti = proto_tree_add_text(subtree, p - pd + i, alen + aoff,
+               ti = proto_tree_add_text(subtree, NullTVB, p - pd + i, alen + aoff,
                        "%s: %u (%u %s)",
                        val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                        pntohl(&p[i + aoff]), alen + aoff,
@@ -487,7 +487,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
             case BGPTYPE_ATOMIC_AGGREGATE:
                 if (alen != 0) 
                    goto default_attribute_top;
-               ti = proto_tree_add_text(subtree, p - pd + i, alen + aoff,
+               ti = proto_tree_add_text(subtree, NullTVB, p - pd + i, alen + aoff,
                        "%s (%u %s)",
                        val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                        alen + aoff, (alen + aoff == 1) ? "byte" : "bytes");
@@ -495,7 +495,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
            case BGPTYPE_AGGREGATOR:
                 if (alen != 6) 
                    goto default_attribute_top;
-               ti = proto_tree_add_text(subtree, p - pd + i, alen + aoff,
+               ti = proto_tree_add_text(subtree, NullTVB, p - pd + i, alen + aoff,
                        "%s: AS: %u origin: %s (%u %s)",
                        val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                        pntohs(&p[i + aoff]),
@@ -540,7 +540,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                 /* cleanup end of string */
                 communities_str[strlen(communities_str) - 1] = '\0';
 
-               ti = proto_tree_add_text(subtree, p - pd + i, alen + aoff,
+               ti = proto_tree_add_text(subtree, NullTVB, p - pd + i, alen + aoff,
                        "%s: %s (%u %s)",
                        val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                         communities_str, alen + aoff,
@@ -549,7 +549,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
            case BGPTYPE_ORIGINATOR_ID:
                if (alen != 4)
                    goto default_attribute_top;
-               ti = proto_tree_add_text(subtree, p - pd + i, alen + aoff,
+               ti = proto_tree_add_text(subtree, NullTVB, p - pd + i, alen + aoff,
                        "%s: %s (%u %s)",
                        val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                        ip_to_str(&p[i + aoff]), alen + aoff, (alen + aoff == 1)
@@ -581,7 +581,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                 /* cleanup end of string */
                 cluster_list_str[strlen(cluster_list_str) - 1] = '\0';
 
-               ti = proto_tree_add_text(subtree, p - pd + i, alen + aoff,
+               ti = proto_tree_add_text(subtree, NullTVB, p - pd + i, alen + aoff,
                        "%s: %s (%u %s)",
                        val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                         cluster_list_str, alen + aoff,
@@ -589,7 +589,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                break;
            default:
            default_attribute_top:
-               ti = proto_tree_add_text(subtree, p - pd + i, alen + aoff,
+               ti = proto_tree_add_text(subtree, NullTVB, p - pd + i, alen + aoff,
                        "%s (%u %s)",
                        val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                        alen + aoff, (alen + aoff == 1) ? "byte" : "bytes");
@@ -622,38 +622,38 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
             /* stomp last ", " */
             j = strlen(junk_buf);
             junk_buf[j - 2] = '\0';
-           ti = proto_tree_add_text(subtree2,
+           ti = proto_tree_add_text(subtree2, NullTVB,
                    p - pd + i + offsetof(struct bgp_attr, bgpa_flags), 1,
                    "Flags: 0x%02x (%s)", bgpa.bgpa_flags, junk_buf);
            subtree3 = proto_item_add_subtree(ti, ett_bgp_attr_flags);
 
             /* add flag bitfield subtrees */
-           proto_tree_add_text(subtree3,
+           proto_tree_add_text(subtree3, NullTVB,
                    p - pd + i + offsetof(struct bgp_attr, bgpa_flags), 1,
                    "%s", decode_boolean_bitfield(bgpa.bgpa_flags,
                        BGP_ATTR_FLAG_OPTIONAL, 8, "Optional", "Well-known"));
-           proto_tree_add_text(subtree3,
+           proto_tree_add_text(subtree3, NullTVB,
                    p - pd + i + offsetof(struct bgp_attr, bgpa_flags), 1,
                    "%s", decode_boolean_bitfield(bgpa.bgpa_flags,
                        BGP_ATTR_FLAG_TRANSITIVE, 8, "Transitive", 
                         "Non-transitive"));
-           proto_tree_add_text(subtree3,
+           proto_tree_add_text(subtree3, NullTVB,
                    p - pd + i + offsetof(struct bgp_attr, bgpa_flags), 1,
                    "%s", decode_boolean_bitfield(bgpa.bgpa_flags,
                        BGP_ATTR_FLAG_PARTIAL, 8, "Partial", "Complete"));
-           proto_tree_add_text(subtree3,
+           proto_tree_add_text(subtree3, NullTVB,
                    p - pd + i + offsetof(struct bgp_attr, bgpa_flags), 1,
                    "%s", decode_boolean_bitfield(bgpa.bgpa_flags,
                        BGP_ATTR_FLAG_EXTENDED_LENGTH, 8, "Extended length", 
                         "Regular length"));
 
-           proto_tree_add_text(subtree2,
+           proto_tree_add_text(subtree2, NullTVB,
                    p - pd + i + offsetof(struct bgp_attr, bgpa_type), 1,
                    "Type code: %s (%u)",
                    val_to_str(bgpa.bgpa_type, bgpattr_type, "Unknown"),
                    bgpa.bgpa_type);
             
-            proto_tree_add_text(subtree2, p - pd + i + sizeof(bgpa), 
+            proto_tree_add_text(subtree2, NullTVB, p - pd + i + sizeof(bgpa), 
                     aoff - sizeof(bgpa), "Length: %d %s", alen, 
                     (alen == 1) ? "byte" : "bytes");
 
@@ -662,12 +662,12 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
            switch (bgpa.bgpa_type) {
            case BGPTYPE_ORIGIN:
                if (alen != 1) {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                            "Origin (invalid): %u %s", alen,
                              (alen == 1) ? "byte" : "bytes");
                } else {
                    msg = val_to_str(p[i + aoff], bgpattr_origin, "Unknown");
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, 1,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, 1,
                            "Origin: %s (%u)", msg, p[i + aoff]);
                }
                break;
@@ -678,7 +678,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                     break;
                 }
 
-               ti = proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+               ti = proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                         "AS path: %s", as_path_str);
                as_paths_tree = proto_item_add_subtree(ti, ett_bgp_as_paths);
 
@@ -729,14 +729,14 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                     }
 
                     /* length here means number of ASs, ie length * 2 bytes */
-                   ti = proto_tree_add_text(as_paths_tree, 
+                   ti = proto_tree_add_text(as_paths_tree, NullTVB, 
                             q - pd - length * 2 - 2,
                             length * 2 + 2, "AS path segment: %s", as_path_str);
                    as_path_tree = proto_item_add_subtree(ti, ett_bgp_as_paths);
-                   proto_tree_add_text(as_path_tree, q - pd - length * 2 - 2,
+                   proto_tree_add_text(as_path_tree, NullTVB, q - pd - length * 2 - 2,
                             1, "Path segment type: %s (%u)",
                             val_to_str(type, as_segment_type, "Unknown"), type);
-                   proto_tree_add_text(as_path_tree, q - pd - length * 2 - 1, 
+                   proto_tree_add_text(as_path_tree, NullTVB, q - pd - length * 2 - 1, 
                             1, "Path segment length: %u %s", length,
                             (length == 1) ? "AS" : "ASs");
 
@@ -750,7 +750,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                     }
                     as_path_str[strlen(as_path_str) - 1] = '\0';
 
-                    proto_tree_add_text(as_path_tree, q - pd - length * 2, 
+                    proto_tree_add_text(as_path_tree, NullTVB, q - pd - length * 2, 
                             length * 2, "Path segment value: %s", as_path_str);
                 }
 
@@ -758,65 +758,65 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                break;
            case BGPTYPE_NEXT_HOP:
                if (alen != 4) {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                            "Next hop (invalid): %u %s", alen,
                             (alen == 1) ? "byte" : "bytes");
                } else {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                            "Next hop: %s", ip_to_str(&p[i + aoff]));
                }
                break;
            case BGPTYPE_MULTI_EXIT_DISC:
                if (alen != 4) {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                            "Multiple exit discriminator (invalid): %u %s",
                            alen, (alen == 1) ? "byte" : "bytes");
                } else {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                            "Multiple exit discriminator: %u",
                            pntohl(&p[i + aoff]));
                }
                break;
            case BGPTYPE_LOCAL_PREF:
                if (alen != 4) {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                            "Local preference (invalid): %u %s", alen,
                              (alen == 1) ? "byte" : "bytes");
                } else {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                            "Local preference: %u", pntohl(&p[i + aoff]));
                }
                break;
            case BGPTYPE_ATOMIC_AGGREGATE:
                if (alen != 0) {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                            "Atomic aggregate (invalid): %u %s", alen,
                             (alen == 1) ? "byte" : "bytes");    
                 }
                break;
            case BGPTYPE_AGGREGATOR:
                if (alen != 6) {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                            "Aggregator (invalid): %u %s", alen,
                             (alen == 1) ? "byte" : "bytes");
                } else {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, 2,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, 2,
                            "Aggregator AS: %u", pntohs(&p[i + aoff]));
-                   proto_tree_add_text(subtree2, p - pd + i + aoff + 2, 4,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff + 2, 4,
                            "Aggregator origin: %s",
                            ip_to_str(&p[i + aoff + 2]));
                }
                break;
             case BGPTYPE_COMMUNITIES:
                if (alen % 4 != 0) {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen, 
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen, 
                            "Communities (invalid): %u %s", alen,
                             (alen == 1) ? "byte" : "bytes");
                     free(communities_str);
                     break;
                 }
 
-                ti = proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                ti = proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                         "Communities: %s", communities_str);
                 communities_tree = proto_item_add_subtree(ti, 
                         ett_bgp_communities);
@@ -832,33 +832,33 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                    if (pntohs(q) == FOURHEX0 || pntohs(q) == FOURHEXF) {
                         /* check for well-known communities */
                        if (pntohl(q) == BGP_COMM_NO_EXPORT)
-                           proto_tree_add_text(communities_tree, 
+                           proto_tree_add_text(communities_tree, NullTVB, 
                                    q - pd - 3 + aoff, 4, 
                                    "Community: NO_EXPORT (0x%x)", pntohl(q));
                        else if (pntohl(q) == BGP_COMM_NO_ADVERTISE)
-                           proto_tree_add_text(communities_tree, 
+                           proto_tree_add_text(communities_tree, NullTVB, 
                                    q - pd - 3 + aoff, 4, 
                                    "Community: NO_ADVERTISE (0x%x)", pntohl(q));
                        else if (pntohl(q) == BGP_COMM_NO_EXPORT_SUBCONFED)
-                           proto_tree_add_text(communities_tree, 
+                           proto_tree_add_text(communities_tree, NullTVB, 
                                     q - pd - 3 + aoff, 4, 
                                     "Community: NO_EXPORT_SUBCONFED (0x%x)",
                                     pntohl(q));
                         else
-                           proto_tree_add_text(communities_tree, 
+                           proto_tree_add_text(communities_tree, NullTVB, 
                                     q - pd - 3 + aoff, 4, 
                                     "Community (reserved): 0x%x", pntohl(q));
                     }
                     else {
 
-                        ti = proto_tree_add_text(communities_tree,
+                        ti = proto_tree_add_text(communities_tree, NullTVB,
                                 q - pd - 3 + aoff, 4, "Community: %u:%u", 
                                 pntohs(q), pntohs(q + 2));
                         community_tree = proto_item_add_subtree(ti, 
                             ett_bgp_communities);
-                       proto_tree_add_text(community_tree, q - pd - 3 + aoff,
+                       proto_tree_add_text(community_tree, NullTVB, q - pd - 3 + aoff,
                                 2, "Community AS: %u", pntohs(q));
-                       proto_tree_add_text(community_tree, q - pd - 1 + aoff, 
+                       proto_tree_add_text(community_tree, NullTVB, q - pd - 1 + aoff, 
                                 2, "Community value: %u", pntohs(q + 2));
                     }
 
@@ -869,26 +869,26 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                break;
            case BGPTYPE_ORIGINATOR_ID:
                if (alen != 4) {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                            "Originator identifier (invalid): %u %s", alen,
                             (alen == 1) ? "byte" : "bytes");
                } else {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                            "Originator identifier: %s",
                             ip_to_str(&p[i + aoff]));
                }
                break;
            case BGPTYPE_MP_REACH_NLRI:
                af = pntohs(&p[i + aoff]);
-               proto_tree_add_text(subtree2, p - pd + i + aoff, 2,
+               proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, 2,
                    "Address family: %s (%u)",
                    val_to_str(af, afnumber, "Unknown"), af);
-               proto_tree_add_text(subtree2, p - pd + i + aoff + 2, 1,
+               proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff + 2, 1,
                    "Subsequent address family identifier: %s (%u)",
                    val_to_str(p[i + aoff + 2], bgpattr_nlri_safi,
                        p[i + aoff + 2] >= 128 ? "Vendor specific" : "Unknown"),
                    p[i + aoff + 2]);
-               ti = proto_tree_add_text(subtree2, p - pd + i + aoff + 3, 1,
+               ti = proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff + 3, 1,
                        "Next hop network address (%d %s)",
                        p[i + aoff + 3], (p[i + aoff + 3] == 1) ? "byte" : 
                         "bytes");
@@ -916,7 +916,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                            s = ip6_to_str((struct e_in6_addr *)
                                &p[i + aoff + 4 + j]);
                        }
-                       proto_tree_add_text(subtree3,
+                       proto_tree_add_text(subtree3, NullTVB,
                            p - pd + i + aoff + 4 + j, advance,
                            "Next hop: %s", s);
                        j += advance;
@@ -927,17 +927,17 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                aoff += (p[i + aoff + 3] + 4);
                off = 0;
                snpa = p[i + aoff];
-               ti = proto_tree_add_text(subtree2, p - pd + i + aoff, 1,
+               ti = proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, 1,
                        "Subnetwork points of attachment: %u", snpa);
                off++;
                if (snpa)
                    subtree3 = proto_item_add_subtree(ti, 
                             ett_bgp_mp_reach_nlri);
                for (/*nothing*/; snpa > 0; snpa--) {
-                   proto_tree_add_text(subtree3, p - pd + i + aoff + off, 1,
+                   proto_tree_add_text(subtree3, NullTVB, p - pd + i + aoff + off, 1,
                        "SNPA length: %u", p[i + aoff + off]);
                    off++;
-                   proto_tree_add_text(subtree3, p - pd + i + aoff + off,
+                   proto_tree_add_text(subtree3, NullTVB, p - pd + i + aoff + off,
                        p[i + aoff + off - 1],
                        "SNPA (%u %s)", p[i + aoff + off - 1],
                         (p[i + aoff + off - 1] == 1) ? "byte" : "bytes");
@@ -946,7 +946,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
 
                alen -= off;
                aoff += off;
-               ti = proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+               ti = proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                        "Network layer reachability information (%u %s)",
                        alen, (alen == 1) ? "byte" : "bytes");
                if (alen)
@@ -968,7 +968,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                        break;
                    if (alen < advance)
                        break;
-                   proto_tree_add_text(subtree3, p - pd + i + aoff, advance,
+                   proto_tree_add_text(subtree3, NullTVB, p - pd + i + aoff, advance,
                        "Network layer reachability information: %s", buf);
 
                    alen -= advance;
@@ -978,15 +978,15 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                break;
            case BGPTYPE_MP_UNREACH_NLRI:
                af = pntohs(&p[i + aoff]);      
-               proto_tree_add_text(subtree2, p - pd + i + aoff, 2,
+               proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, 2,
                    "Address family: %s (%u)",
                    val_to_str(af, afnumber, "Unknown"), af);
-               proto_tree_add_text(subtree2, p - pd + i + aoff + 2, 1,
+               proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff + 2, 1,
                    "Subsequent address family identifier: %s (%u)",
                    val_to_str(p[i + aoff + 2], bgpattr_nlri_safi,
                        p[i + aoff + 2] >= 128 ? "Vendor specific" : "Unknown"),
                    p[i + aoff + 2]);
-               ti = proto_tree_add_text(subtree2, p - pd + i + aoff + 3,
+               ti = proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff + 3,
                        alen - 3, "Withdrawn routes (%u %s)", alen - 3,
                         (alen - 3 == 1) ? "byte" : "bytes");
 
@@ -1011,7 +1011,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                        break;
                    if (alen < advance)
                        break;
-                   proto_tree_add_text(subtree3, p - pd + i + aoff, advance,
+                   proto_tree_add_text(subtree3, NullTVB, p - pd + i + aoff, advance,
                        "Withdrawn route: %s", buf);
 
                    alen -= advance;
@@ -1021,14 +1021,14 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                break;
            case BGPTYPE_CLUSTER_LIST:
                if (alen % 4 != 0) {
-                   proto_tree_add_text(subtree2, p - pd + i + aoff, alen, 
+                   proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen, 
                            "Cluster list (invalid): %u %s", alen,
                             (alen == 1) ? "byte" : "bytes");
                     free(cluster_list_str);
                     break;
                 }
 
-                ti = proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+                ti = proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                         "Cluster list: %s", cluster_list_str);
                 cluster_list_tree = proto_item_add_subtree(ti, 
                         ett_bgp_cluster_list);
@@ -1040,7 +1040,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
 
                 /* snarf each cluster identifier */
                 while (q < end) {
-                    ti = proto_tree_add_text(cluster_list_tree,
+                    ti = proto_tree_add_text(cluster_list_tree, NullTVB,
                             q - pd - 3 + aoff, 4, "Cluster identifier: %s", 
                             ip_to_str(q));
 
@@ -1050,7 +1050,7 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
                 free(cluster_list_str);
                break;
            default:
-               proto_tree_add_text(subtree2, p - pd + i + aoff, alen,
+               proto_tree_add_text(subtree2, NullTVB, p - pd + i + aoff, alen,
                        "Unknown (%d %s)", alen, (alen == 1) ? "byte" : 
                         "bytes");
                break;
@@ -1065,14 +1065,14 @@ dissect_bgp_update(const u_char *pd, int offset, frame_data *fd,
 
         /* parse prefixes */
         if (len > 0) {
-           ti = proto_tree_add_text(tree, p - pd, len,
+           ti = proto_tree_add_text(tree, NullTVB, p - pd, len,
                    "Network layer reachability information: %u %s", len,
                    (len == 1) ? "byte" : "bytes");
            subtree = proto_item_add_subtree(ti, ett_bgp_nlri);
             end = p + len;
             while (p < end) {
                 i = decode_prefix4(p, junk_buf, sizeof(junk_buf));
-                proto_tree_add_text(subtree, p - pd, i, "%s", junk_buf);
+                proto_tree_add_text(subtree, NullTVB, p - pd, i, "%s", junk_buf);
                 p += i;
             }
         }
@@ -1095,7 +1095,7 @@ dissect_bgp_notification(const u_char *pd, int offset, frame_data *fd,
     hlen = ntohs(bgpn.bgpn_len);
 
     /* print error code */
-    proto_tree_add_text(tree,
+    proto_tree_add_text(tree, NullTVB,
        offset + offsetof(struct bgp_notification, bgpn_major), 1,
        "Error code: %s (%u)",
        val_to_str(bgpn.bgpn_major, bgpnotify_major, "Unknown"),
@@ -1110,13 +1110,13 @@ dissect_bgp_notification(const u_char *pd, int offset, frame_data *fd,
        p = "Unspecified";
     else
         p = "Unknown";
-    proto_tree_add_text(tree,
+    proto_tree_add_text(tree, NullTVB,
        offset + offsetof(struct bgp_notification, bgpn_minor), 1,
        "Error subcode: %s (%u)", p, bgpn.bgpn_minor);
 
     /* only print if there is optional data */
     if (hlen > BGP_MIN_NOTIFICATION_MSG_SIZE) {
-        proto_tree_add_text(tree, offset + BGP_MIN_NOTIFICATION_MSG_SIZE,
+        proto_tree_add_text(tree, NullTVB, offset + BGP_MIN_NOTIFICATION_MSG_SIZE,
            hlen - BGP_MIN_NOTIFICATION_MSG_SIZE, "Data");
     }
 }
@@ -1179,7 +1179,7 @@ dissect_bgp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
     }
 
     if (tree) {
-       ti = proto_tree_add_text(tree, offset, END_OF_FRAME,
+       ti = proto_tree_add_text(tree, NullTVB, offset, END_OF_FRAME,
                    "Border Gateway Protocol");
        bgp_tree = proto_item_add_subtree(ti, ett_bgp);
 
@@ -1204,10 +1204,10 @@ dissect_bgp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
            hlen = ntohs(bgp.bgp_len);
            typ = val_to_str(bgp.bgp_type, bgptypevals, "Unknown Message");
            if (END_OF_FRAME < hlen) {
-               ti = proto_tree_add_text(bgp_tree, offset + i, END_OF_FRAME,
+               ti = proto_tree_add_text(bgp_tree, NullTVB, offset + i, END_OF_FRAME,
                            "%s (truncated)", typ);
            } else {
-               ti = proto_tree_add_text(bgp_tree, offset + i, hlen,
+               ti = proto_tree_add_text(bgp_tree, NullTVB, offset + i, hlen,
                            "%s", typ);
            }
            /* add a different tree for each message type */
@@ -1229,22 +1229,22 @@ dissect_bgp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                break;
            }
 
-           proto_tree_add_text(bgp1_tree, offset + i, BGP_MARKER_SIZE,
+           proto_tree_add_text(bgp1_tree, NullTVB, offset + i, BGP_MARKER_SIZE,
                "Marker: 16 bytes");
                            
            if (hlen < BGP_HEADER_SIZE || hlen > BGP_MAX_PACKET_SIZE) {
-               proto_tree_add_text(bgp1_tree,
+               proto_tree_add_text(bgp1_tree, NullTVB,
                    offset + i + offsetof(struct bgp, bgp_len), 2,
                    "Length (invalid): %u %s", hlen, 
                    (hlen == 1) ? "byte" : "bytes");
            } else {
-               proto_tree_add_text(bgp1_tree,
+               proto_tree_add_text(bgp1_tree, NullTVB,
                    offset + i + offsetof(struct bgp, bgp_len), 2,
                    "Length: %u %s", hlen, 
                    (hlen == 1) ? "byte" : "bytes");
            }
 
-           proto_tree_add_text(bgp1_tree,
+           proto_tree_add_text(bgp1_tree, NullTVB,
                offset + i + offsetof(struct bgp, bgp_type), 1,
                "Type: %s (%u)", typ, bgp.bgp_type);
 
index 502944291a9fe34c03a8b40815890777163b5834..bb0c6da5b5e24be0c4dfefe1d2a85563184672fb 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for BOOTP/DHCP packet disassembly
  * Gilbert Ramirez <gram@xiexie.org>
  *
- * $Id: packet-bootp.c,v 1.30 2000/04/08 07:07:10 guy Exp $
+ * $Id: packet-bootp.c,v 1.31 2000/05/11 08:15:00 gram Exp $
  *
  * The information used comes from:
  * RFC 2132: DHCP Options and BOOTP Vendor Extensions
@@ -222,7 +222,7 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                                }
                        }
                        i = i - voff;
-                       proto_tree_add_text(bp_tree, voff, i, "Padding");
+                       proto_tree_add_text(bp_tree, NullTVB, voff, i, "Padding");
                        consumed = i;
                        return consumed;
 
@@ -230,7 +230,7 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                case 21:
                        /* one IP address pair */
                        if (vlen == 8) {
-                               proto_tree_add_text(bp_tree, voff, consumed,
+                               proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                        "Option %d: %s = %s/%s", code, text,
                                        ip_to_str((guint8*)&pd[voff+2]),
                                        ip_to_str((guint8*)&pd[voff+6]));
@@ -238,11 +238,11 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                        /* > 1 IP address pair. Let's make a sub-tree */
                        else {
 
-                               vti = proto_tree_add_text(bp_tree, voff,
+                               vti = proto_tree_add_text(bp_tree, NullTVB, voff,
                                        consumed, "Option %d: %s", code, text);
                                v_tree = proto_item_add_subtree(vti, ett_bootp_option);
                                for (i = voff + 2; i < voff + consumed; i += 8) {
-                                       proto_tree_add_text(v_tree, i, 8, "IP Address/Mask: %s/%s",
+                                       proto_tree_add_text(v_tree, NullTVB, i, 8, "IP Address/Mask: %s/%s",
                                                ip_to_str((guint8*)&pd[i]),
                                                ip_to_str((guint8*)&pd[i+4]));
                                }
@@ -253,7 +253,7 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                case 33:
                        /* one IP address pair */
                        if (vlen == 8) {
-                               proto_tree_add_text(bp_tree, voff, consumed,
+                               proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                        "Option %d: %s = %s/%s", code, text,
                                        ip_to_str((guint8*)&pd[voff+2]),
                                        ip_to_str((guint8*)&pd[voff+6]));
@@ -261,11 +261,11 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                        /* > 1 IP address pair. Let's make a sub-tree */
                        else {
 
-                               vti = proto_tree_add_text(bp_tree, voff,
+                               vti = proto_tree_add_text(bp_tree, NullTVB, voff,
                                        consumed, "Option %d: %s", code, text);
                                v_tree = proto_item_add_subtree(vti, ett_bootp_option);
                                for (i = voff + 2; i < voff + consumed; i += 8) {
-                                       proto_tree_add_text(v_tree, i, 8,
+                                       proto_tree_add_text(v_tree, NullTVB, i, 8,
                                                "Destination IP Address/Router: %s/%s",
                                                ip_to_str((guint8*)&pd[i]),
                                                ip_to_str((guint8*)&pd[i+4]));
@@ -275,14 +275,14 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
 
                /* Vendor-Specific Info */
                case 43:
-                       proto_tree_add_text(bp_tree, voff, consumed,
+                       proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                        "Option %d: %s", code, text);
                        break;
 
                /* NetBIOS-over-TCP/IP Node Type */
                case 46:
                        byte = pd[voff+2];
-                       proto_tree_add_text(bp_tree, voff, consumed,
+                       proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                        "Option %d: %s = %s", code, text,
                                        val_to_str(byte, nbnt_vals,
                                            "Unknown (0x%02x)"));
@@ -297,23 +297,23 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                        else {
                                i = 0;
                        }
-                       proto_tree_add_text(bp_tree, voff, 3, "Option %d: %s = DHCP %s",
+                       proto_tree_add_text(bp_tree, NullTVB, voff, 3, "Option %d: %s = DHCP %s",
                                code, text, opt53_text[i]);
                        break;
 
                /* Parameter Request List */
                case 55:
-                       vti = proto_tree_add_text(bp_tree, voff,
+                       vti = proto_tree_add_text(bp_tree, NullTVB, voff,
                                vlen + 2, "Option %d: %s", code, text);
                        v_tree = proto_item_add_subtree(vti, ett_bootp_option);
                        for (i = 0; i < vlen; i++) {
                                byte = pd[voff+2+i];
                                if (byte < NUM_OPT_INFOS) {
-                                       proto_tree_add_text(v_tree, voff+2+i, 1, "%d = %s",
+                                       proto_tree_add_text(v_tree, NullTVB, voff+2+i, 1, "%d = %s",
                                                        byte, opt[byte].text);
                                }
                                else {
-                                       proto_tree_add_text(vti, voff+2+i, 1,
+                                       proto_tree_add_text(vti, NullTVB, voff+2+i, 1,
                                                "Unknown Option Code: %d", byte);
                                }
                        }
@@ -325,28 +325,28 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                                guess that the first is the hwtype, and the last 6 are
                                the hw addr */
                        if (vlen == 7) {
-                               vti = proto_tree_add_text(bp_tree, voff,
+                               vti = proto_tree_add_text(bp_tree, NullTVB, voff,
                                        consumed, "Option %d: %s", code, text);
                                v_tree = proto_item_add_subtree(vti, ett_bootp_option);
-                               proto_tree_add_text(v_tree, voff+2, 1,
+                               proto_tree_add_text(v_tree, NullTVB, voff+2, 1,
                                        "Hardware type: %s",
                                        arphrdtype_to_str(pd[voff+2],
                                                "Unknown (0x%02x)"));
-                               proto_tree_add_text(v_tree, voff+3, 6,
+                               proto_tree_add_text(v_tree, NullTVB, voff+3, 6,
                                        "Client hardware address: %s",
                                        arphrdaddr_to_str((guint8*)&pd[voff+3],
                                                6, pd[voff+2]));
                        }
                        /* otherwise, it's opaque data */
                        else {
-                               proto_tree_add_text(bp_tree, voff, consumed,
+                               proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                        "Option %d: %s (%d bytes)", code, text, vlen);
                        }
                        break;
 
                /* NetWare/IP options */
                case 63:
-                       vti = proto_tree_add_text(bp_tree, voff,
+                       vti = proto_tree_add_text(bp_tree, NullTVB, voff,
                        consumed, "Option %d: %s", code, text);
                        v_tree = proto_item_add_subtree(vti, ett_bootp_option);
 
@@ -354,28 +354,28 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                        optp=voff+2;
                        while ( optp < (voff+consumed) ) {
                                if (pd[optp] > NUM_O63_SUBOPTS) {
-                                               proto_tree_add_text(v_tree,optp,1,"Unknown suboption %d", pd[optp]);
+                                               proto_tree_add_text(v_tree, NullTVB,optp,1,"Unknown suboption %d", pd[optp]);
                                                optp++;
                                } else {
                        
                                switch (o63_opt[pd[optp]].ft) {
 
                                        case string:
-                                               proto_tree_add_text(v_tree, optp, 2, "Suboption %d: %s", pd[optp], o63_opt[pd[optp]].truet);
+                                               proto_tree_add_text(v_tree, NullTVB, optp, 2, "Suboption %d: %s", pd[optp], o63_opt[pd[optp]].truet);
                                                optp+=2;
                                                break;
 
                                        case yes_no:
                                                if (pd[optp+2]==1) {
-                                                       proto_tree_add_text(v_tree, optp, 3, "Suboption %d: %s", pd[optp], o63_opt[pd[optp]].truet);
+                                                       proto_tree_add_text(v_tree, NullTVB, optp, 3, "Suboption %d: %s", pd[optp], o63_opt[pd[optp]].truet);
                                                } else {
-                                                       proto_tree_add_text(v_tree, optp, 3, "Suboption %d: %s" , pd[optp], o63_opt[pd[optp]].falset);
+                                                       proto_tree_add_text(v_tree, NullTVB, optp, 3, "Suboption %d: %s" , pd[optp], o63_opt[pd[optp]].falset);
                                                }
                                                optp+=3;
                                                break;
 
                                        case special:   
-                                               proto_tree_add_text(v_tree, optp, 6,
+                                               proto_tree_add_text(v_tree, NullTVB, optp, 6,
                                                "Suboption %d: %s = %s" ,
                                                pd[optp], o63_opt[pd[optp]].truet,
                                                ip_to_str((guint8*)&pd[optp+2]));
@@ -383,14 +383,14 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                                                break;
 
                                        case val_u_short:
-                                               proto_tree_add_text(v_tree, optp, 3, "Suboption %d: %s = %d",pd[optp], o63_opt[pd[optp]].truet, pd[optp+2]);
+                                               proto_tree_add_text(v_tree, NullTVB, optp, 3, "Suboption %d: %s = %d",pd[optp], o63_opt[pd[optp]].truet, pd[optp+2]);
                                                optp+=3;
                                                break;
                                                        
                                        case ipv4:
                /* one IP address */
                if (pd[optp+1] == 4) {
-                       proto_tree_add_text(v_tree, optp, 6,
+                       proto_tree_add_text(v_tree, NullTVB, optp, 6,
                        "Suboption %d : %s = %s" ,
                        pd[optp], o63_opt[pd[optp]].truet,
                        ip_to_str((guint8*)&pd[optp+2]));
@@ -399,19 +399,19 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                /* > 1 IP addresses. Let's make a sub-tree */
                else {
 
-                       vti = proto_tree_add_text(v_tree, optp,
+                       vti = proto_tree_add_text(v_tree, NullTVB, optp,
                        pd[optp+1]+2, "Suboption %d: %s",
                        pd[optp], o63_opt[pd[optp]].truet);
                        o63_v_tree = proto_item_add_subtree(vti, ett_bootp_option);
                        for (slask = optp + 2 ; slask < optp+pd[optp+1]; slask += 4) {
-                               proto_tree_add_text(o63_v_tree, slask, 4, "IP Address: %s",
+                               proto_tree_add_text(o63_v_tree, NullTVB, slask, 4, "IP Address: %s",
                                ip_to_str((guint8*)&pd[slask]));
                        }
                        optp=slask;
                }
                break;
                                        default:
-                                               proto_tree_add_text(v_tree,optp,1,"Unknown suboption %d", pd[optp]);
+                                               proto_tree_add_text(v_tree, NullTVB,optp,1,"Unknown suboption %d", pd[optp]);
                                                optp++;
                                                break;
                                }
@@ -422,7 +422,7 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
 
                /* End Option */
                case 255:
-                       proto_tree_add_text(bp_tree, voff, 1, "End Option");
+                       proto_tree_add_text(bp_tree, NullTVB, voff, 1, "End Option");
                        consumed = 1;
                        return consumed;
 
@@ -443,18 +443,18 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                        case ipv4:
                                /* one IP address */
                                if (vlen == 4) {
-                                       proto_tree_add_text(bp_tree, voff, consumed,
+                                       proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                                "Option %d: %s = %s", code, text,
                                                ip_to_str((guint8*)&pd[voff+2]));
                                }
                                /* > 1 IP addresses. Let's make a sub-tree */
                                else {
 
-                                       vti = proto_tree_add_text(bp_tree, voff,
+                                       vti = proto_tree_add_text(bp_tree, NullTVB, voff,
                                                consumed, "Option %d: %s", code, text);
                                        v_tree = proto_item_add_subtree(vti, ett_bootp_option);
                                        for (i = voff + 2; i < voff + consumed; i += 4) {
-                                               proto_tree_add_text(v_tree, i, 4, "IP Address: %s",
+                                               proto_tree_add_text(v_tree, NullTVB, i, 4, "IP Address: %s",
                                                        ip_to_str((guint8*)&pd[i]));
                                        }
                                }
@@ -464,12 +464,12 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                                /* Fix for non null-terminated string supplied by
                                 * John Lines <John.Lines@aeat.co.uk>
                                 */
-                               proto_tree_add_text(bp_tree, voff, consumed,
+                               proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                                "Option %d: %s = %.*s", code, text, vlen, &pd[voff+2]);
                                break;
 
                        case opaque:
-                               proto_tree_add_text(bp_tree, voff, consumed,
+                               proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                                "Option %d: %s (%d bytes)",
                                                code, text, vlen);
                                break;
@@ -477,42 +477,42 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                        case val_u_short:
                                /* one IP address */
                                if (vlen == 2) {
-                                       proto_tree_add_text(bp_tree, voff, consumed,
+                                       proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                                        "Option %d: %s = %d", code, text,
                                                        pntohs(&pd[voff+2]));
                                }
                                /* > 1 u_short */
                                else {
-                                       vti = proto_tree_add_text(bp_tree, voff,
+                                       vti = proto_tree_add_text(bp_tree, NullTVB, voff,
                                                consumed, "Option %d: %s", code, text);
                                        v_tree = proto_item_add_subtree(vti, ett_bootp_option);
                                        for (i = voff + 2; i < voff + consumed; i += 2) {
-                                               proto_tree_add_text(v_tree, i, 4, "Value: %d",
+                                               proto_tree_add_text(v_tree, NullTVB, i, 4, "Value: %d",
                                                        pntohs(&pd[i]));
                                        }
                                }
                                break;
 
                        case val_u_long:
-                               proto_tree_add_text(bp_tree, voff, consumed,
+                               proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                                "Option %d: %s = %d", code, text,
                                                pntohl(&pd[voff+2]));
                                break;
 
                        case val_u_byte:
-                               proto_tree_add_text(bp_tree, voff, consumed,
+                               proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                                "Option %d: %s = %d", code, text, pd[voff+2]);
                                break;
 
                        case toggle:
                                i = pd[voff+2];
                                if (i != 0 && i != 1) {
-                                       proto_tree_add_text(bp_tree, voff, consumed,
+                                       proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                                        "Option %d: %s = Invalid Value %d", code, text,
                                                        pd[voff+2]);
                                }
                                else {
-                                       proto_tree_add_text(bp_tree, voff, consumed,
+                                       proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                                        "Option %d: %s = %s", code, text,
                                                        pd[voff+2] == 0 ? "Disabled" : "Enabled");
                                }
@@ -521,12 +521,12 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                        case yes_no:
                                i = pd[voff+2];
                                if (i != 0 && i != 1) {
-                                       proto_tree_add_text(bp_tree, voff, consumed,
+                                       proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                                        "Option %d: %s = Invalid Value %d", code, text,
                                                        pd[voff+2]);
                                }
                                else {
-                                       proto_tree_add_text(bp_tree, voff, consumed,
+                                       proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                                        "Option %d: %s = %s", code, text,
                                                        pd[voff+2] == 0 ? "No" : "Yes");
                                }
@@ -534,7 +534,7 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
 
                        case time_in_secs:
                                time_secs = pntohl(&pd[voff+2]);
-                               proto_tree_add_text(bp_tree, voff, consumed,
+                               proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                        "Option %d: %s = %s", code, text,
                                        ((time_secs == 0xffffffff) ?
                                            "infinity" :
@@ -542,12 +542,12 @@ bootp_option(const u_char *pd, proto_tree *bp_tree, int voff, int eoff)
                                break;
 
                        default:
-                               proto_tree_add_text(bp_tree, voff, consumed,
+                               proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                                "Option %d: %s (%d bytes)", code, text, vlen);
                }
        }
        else {
-               proto_tree_add_text(bp_tree, voff, consumed,
+               proto_tree_add_text(bp_tree, NullTVB, voff, consumed,
                                "Unknown Option Code: %d (%d bytes)", code, vlen);
        }
 
@@ -577,45 +577,45 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
        }
 
        if (tree) {
-               ti = proto_tree_add_item(tree, proto_bootp, offset, END_OF_FRAME, NULL);
+               ti = proto_tree_add_item(tree, proto_bootp, NullTVB, offset, END_OF_FRAME, NULL);
                bp_tree = proto_item_add_subtree(ti, ett_bootp);
 
-               proto_tree_add_uint_format(bp_tree, hf_bootp_type, 
+               proto_tree_add_uint_format(bp_tree, hf_bootp_type, NullTVB, 
                                           offset, 1,
                                           pd[offset], 
                                           pd[offset] == 1 ?
                                           "Boot Request" : "Boot Reply");
-               proto_tree_add_uint_format(bp_tree, hf_bootp_hw_type,
+               proto_tree_add_uint_format(bp_tree, hf_bootp_hw_type, NullTVB,
                                           offset + 1, 1,
                                           pd[offset+1],
                                           "Hardware type: %s",
                                           arphrdtype_to_str(pd[offset+1],
                                                             "Unknown (0x%02x)"));
-               proto_tree_add_item(bp_tree, hf_bootp_hw_len,
+               proto_tree_add_item(bp_tree, hf_bootp_hw_len, NullTVB,
                                    offset + 2, 1, pd[offset+2]);
-               proto_tree_add_item(bp_tree, hf_bootp_hops,
+               proto_tree_add_item(bp_tree, hf_bootp_hops, NullTVB,
                                    offset + 3, 1, pd[offset+3]);
-               proto_tree_add_item(bp_tree, hf_bootp_id,
+               proto_tree_add_item(bp_tree, hf_bootp_id, NullTVB,
                                   offset + 4, 4, pntohl(&pd[offset+4]));
-               proto_tree_add_item(bp_tree, hf_bootp_secs,
+               proto_tree_add_item(bp_tree, hf_bootp_secs, NullTVB,
                                    offset + 8, 2, pntohs(&pd[offset+8]));
-               proto_tree_add_item(bp_tree, hf_bootp_flag,
+               proto_tree_add_item(bp_tree, hf_bootp_flag, NullTVB,
                                    offset + 10, 2, pntohs(&pd[offset+10]) & 0x8000);
 
                memcpy(&ip_addr, &pd[offset+12], sizeof(ip_addr));
-               proto_tree_add_item(bp_tree, hf_bootp_ip_client, 
+               proto_tree_add_item(bp_tree, hf_bootp_ip_client, NullTVB, 
                                    offset + 12, 4, ip_addr);
                memcpy(&ip_addr, &pd[offset+16], sizeof(ip_addr));
-               proto_tree_add_item(bp_tree, hf_bootp_ip_your, 
+               proto_tree_add_item(bp_tree, hf_bootp_ip_your, NullTVB, 
                                    offset + 16, 4, ip_addr);
                memcpy(&ip_addr, &pd[offset+20], sizeof(ip_addr));
-               proto_tree_add_item(bp_tree, hf_bootp_ip_server,
+               proto_tree_add_item(bp_tree, hf_bootp_ip_server, NullTVB,
                                    offset + 20, 4, ip_addr);
                memcpy(&ip_addr, &pd[offset+24], sizeof(ip_addr));
-               proto_tree_add_item(bp_tree, hf_bootp_ip_relay,
+               proto_tree_add_item(bp_tree, hf_bootp_ip_relay, NullTVB,
                                    offset + 24, 4, ip_addr);
 
-               proto_tree_add_bytes_format(bp_tree, hf_bootp_hw_addr, 
+               proto_tree_add_bytes_format(bp_tree, hf_bootp_hw_addr, NullTVB, 
                                           offset + 28, pd[offset+2],
                                           &pd[offset+28],
                                           "Client hardware address: %s",
@@ -624,14 +624,14 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
 
                /* The server host name is optional */
                if (pd[offset+44]) {
-                       proto_tree_add_string_format(bp_tree, hf_bootp_server,
+                       proto_tree_add_string_format(bp_tree, hf_bootp_server, NullTVB,
                                                   offset + 44, 64,
                                                   &pd[offset+44],
                                                   "Server host name: %s",
                                                   &pd[offset+44]);
                }
                else {
-                       proto_tree_add_string_format(bp_tree, hf_bootp_server,
+                       proto_tree_add_string_format(bp_tree, hf_bootp_server, NullTVB,
                                                   offset + 44, 64,
                                                   &pd[offset+44],
                                                   "Server host name not given");
@@ -639,28 +639,28 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
 
                /* Boot file */
                if (pd[offset+108]) {
-                       proto_tree_add_string_format(bp_tree, hf_bootp_file,
+                       proto_tree_add_string_format(bp_tree, hf_bootp_file, NullTVB,
                                                   offset + 108, 128,
                                                   &pd[offset+108],
                                                   "Boot file name: %s",
                                                   &pd[offset+108]);
                }
                else {
-                       proto_tree_add_string_format(bp_tree, hf_bootp_file,
+                       proto_tree_add_string_format(bp_tree, hf_bootp_file, NullTVB,
                                                   offset + 108, 128,
                                                   &pd[offset+108],
                                                   "Boot file name not given");
                }
 
                if (pntohl(&pd[offset+236]) == 0x63825363) {
-                       proto_tree_add_ipv4_format(bp_tree, hf_bootp_cookie,
+                       proto_tree_add_ipv4_format(bp_tree, hf_bootp_cookie, NullTVB,
                                                   offset + 236, 4,
                                                   pd[offset+236],
                                                   "Magic cookie: (OK)");
                }
                else {
                        memcpy(&ip_addr, &pd[offset + 236], sizeof(ip_addr));
-                       proto_tree_add_item(bp_tree, hf_bootp_cookie,
+                       proto_tree_add_item(bp_tree, hf_bootp_cookie, NullTVB,
                                            offset + 236, 4, ip_addr);
                }
 
index fa5a0af688556d83e81a6686a912c55f24f254c5..d644f05cad9af948f1c0ecb4bb68f9dd865bba97 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-bootparams.c
  * Routines for bootparams dissection
  *
- * $Id: packet-bootparams.c,v 1.9 2000/04/04 06:46:24 guy Exp $
+ * $Id: packet-bootparams.c,v 1.10 2000/05/11 08:15:03 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -62,7 +62,7 @@ int dissect_bp_address(const u_char *pd, int offset, frame_data *fd,
        if ( !BYTES_ARE_IN_FRAME(offset, 1)) return offset;
        type = pntohl(&pd[offset]); /* type of address */
 #if 0
-       proto_tree_add_item(tree, hf_bootparams_addresstype,
+       proto_tree_add_item(tree, hf_bootparams_addresstype, NullTVB,
                offset, 4, type);
 #endif
        offset += 4;
@@ -76,7 +76,7 @@ int dissect_bp_address(const u_char *pd, int offset, frame_data *fd,
        if ( ! BYTES_ARE_IN_FRAME(offset, 16)) return offset;
        ipaddr = (pd[offset+3]<<24) + (pd[offset+7]<<16) +
                (pd[offset+11]<<8) + (pd[offset+15]);
-       proto_tree_add_item(tree, hfindex, 
+       proto_tree_add_item(tree, hfindex, NullTVB, 
                offset, 16, ntohl(ipaddr));
        offset += 16;
 
index b2da00a98858ca35bfb929f4eaca31eb5061271e..d72220c1597a5183a2536b57f1d26aa37957e095 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-bpdu.c
  * Routines for BPDU (Spanning Tree Protocol) disassembly
  *
- * $Id: packet-bpdu.c,v 1.9 2000/04/17 00:32:37 guy Exp $
+ * $Id: packet-bpdu.c,v 1.10 2000/05/11 08:15:03 gram Exp $
  *
  * Copyright 1999 Christophe Tronche <ch.tronche@computer.org>
  * 
@@ -121,10 +121,10 @@ void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree
            protocol_identifier = pntohs(bpdu + BPDU_IDENTIFIER);
            protocol_version_identifier = (guint8) bpdu[BPDU_VERSION_IDENTIFIER];
 
-           ti = proto_tree_add_protocol_format(tree, proto_bpdu, offset, 35,
+           ti = proto_tree_add_protocol_format(tree, proto_bpdu, NullTVB, offset, 35,
                                "Spanning Tree Protocol");
            bpdu_tree = proto_item_add_subtree(ti, ett_bpdu);
-           proto_tree_add_uint_format(bpdu_tree, hf_bpdu_proto_id,
+           proto_tree_add_uint_format(bpdu_tree, hf_bpdu_proto_id, NullTVB,
                                       offset + BPDU_IDENTIFIER, 2, 
                                       protocol_identifier,
                                       "Protocol Identifier: 0x%04x (%s)", 
@@ -132,12 +132,12 @@ void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree
                                       protocol_identifier == 0 ? 
                                       "Spanning Tree" : "Unknown Protocol");
 
-           proto_tree_add_item(bpdu_tree, hf_bpdu_version_id, 
+           proto_tree_add_item(bpdu_tree, hf_bpdu_version_id, NullTVB, 
                                offset + BPDU_VERSION_IDENTIFIER, 1, 
                                protocol_version_identifier);
            if (protocol_version_identifier != 0)
-                 proto_tree_add_text(bpdu_tree, offset + BPDU_VERSION_IDENTIFIER, 1, "   (Warning: this version of packet-bpdu only knows about version = 0)");
-           proto_tree_add_uint_format(bpdu_tree, hf_bpdu_type,
+                 proto_tree_add_text(bpdu_tree, NullTVB, offset + BPDU_VERSION_IDENTIFIER, 1, "   (Warning: this version of packet-bpdu only knows about version = 0)");
+           proto_tree_add_uint_format(bpdu_tree, hf_bpdu_type, NullTVB,
                                       offset + BPDU_TYPE, 1, 
                                       bpdu_type,
                                       "BPDU Type: 0x%02x (%s)", 
@@ -157,45 +157,45 @@ void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree
            hello_time = pntohs(bpdu + BPDU_HELLO_TIME) / 256.0;
            forward_delay = pntohs(bpdu + BPDU_FORWARD_DELAY) / 256.0;
 
-           proto_tree_add_item(bpdu_tree, hf_bpdu_flags, 
+           proto_tree_add_item(bpdu_tree, hf_bpdu_flags, NullTVB, 
                                offset + BPDU_FLAGS, 1, flags);
            if (flags & 0x80)
-                 proto_tree_add_text(bpdu_tree, offset + BPDU_FLAGS, 1, "   1... ....  Topology Change Acknowledgment");
+                 proto_tree_add_text(bpdu_tree, NullTVB, offset + BPDU_FLAGS, 1, "   1... ....  Topology Change Acknowledgment");
            if (flags & 0x01)
-                 proto_tree_add_text(bpdu_tree, offset + BPDU_FLAGS, 1, "   .... ...1  Topology Change");
+                 proto_tree_add_text(bpdu_tree, NullTVB, offset + BPDU_FLAGS, 1, "   .... ...1  Topology Change");
 
-           proto_tree_add_item_hidden(bpdu_tree, hf_bpdu_root_mac,
+           proto_tree_add_item_hidden(bpdu_tree, hf_bpdu_root_mac, NullTVB,
                                       offset + BPDU_ROOT_IDENTIFIER + 2, 6,
                                       bpdu + BPDU_ROOT_IDENTIFIER + 2);
-           proto_tree_add_text(bpdu_tree, 
+           proto_tree_add_text(bpdu_tree, NullTVB, 
                                offset + BPDU_ROOT_IDENTIFIER, 8, 
                                "Root Identifier: %d / %s", 
                                root_identifier_bridge_priority, 
                                root_identifier_mac);
-           proto_tree_add_item(bpdu_tree, hf_bpdu_root_cost, 
+           proto_tree_add_item(bpdu_tree, hf_bpdu_root_cost, NullTVB, 
                                offset + BPDU_ROOT_PATH_COST, 4, 
                                root_path_cost);
-           proto_tree_add_text(bpdu_tree, 
+           proto_tree_add_text(bpdu_tree, NullTVB, 
                                offset + BPDU_BRIDGE_IDENTIFIER, 8, 
                                "Bridge Identifier: %d / %s", 
                                bridge_identifier_bridge_priority, 
                                bridge_identifier_mac);
-           proto_tree_add_item_hidden(bpdu_tree, hf_bpdu_bridge_mac,
+           proto_tree_add_item_hidden(bpdu_tree, hf_bpdu_bridge_mac, NullTVB,
                                       offset + BPDU_BRIDGE_IDENTIFIER + 2, 6,
                                       bpdu + BPDU_BRIDGE_IDENTIFIER + 2);
-           proto_tree_add_item(bpdu_tree, hf_bpdu_port_id,
+           proto_tree_add_item(bpdu_tree, hf_bpdu_port_id, NullTVB,
                                offset + BPDU_PORT_IDENTIFIER, 2, 
                                port_identifier);
-           proto_tree_add_item(bpdu_tree, hf_bpdu_msg_age,
+           proto_tree_add_item(bpdu_tree, hf_bpdu_msg_age, NullTVB,
                                offset + BPDU_MESSAGE_AGE, 2, 
                                message_age);
-           proto_tree_add_item(bpdu_tree, hf_bpdu_max_age,
+           proto_tree_add_item(bpdu_tree, hf_bpdu_max_age, NullTVB,
                                offset + BPDU_MAX_AGE, 2, 
                                max_age);
-           proto_tree_add_item(bpdu_tree, hf_bpdu_hello_time,
+           proto_tree_add_item(bpdu_tree, hf_bpdu_hello_time, NullTVB,
                                offset + BPDU_HELLO_TIME, 2, 
                                hello_time);
-           proto_tree_add_item(bpdu_tree, hf_bpdu_forward_delay,
+           proto_tree_add_item(bpdu_tree, hf_bpdu_forward_delay, NullTVB,
                                offset + BPDU_FORWARD_DELAY, 2, 
                                forward_delay);
       }
index 78adaa24fa7f2cb06427af31e142d69e93fc9987..551826fe4fff15812074836e8ed7f988fff7bacb 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for the disassembly of the "Cisco Discovery Protocol"
  * (c) Copyright Hannes R. Boehm <hannes@boehm.org>
  *
- * $Id: packet-cdp.c,v 1.21 2000/03/12 04:47:36 gram Exp $
+ * $Id: packet-cdp.c,v 1.22 2000/05/11 08:15:04 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -107,17 +107,17 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
         col_add_str(fd, COL_INFO, "Cisco Discovery Protocol"); 
 
     if(tree){
-        ti = proto_tree_add_item(tree, proto_cdp, offset, END_OF_FRAME, NULL);
+        ti = proto_tree_add_item(tree, proto_cdp, NullTVB, offset, END_OF_FRAME, NULL);
        cdp_tree = proto_item_add_subtree(ti, ett_cdp);
        
        /* CDP header */
-       proto_tree_add_item(cdp_tree, hf_cdp_version, offset, 1, pd[offset]);
+       proto_tree_add_item(cdp_tree, hf_cdp_version, NullTVB, offset, 1, pd[offset]);
        offset += 1;
-       proto_tree_add_uint_format(cdp_tree, hf_cdp_ttl, offset, 1,
+       proto_tree_add_uint_format(cdp_tree, hf_cdp_ttl, NullTVB, offset, 1,
                                   pntohs(&pd[offset]),
                                   "TTL: %u seconds", pd[offset]);
        offset += 1;
-       proto_tree_add_uint_format(cdp_tree, hf_cdp_flags, offset, 2,
+       proto_tree_add_uint_format(cdp_tree, hf_cdp_flags, NullTVB, offset, 2,
                                   pd[offset], 
                                   "Checksum: 0x%04x", pntohs(&pd[offset]));
        offset += 2;
@@ -131,34 +131,34 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                switch( type ){
                        case TYPE_DEVICE_ID:
                                /* Device ID */
-                               tlvi = proto_tree_add_text(cdp_tree, offset,
+                               tlvi = proto_tree_add_text(cdp_tree, NullTVB, offset,
                                    length, "Device ID: %s",
                                    &pd[offset+4]);
                                tlv_tree = proto_item_add_subtree(tlvi,
                                    ett_cdp_tlv);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB,
                                    offset + TLV_TYPE, 2, type);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB,
                                    offset + TLV_LENGTH, 2, length);
-                               proto_tree_add_text(tlv_tree, offset + 4,
+                               proto_tree_add_text(tlv_tree, NullTVB, offset + 4,
                                    length - 4, "Device ID: %s",
                                    &pd[offset+4]);
                                offset+=length;
                                break;
                        case TYPE_ADDRESS:
                                /* Addresses */
-                               tlvi = proto_tree_add_text(cdp_tree, offset,
+                               tlvi = proto_tree_add_text(cdp_tree, NullTVB, offset,
                                    length, "Addresses");
                                tlv_tree = proto_item_add_subtree(tlvi,
                                    ett_cdp_tlv);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB,
                                    offset + TLV_TYPE, 2, type);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB,
                                    offset + TLV_LENGTH, 2, length);
                                offset += 4;
                                length -= 4;
                                naddresses = pntohl(&pd[offset]);
-                               proto_tree_add_text(tlv_tree, offset, 4,
+                               proto_tree_add_text(tlv_tree, NullTVB, offset, 4,
                                    "Number of addresses: %u", naddresses);
                                offset += 4;
                                length -= 4;
@@ -189,29 +189,29 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                                       capture work. */
                                    real_length = length + 3;
                                }
-                               tlvi = proto_tree_add_text(cdp_tree, offset,
+                               tlvi = proto_tree_add_text(cdp_tree, NullTVB, offset,
                                    real_length, "Port ID: %s",
                                    &pd[offset+4]);
                                tlv_tree = proto_item_add_subtree(tlvi,
                                    ett_cdp_tlv);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB,
                                    offset + TLV_TYPE, 2, type);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB,
                                    offset + TLV_LENGTH, 2, length);
-                               proto_tree_add_text(tlv_tree, offset + 4,
+                               proto_tree_add_text(tlv_tree, NullTVB, offset + 4,
                                    real_length - 4,
                                    "Sent through Interface: %s",
                                    &pd[offset+4]);
                                offset += real_length;
                                break;
                        case TYPE_CAPABILITIES:
-                               tlvi = proto_tree_add_text(cdp_tree, offset,
+                               tlvi = proto_tree_add_text(cdp_tree, NullTVB, offset,
                                    length, "Capabilities");
                                tlv_tree = proto_item_add_subtree(tlvi,
                                    ett_cdp_tlv);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB,
                                    offset + TLV_TYPE, 2, type);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB,
                                    offset + TLV_LENGTH, 2, length);
                                offset += 4;
                                length -= 4;
@@ -220,13 +220,13 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                                offset += length;
                                break;
                        case TYPE_IOS_VERSION:
-                               tlvi = proto_tree_add_text(cdp_tree, offset,
+                               tlvi = proto_tree_add_text(cdp_tree, NullTVB, offset,
                                    length, "Software Version");
                                tlv_tree = proto_item_add_subtree(tlvi,
                                    ett_cdp_tlv);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB,
                                    offset + TLV_TYPE, 2, type);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB,
                                    offset + TLV_LENGTH, 2, length);
                                add_multi_line_string_to_tree(tlv_tree,
                                    offset + 4, length - 4, "Software Version: ",
@@ -238,32 +238,32 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                                stringmem = malloc(length);
                                memset(stringmem, '\0', length);
                                memcpy(stringmem, &pd[offset+4], length - 4 );
-                               tlvi = proto_tree_add_text(cdp_tree,
+                               tlvi = proto_tree_add_text(cdp_tree, NullTVB,
                                    offset, length, "Platform: %s",
                                    stringmem);
                                tlv_tree = proto_item_add_subtree(tlvi,
                                    ett_cdp_tlv);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB,
                                    offset + TLV_TYPE, 2, type);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB,
                                    offset + TLV_LENGTH, 2, length);
-                               proto_tree_add_text(tlv_tree, offset + 4,
+                               proto_tree_add_text(tlv_tree, NullTVB, offset + 4,
                                    length - 4, "Platform: %s", stringmem);
                                free(stringmem);
                                offset+=length;
                                break;
                        default:
-                               tlvi = proto_tree_add_text(cdp_tree, offset,
+                               tlvi = proto_tree_add_text(cdp_tree, NullTVB, offset,
                                    length, "Type: %s, length: %u",
                                    type_str, length);
                                tlv_tree = proto_item_add_subtree(tlvi,
                                    ett_cdp_tlv);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, NullTVB,
                                    offset + TLV_TYPE, 2, type);
-                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength,
+                               proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, NullTVB,
                                    offset + TLV_LENGTH, 2, length);
                                if (length > 4) {
-                                       proto_tree_add_text(tlv_tree,
+                                       proto_tree_add_text(tlv_tree, NullTVB,
                                            offset + 4, length - 4, "Data");
                                } else
                                        return;
@@ -298,10 +298,10 @@ dissect_address_tlv(const u_char *pd, int offset, int length, proto_tree *tree)
 
     if (length < 1)
         return -1;
-    ti = proto_tree_add_notext(tree, offset, length);
+    ti = proto_tree_add_notext(tree, NullTVB, offset, length);
     address_tree = proto_item_add_subtree(ti, ett_cdp_address);
     protocol_type = pd[offset];
-    proto_tree_add_text(address_tree, offset, 1, "Protocol type: %s",
+    proto_tree_add_text(address_tree, NullTVB, offset, 1, "Protocol type: %s",
        val_to_str(protocol_type, proto_type_vals, "Unknown (0x%02x)"));
     offset += 1;
     length -= 1;
@@ -311,7 +311,7 @@ dissect_address_tlv(const u_char *pd, int offset, int length, proto_tree *tree)
        return -1;
     }
     protocol_length = pd[offset];
-    proto_tree_add_text(address_tree, offset, 1, "Protocol length: %u",
+    proto_tree_add_text(address_tree, NullTVB, offset, 1, "Protocol length: %u",
                        protocol_length);
     offset += 1;
     length -= 1;
@@ -319,7 +319,7 @@ dissect_address_tlv(const u_char *pd, int offset, int length, proto_tree *tree)
     if (length < protocol_length) {
         proto_item_set_text(ti, "Truncated address");
         if (length != 0) {
-            proto_tree_add_text(address_tree, offset, length,
+            proto_tree_add_text(address_tree, NullTVB, offset, length,
               "Protocol: %s (truncated)", bytes_to_str(&pd[offset], length));
         }
        return -1;
@@ -332,7 +332,7 @@ dissect_address_tlv(const u_char *pd, int offset, int length, proto_tree *tree)
         nlpid = -1;
     if (protocol_str == NULL)
         protocol_str = bytes_to_str(&pd[offset], protocol_length);
-    proto_tree_add_text(address_tree, offset, protocol_length,
+    proto_tree_add_text(address_tree, NullTVB, offset, protocol_length,
                        "Protocol: %s", protocol_str);
     offset += protocol_length;
     length -= protocol_length;
@@ -342,7 +342,7 @@ dissect_address_tlv(const u_char *pd, int offset, int length, proto_tree *tree)
        return -1;
     }
     address_length = pntohs(&pd[offset]);
-    proto_tree_add_text(address_tree, offset, 2, "Address length: %u",
+    proto_tree_add_text(address_tree, NullTVB, offset, 2, "Address length: %u",
                        address_length);
     offset += 2;
     length -= 2;
@@ -350,7 +350,7 @@ dissect_address_tlv(const u_char *pd, int offset, int length, proto_tree *tree)
     if (length < address_length) {
         proto_item_set_text(ti, "Truncated address");
         if (length != 0) {
-            proto_tree_add_text(address_tree, offset, length,
+            proto_tree_add_text(address_tree, NullTVB, offset, length,
               "Address: %s (truncated)", bytes_to_str(&pd[offset], length));
         }
        return -1;
@@ -381,7 +381,7 @@ dissect_address_tlv(const u_char *pd, int offset, int length, proto_tree *tree)
         address_str = bytes_to_str(&pd[offset], address_length);
     }
     proto_item_set_text(ti, "%s: %s", address_type_str, address_str);
-    proto_tree_add_text(address_tree, offset, address_length, "%s: %s",
+    proto_tree_add_text(address_tree, NullTVB, offset, address_length, "%s: %s",
       address_type_str, address_str);
     return 2 + protocol_length + 2 + address_length;
 }
@@ -396,34 +396,34 @@ dissect_capabilities(const u_char *pd, int offset, int length, proto_tree *tree)
     if (length < 4)
         return;
     capabilities = pntohl(&pd[offset]);
-    ti = proto_tree_add_text(tree, offset, length, "Capabilities: 0x%08x",
+    ti = proto_tree_add_text(tree, NullTVB, offset, length, "Capabilities: 0x%08x",
         capabilities);
     capabilities_tree = proto_item_add_subtree(ti, ett_cdp_capabilities);
-    proto_tree_add_text(capabilities_tree, offset, 4,
+    proto_tree_add_text(capabilities_tree, NullTVB, offset, 4,
        decode_boolean_bitfield(capabilities, 0x01, 4*8,
            "Performs level 3 routing",
            "Doesn't perform level 3 routing"));
-    proto_tree_add_text(capabilities_tree, offset, 4,
+    proto_tree_add_text(capabilities_tree, NullTVB, offset, 4,
        decode_boolean_bitfield(capabilities, 0x02, 4*8,
            "Performs level 2 transparent bridging",
            "Doesn't perform level 2 transparent bridging"));
-    proto_tree_add_text(capabilities_tree, offset, 4,
+    proto_tree_add_text(capabilities_tree, NullTVB, offset, 4,
        decode_boolean_bitfield(capabilities, 0x04, 4*8,
            "Performs level 2 source-route bridging",
            "Doesn't perform level 2 source-route bridging"));
-    proto_tree_add_text(capabilities_tree, offset, 4,
+    proto_tree_add_text(capabilities_tree, NullTVB, offset, 4,
        decode_boolean_bitfield(capabilities, 0x08, 4*8,
            "Performs level 2 switching",
            "Doesn't perform level 2 switching"));
-    proto_tree_add_text(capabilities_tree, offset, 4,
+    proto_tree_add_text(capabilities_tree, NullTVB, offset, 4,
        decode_boolean_bitfield(capabilities, 0x10, 4*8,
            "Sends and receives packets for network-layer protocols",
            "Doesn't send or receive packets for network-layer protocols"));
-    proto_tree_add_text(capabilities_tree, offset, 4,
+    proto_tree_add_text(capabilities_tree, NullTVB, offset, 4,
        decode_boolean_bitfield(capabilities, 0x20, 4*8,
            "Doesn't forward IGMP Report packets on nonrouter ports",
            "Forwards IGMP Report packets on nonrouter ports"));
-    proto_tree_add_text(capabilities_tree, offset, 4,
+    proto_tree_add_text(capabilities_tree, NullTVB, offset, 4,
        decode_boolean_bitfield(capabilities, 0x40, 4*8,
            "Provides level 1 functionality",
            "Doesn't provide level 1 functionality"));
@@ -456,7 +456,7 @@ add_multi_line_string_to_tree(proto_tree *tree, gint start, gint len,
            line_len = strlen(p);
            data_len = line_len;
        }
-       proto_tree_add_text(tree, start, data_len, "%s%.*s", prefix,
+       proto_tree_add_text(tree, NullTVB, start, data_len, "%s%.*s", prefix,
           line_len, p);
        if (q == NULL)
            break;
index f07a6908fdac7dc8d1c052b3e32f8a8f27133c34..9155aeb6822a9f25f538722242f9b7cabe3dfda9 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-cgmp.c
  * Routines for the disassembly of the Cisco Group Management Protocol
  *
- * $Id: packet-cgmp.c,v 1.1 2000/02/05 05:54:15 guy Exp $
+ * $Id: packet-cgmp.c,v 1.2 2000/05/11 08:15:04 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -71,32 +71,32 @@ dissect_cgmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                col_add_str(fd, COL_INFO, "Cisco Group Management Protocol"); 
 
        if (tree) {
-               ti = proto_tree_add_item(tree, proto_cgmp, offset, END_OF_FRAME, NULL);
+               ti = proto_tree_add_item(tree, proto_cgmp, NullTVB, offset, END_OF_FRAME, NULL);
                cgmp_tree = proto_item_add_subtree(ti, ett_cgmp);
        
-               proto_tree_add_item(cgmp_tree, hf_cgmp_version, offset, 1,
+               proto_tree_add_item(cgmp_tree, hf_cgmp_version, NullTVB, offset, 1,
                    pd[offset]);
-               proto_tree_add_item(cgmp_tree, hf_cgmp_type, offset, 1,
+               proto_tree_add_item(cgmp_tree, hf_cgmp_type, NullTVB, offset, 1,
                    pd[offset]);
                offset += 1;
 
                offset += 2;    /* skip reserved field */
 
                count = pd[offset];
-               proto_tree_add_item(cgmp_tree, hf_cgmp_count, offset, 1,
+               proto_tree_add_item(cgmp_tree, hf_cgmp_count, NullTVB, offset, 1,
                    count);
                offset += 1;
 
                while (count != 0) {
                        if (!BYTES_ARE_IN_FRAME(offset, 6))
                                break;
-                       proto_tree_add_item(cgmp_tree, hf_cgmp_gda, offset, 6,
+                       proto_tree_add_item(cgmp_tree, hf_cgmp_gda, NullTVB, offset, 6,
                            &pd[offset]);
                        offset += 6;
 
                        if (!BYTES_ARE_IN_FRAME(offset, 6))
                                break;
-                       proto_tree_add_item(cgmp_tree, hf_cgmp_usa, offset, 6,
+                       proto_tree_add_item(cgmp_tree, hf_cgmp_usa, NullTVB, offset, 6,
                            &pd[offset]);
                        offset += 6;
 
index 18c5ef019a362c69698a9db08fc8d2b95a74c059..0760a0c7aae570459207f32bfb9d54078ee55efd 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-clip.c
  * Routines for clip packet disassembly
  *
- * $Id: packet-clip.c,v 1.5 2000/02/15 21:02:05 gram Exp $
+ * $Id: packet-clip.c,v 1.6 2000/05/11 08:15:04 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -72,9 +72,9 @@ dissect_clip( const u_char *pd, frame_data *fd, proto_tree *tree ) {
      it treats the packet as being raw IP with no link-level
      header. */
   if(tree) {
-    ti = proto_tree_add_text(tree, 0, 0, "Classical IP frame" );
+    ti = proto_tree_add_text(tree, NullTVB, 0, 0, "Classical IP frame" );
     fh_tree = proto_item_add_subtree(ti, ett_clip);
-    proto_tree_add_text(fh_tree, 0, 0, "No link information available");
+    proto_tree_add_text(fh_tree, NullTVB, 0, 0, "No link information available");
   }
   dissect_ip(pd, 0, fd, tree);
 }
index febb4556e862253219f5d6dbb8bde736bc13b8a4..93b557fceeb582d9562752b5b2595e22433d8f29 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-clnp.c
  * Routines for ISO/OSI network and transport protocol packet disassembly
  *
- * $Id: packet-clnp.c,v 1.6 2000/05/05 09:32:01 guy Exp $
+ * $Id: packet-clnp.c,v 1.7 2000/05/11 08:15:04 gram Exp $
  * Laurent Deniel <deniel@worldnet.fr>
  * Ralf Schneider <Ralf.Schneider@t-online.de>
  *
@@ -272,17 +272,17 @@ static int osi_decode_DR(const u_char *pd, int offset,
                 src_ref, dst_ref);
 
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
+    ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL);
     cotp_tree = proto_item_add_subtree(ti, ett_cotp);
-    proto_tree_add_text(cotp_tree, offset,      1,
+    proto_tree_add_text(cotp_tree, NullTVB, offset,      1,
                        "Length indicator: %u", li);
-    proto_tree_add_text(cotp_tree, offset +  1, 1, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                        "TPDU code: 0x%x (DR)", tpdu); 
-    proto_tree_add_text(cotp_tree, offset +  2, 2, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  2, 2, 
                        "Destination reference: 0x%04x", dst_ref);
-    proto_tree_add_text(cotp_tree, offset +  4, 2, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 2, 
                        "Source reference: 0x%04x", src_ref);
-    proto_tree_add_text(cotp_tree, offset +  6, 1, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  6, 1, 
                        "Cause: %s", str);
   }
 
@@ -364,62 +364,62 @@ static gboolean osi_decode_DT(const u_char *pd, int offset,
                 (fragment)? "(fragment)" : "");
 
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
+    ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL);
     cotp_tree = proto_item_add_subtree(ti, ett_cotp);
-    proto_tree_add_text(cotp_tree, offset,      1,
+    proto_tree_add_text(cotp_tree, NullTVB, offset,      1,
                        "Length indicator: %u", li);
-    proto_tree_add_text(cotp_tree, offset +  1, 1, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                        "TPDU code: 0x%x (DT)", tpdu); 
 
     if (li != LI_NORMAL_DT_CLASS_01)
-      proto_tree_add_text(cotp_tree, offset +  2, 2, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  2, 2, 
                          "Destination reference: 0x%04x", dst_ref);
 
     switch (li) {
       case LI_NORMAL_DT_WITH_CHECKSUM      :
-       proto_tree_add_text(cotp_tree, offset +  4, 1, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 1, 
                            "TPDU number: 0x%02x (%s)", 
                            tpdu_nr,
                            (fragment)? "fragment":"complete");
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_NDT, 1, 
                            "Parameter code: 0x%02x (checksum)", code);
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_NDT + 1, 1, 
                            "Parameter length: %u", length);
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_NDT + 2, length, 
                            "Checksum: 0x%04x", checksum);
        break;
       case LI_NORMAL_DT_WITHOUT_CHECKSUM   :
-       proto_tree_add_text(cotp_tree, offset +  4, 1, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 1, 
                            "TPDU number: 0x%02x (%s)", 
                            tpdu_nr,
                            (fragment)? "fragment":"complete");
        break;
       case LI_EXTENDED_DT_WITH_CHECKSUM    :
-       proto_tree_add_text(cotp_tree, offset +  4, 4, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 4, 
                            "TPDU number: 0x%08x (%s)", 
                            tpdu_nr,
                            (fragment)? "fragment":"complete");
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_EDT, 1, 
                            "Parameter code: 0x%02x (checksum)", code);
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_EDT + 1, 1, 
                            "Parameter length: %u", length);
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_EDT + 2, length, 
                            "Checksum: 0x%04x", checksum);
        break;
       case LI_EXTENDED_DT_WITHOUT_CHECKSUM :
-       proto_tree_add_text(cotp_tree, offset +  4, 4, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 4, 
                            "TPDU number: 0x%08x (%s)", 
                            tpdu_nr,
                            (fragment)? "fragment":"complete");
        break;
       case LI_NORMAL_DT_CLASS_01           :
-       proto_tree_add_text(cotp_tree, offset +  2, 1, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  2, 1, 
                            "TPDU number: 0x%02x (%s)", 
                            tpdu_nr,
                            (fragment)? "fragment":"complete");
@@ -506,48 +506,48 @@ static int osi_decode_ED(const u_char *pd, int offset,
                 tpdu_nr, dst_ref);
 
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
+    ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL);
     cotp_tree = proto_item_add_subtree(ti, ett_cotp);
-    proto_tree_add_text(cotp_tree, offset,      1,
+    proto_tree_add_text(cotp_tree, NullTVB, offset,      1,
                        "Length indicator: %u", li);
-    proto_tree_add_text(cotp_tree, offset +  1, 1, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                        "TPDU code: 0x%x (ED)", tpdu); 
-    proto_tree_add_text(cotp_tree, offset +  2, 2, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  2, 2, 
                        "Destination reference: 0x%04x", dst_ref);
 
     switch (li) {
       case LI_NORMAL_DT_WITH_CHECKSUM      :
-       proto_tree_add_text(cotp_tree, offset +  4, 1, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 1, 
                            "TPDU number: 0x%02x", tpdu_nr);    
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_NDT, 1, 
                            "Parameter code: 0x%02x (checksum)", code);
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_NDT + 1, 1, 
                            "Parameter length: %u", length);
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_NDT + 2, length, 
                            "Checksum: 0x%04x", checksum);
        break;
       case LI_NORMAL_DT_WITHOUT_CHECKSUM   :
-       proto_tree_add_text(cotp_tree, offset +  4, 1, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 1, 
                            "TPDU number: 0x%02x", tpdu_nr);
        break;
       case LI_EXTENDED_DT_WITH_CHECKSUM    :
-       proto_tree_add_text(cotp_tree, offset +  4, 4, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 4, 
                            "TPDU number: 0x%02x", tpdu_nr);    
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_EDT, 1, 
                            "Parameter code: 0x%02x (checksum)", code);
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_EDT + 1, 1, 
                            "Parameter length: %u", length);
-       proto_tree_add_text(cotp_tree, 
+       proto_tree_add_text(cotp_tree, NullTVB, 
                            offset +  P_VAR_PART_EDT + 2, length, 
                            "Checksum: 0x%04x", checksum);
        break;
       case LI_EXTENDED_DT_WITHOUT_CHECKSUM :
-       proto_tree_add_text(cotp_tree, offset +  4, 4, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 4, 
                            "TPDU number: 0x%02x", tpdu_nr);
        break;
     }
@@ -587,24 +587,24 @@ static int osi_decode_RJ(const u_char *pd, int offset,
                 tpdu_nr, dst_ref);
 
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
+    ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL);
     cotp_tree = proto_item_add_subtree(ti, ett_cotp);
-    proto_tree_add_text(cotp_tree, offset,      1,
+    proto_tree_add_text(cotp_tree, NullTVB, offset,      1,
                        "Length indicator: %u", li);
-    proto_tree_add_text(cotp_tree, offset +  1, 1, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                        "TPDU code: 0x%x (RJ)", tpdu); 
     if (li == LI_NORMAL_RJ)
-      proto_tree_add_text(cotp_tree, offset +  1, 1, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                          "Credit: %u", cdt);
-    proto_tree_add_text(cotp_tree, offset +  2, 2, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  2, 2, 
                        "Destination reference: 0x%04x", dst_ref);
     if (li == LI_NORMAL_RJ)
-      proto_tree_add_text(cotp_tree, offset +  4, 1, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 1, 
                          "Your TPDU number: 0x%02x", tpdu_nr);
     else {
-      proto_tree_add_text(cotp_tree, offset +  4, 4, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 4, 
                          "Your TPDU number: 0x%02x", tpdu_nr);
-      proto_tree_add_text(cotp_tree, offset +  8, 2, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  8, 2, 
                          "Credit: 0x%02x", credit);
     }
   }
@@ -686,18 +686,18 @@ static int osi_decode_CC(const u_char *pd, int offset,
                 dst_ref);
 
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
+    ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL);
     cotp_tree = proto_item_add_subtree(ti, ett_cotp);
-    proto_tree_add_text(cotp_tree, offset,      1,
+    proto_tree_add_text(cotp_tree, NullTVB, offset,      1,
                        "Length indicator: %u", li);
-    proto_tree_add_text(cotp_tree, offset +  1, 1, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                        "TPDU code: 0x%x (%s)", tpdu,
                        (tpdu == CR_TPDU) ? "CR" : "CC"); 
-    proto_tree_add_text(cotp_tree, offset +  2, 2, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  2, 2, 
                        "Destination reference: 0x%04x", dst_ref);
-    proto_tree_add_text(cotp_tree, offset +  4, 2, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 2, 
                        "Source reference: 0x%04x", src_ref);
-    proto_tree_add_text(cotp_tree, offset +  6, 1, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  6, 1, 
                        "Class option: 0x%02x", class_option);
   }
 
@@ -712,26 +712,26 @@ static int osi_decode_CC(const u_char *pd, int offset,
        case VP_CHECKSUM :
          length   = pd[offset + P_VAR_PART_CC + i + 1];
          checksum = EXTRACT_SHORT(&pd[offset + P_VAR_PART_CC + i + 2]);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i, 1, 
                              "Parameter code:   0x%02x (checksum)", code);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 1, 1, 
                              "Parameter length: %u", length);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 2, length, 
                              "Checksum:         0x%04x", checksum);
          i += length + 2;
          break;
        case VP_SRC_TSAP    :
          length = pd[offset + P_VAR_PART_CC + i + 1];
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i, 1, 
                              "Parameter code:   0x%02x (src-tsap)", code);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 1, 1, 
                              "Parameter length: %u", length);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 2, length, 
                              "Calling TSAP:     %s", 
                              print_tsap(&pd[offset + P_VAR_PART_CC + i + 2],
@@ -740,13 +740,13 @@ static int osi_decode_CC(const u_char *pd, int offset,
          break;
        case VP_DST_TSAP    :
          length = pd[offset + P_VAR_PART_CC + i + 1];
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i, 1, 
                              "Parameter code:   0x%02x (dst-tsap)", code);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 1, 1, 
                              "Parameter length: %u", length);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 2, length, 
                              "Called TSAP:      %s", 
                              print_tsap(&pd[offset + P_VAR_PART_CC + i + 2],
@@ -756,13 +756,13 @@ static int osi_decode_CC(const u_char *pd, int offset,
        case VP_TPDU_SIZE   :
          length = pd[offset + P_VAR_PART_CC + i + 1];
          c1 = pd[offset + P_VAR_PART_CC + i + 2] & 0x0F;
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i, 1, 
                              "Parameter code:   0x%02x (tpdu-size)", code);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 1, 1, 
                              "Parameter length: %u", length);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 2, length, 
                              "TPDU size:        %u", 2 << c1);
          i += length + 2;
@@ -770,45 +770,45 @@ static int osi_decode_CC(const u_char *pd, int offset,
        case VP_OPT_SEL     :
          length = pd[offset + P_VAR_PART_CC + i + 1];
          c1 = pd[offset + P_VAR_PART_CC + i + 2] & 0x0F;
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i, 1, 
                              "Parameter code:   0x%02x (options)", code);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 1, 1, 
                              "Parameter length: %u", length);
          if (class_option == 1) {
            if (c1 & 0x8)
-             proto_tree_add_text(cotp_tree, 
+             proto_tree_add_text(cotp_tree, NullTVB, 
                                  offset +  P_VAR_PART_CC + i + 2, 1,
                                  "Use of network expedited data");
            else
-             proto_tree_add_text(cotp_tree, 
+             proto_tree_add_text(cotp_tree, NullTVB, 
                                  offset +  P_VAR_PART_CC + i + 2, 1,
                                  "Non use of network expedited data");
            if (c1 & 0x4)
-             proto_tree_add_text(cotp_tree, 
+             proto_tree_add_text(cotp_tree, NullTVB, 
                                  offset +  P_VAR_PART_CC + i + 2, 1,
                                  "Use of Receipt confirmation");
            else
-             proto_tree_add_text(cotp_tree, 
+             proto_tree_add_text(cotp_tree, NullTVB, 
                                  offset +  P_VAR_PART_CC + i + 2, 1,
                                  "Use of explicit AK variant");
          } else if (class_option == 4) {
            if (c1 & 0x2)
-             proto_tree_add_text(cotp_tree, 
+             proto_tree_add_text(cotp_tree, NullTVB, 
                                  offset +  P_VAR_PART_CC + i + 2, 1,
                                  "Non-use 16 bit checksum in class 4");
            else
-             proto_tree_add_text(cotp_tree, 
+             proto_tree_add_text(cotp_tree, NullTVB, 
                                  offset +  P_VAR_PART_CC + i + 2, 1,
                                  "Use 16 bit checksum ");
          }
          if (c1 & 0x1)
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_CC + i + 2, 1,
                                "Use of transport expedited data transfer\n");
          else
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_CC + i + 2, 1,
                                "Non-use of transport expedited data transfer");
          i += length + 2;
@@ -816,13 +816,13 @@ static int osi_decode_CC(const u_char *pd, int offset,
        case VP_ACK_TIME    :
          length = pd[offset + P_VAR_PART_CC + i + 1];
          s = EXTRACT_SHORT(&pd[offset + P_VAR_PART_CC + i + 2]);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i, 1, 
                              "Parameter code: 0x%02x (ack time)", code);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 1, 1, 
                              "Parameter length: %u", length);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 2, length, 
                              "Ack time (ms): %u", s);
          i += length + 2;
@@ -833,22 +833,22 @@ static int osi_decode_CC(const u_char *pd, int offset,
          t2 = EXTRACT_LONG(&pd[offset + P_VAR_PART_CC + i + 4]);
          t3 = EXTRACT_LONG(&pd[offset + P_VAR_PART_CC + i + 7]);
          t4 = EXTRACT_LONG(&pd[offset + P_VAR_PART_CC + i + 10]);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                               offset +  P_VAR_PART_CC + i, 1, 
                              "Parameter code:  0x%02x (throughput)", code);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 1, 1, 
                              "Parameter length:              %u", length);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 2, 4, 
                              "Target value / calling-called: %u o/s", t1);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 6, 4, 
                              "Minimum / calling-called:      %u o/s", t2);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 10, 4, 
                              "Target value / called-calling: %u o/s", t3);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 14, 4, 
                              "Minimum / called-calling: %u o/s", t4);
          i += length + 2;
@@ -859,22 +859,22 @@ static int osi_decode_CC(const u_char *pd, int offset,
          s2 = EXTRACT_SHORT(&pd[offset + P_VAR_PART_CC + i + 4]);
          s3 = EXTRACT_SHORT(&pd[offset + P_VAR_PART_CC + i + 6]);
          s4 = EXTRACT_SHORT(&pd[offset + P_VAR_PART_CC + i + 8]);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i, 1, 
                              "Parameter code: 0x%02x (transit delay)", code);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 1, 1, 
                              "Parameter length: %u", length);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 2, 2, 
                              "Target value / calling-called: %u ms", s1);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 4, 2, 
                              "Minimum / calling-called: %u ms", s2);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 6, 2, 
                              "Target value / called-calling: %u ms", s3);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 8, 2, 
                              "Minimum / called-calling: %u ms", s4);
          i += length + 2;
@@ -882,13 +882,13 @@ static int osi_decode_CC(const u_char *pd, int offset,
        case VP_PRIORITY    :
          length = pd[offset + P_VAR_PART_CC + i + 1];
          s = EXTRACT_SHORT(&pd[offset + P_VAR_PART_CC + i + 2]);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i, 1, 
                              "Parameter code: 0x%02x (priority)", code);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 1, 1, 
                              "Parameter length: %u", length);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 2, length,
                              "Priority: %u", s);
          i += length + 2;
@@ -897,13 +897,13 @@ static int osi_decode_CC(const u_char *pd, int offset,
        case VP_VERSION_NR  :
          length = pd[offset + P_VAR_PART_CC + i + 1];
          c1 = pd[offset + P_VAR_PART_CC + i + 2];
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i, 1, 
                              "Parameter code: 0x%02x (version)", code);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 1, 1, 
                              "Parameter length: %u", length);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 2, length,
                              "Version: %u", c1);
          i += length + 2;
@@ -915,13 +915,13 @@ static int osi_decode_CC(const u_char *pd, int offset,
        case VP_PROTO_CLASS :
        default             :     /* no decoding */
          length = pd[offset + P_VAR_PART_CC + i + 1];
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 0, 1, 
                              "Parameter code: 0x%02x", code);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 1, 1, 
                              "Parameter length: %u", length);
-         proto_tree_add_text(cotp_tree, 
+         proto_tree_add_text(cotp_tree, NullTVB, 
                              offset +  P_VAR_PART_CC + i + 2, length, 
                              "Parameter value: <not shown>");
          i += length + 2;
@@ -970,24 +970,24 @@ static int osi_decode_DC(const u_char *pd, int offset,
                 dst_ref);
 
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
+    ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL);
     cotp_tree = proto_item_add_subtree(ti, ett_cotp);
-    proto_tree_add_text(cotp_tree, offset,      1,
+    proto_tree_add_text(cotp_tree, NullTVB, offset,      1,
                        "Length indicator: %u", li);
-    proto_tree_add_text(cotp_tree, offset +  1, 1, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                        "TPDU code: 0x%x (DC)", tpdu); 
-    proto_tree_add_text(cotp_tree, offset +  2, 2, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  2, 2, 
                        "Destination reference: 0x%04x", dst_ref);
-    proto_tree_add_text(cotp_tree, offset +  4, 2, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 2, 
                        "Source reference: 0x%04x", src_ref);
     if (code) {
-      proto_tree_add_text(cotp_tree, 
+      proto_tree_add_text(cotp_tree, NullTVB, 
                          offset +  P_VAR_PART_DC + 0, 1, 
                          "Parameter code: 0x%02x (checksum)", code);
-      proto_tree_add_text(cotp_tree, 
+      proto_tree_add_text(cotp_tree, NullTVB, 
                          offset +  P_VAR_PART_DC + 1, 1, 
                          "Parameter length: %u", length);
-      proto_tree_add_text(cotp_tree, 
+      proto_tree_add_text(cotp_tree, NullTVB, 
                          offset +  P_VAR_PART_DC + 2, 2, 
                          "Checksum: 0x%04x", checksum);
     }
@@ -1020,17 +1020,17 @@ static int osi_decode_AK(const u_char *pd, int offset,
                   tpdu_nr, dst_ref);
     
     if (tree) {
-      ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
+      ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL);
       cotp_tree = proto_item_add_subtree(ti, ett_cotp);
-      proto_tree_add_text(cotp_tree, offset,      1,
+      proto_tree_add_text(cotp_tree, NullTVB, offset,      1,
                          "Length indicator: %u", li);
-      proto_tree_add_text(cotp_tree, offset +  1, 1, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                          "TPDU code: 0x%x (AK)", tpdu); 
-      proto_tree_add_text(cotp_tree, offset +  1, 1, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                          "Credit: %u", cdt);
-      proto_tree_add_text(cotp_tree, offset +  2, 2, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  2, 2, 
                          "Destination reference: 0x%04x", dst_ref);
-      proto_tree_add_text(cotp_tree, offset +  4, 1, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 1, 
                          "Your TPDU number: 0x%02x", tpdu_nr);
     }
 
@@ -1040,13 +1040,13 @@ static int osi_decode_AK(const u_char *pd, int offset,
          length   = pd[offset + P_VAR_PART_NAK + i + 1];
          checksum = EXTRACT_SHORT(&pd[offset + P_VAR_PART_NAK + i + 2]);
          if (tree) {
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 0, 1, 
                                "Parameter code: 0x%02x (checksum)", code);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 1, 1, 
                                "Parameter length: %u", length);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 2, 2, 
                                "Checksum: 0x%04x", checksum);
          }
@@ -1059,22 +1059,22 @@ static int osi_decode_AK(const u_char *pd, int offset,
          r_seq_nr = EXTRACT_SHORT(&pd[offset + P_VAR_PART_NAK + i + 6]);
          r_cdt = EXTRACT_SHORT(&pd[offset + P_VAR_PART_NAK + i + 8]);
          if (tree) {
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 0, 1, 
                                "Parameter code: 0x%02x (flow control)", 
                                code);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 1, 1, 
                                "Parameter length: %u", length);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 2, 4, 
                                "Lower window edge: 0x%08x", 
                                r_lower_window_edge);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 6, 2, 
                                "Sequence number: 0x%04x", 
                                r_seq_nr);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 8, 2, 
                                "Credit: 0x%04x", 
                                r_cdt);
@@ -1085,13 +1085,13 @@ static int osi_decode_AK(const u_char *pd, int offset,
          length = pd[offset + P_VAR_PART_NAK + i + 1];
          seq_nr = EXTRACT_SHORT(&pd[offset + P_VAR_PART_NAK + i + 2]);
          if (tree) {
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 0, 1, 
                                "Parameter code: 0x%02x (seq number)", code);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 1, 1, 
                                "Parameter length: %u", length);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 2, 2, 
                                "Sequence number: 0x%04x", seq_nr);
          }
@@ -1100,13 +1100,13 @@ static int osi_decode_AK(const u_char *pd, int offset,
         default :
          length = pd[offset + P_VAR_PART_NAK + i + 1];
          if (tree) {
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 0, 1, 
                                "Parameter code: 0x%02x (unknown)", code);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 1, 1, 
                                "Parameter length: %u", length);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_NAK + i + 2, length, 
                                "Parameter value: <not shown>");
          }
@@ -1124,17 +1124,17 @@ static int osi_decode_AK(const u_char *pd, int offset,
                   tpdu_nr, dst_ref);
     
     if (tree) {
-      ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
+      ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL);
       cotp_tree = proto_item_add_subtree(ti, ett_cotp);
-      proto_tree_add_text(cotp_tree, offset,      1,
+      proto_tree_add_text(cotp_tree, NullTVB, offset,      1,
                          "Length indicator: %u", li);
-      proto_tree_add_text(cotp_tree, offset +  1, 1, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                          "TPDU code: 0x%x (AK)", tpdu); 
-      proto_tree_add_text(cotp_tree, offset +  2, 2, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  2, 2, 
                          "Destination reference: 0x%04x", dst_ref);
-      proto_tree_add_text(cotp_tree, offset +  4, 4, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 4, 
                          "Your TPDU number: 0x%08x", tpdu_nr);
-      proto_tree_add_text(cotp_tree, offset +  8, 2, 
+      proto_tree_add_text(cotp_tree, NullTVB, offset +  8, 2, 
                          "Credit: 0x%04x", cdt_in_ak);
     }
     
@@ -1144,13 +1144,13 @@ static int osi_decode_AK(const u_char *pd, int offset,
          length   = pd[offset + P_VAR_PART_EAK + i + 1];
          checksum = EXTRACT_SHORT(&pd[offset + P_VAR_PART_EAK + i + 2]);
          if (tree) {
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 0, 1, 
                                "Parameter code: 0x%02x (checksum)", code);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 1, 1, 
                                "Parameter length: %u", length);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 2, 2, 
                                "Checksum: 0x%04x", checksum);
          }
@@ -1163,22 +1163,22 @@ static int osi_decode_AK(const u_char *pd, int offset,
          r_seq_nr = EXTRACT_SHORT(&pd[offset + P_VAR_PART_EAK + i + 6]);
          r_cdt = EXTRACT_SHORT(&pd[offset + P_VAR_PART_EAK + i + 8]);
          if (tree) {
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 0, 1, 
                                "Parameter code: 0x%02x (flow control)",
                                code);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 1, 1, 
                                "Parameter length: %u", length);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 2, 4, 
                                "Lower window edge: 0x%08x", 
                                r_lower_window_edge);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 6, 2, 
                                "Sequence number: 0x%04x", 
                                r_seq_nr);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 8, 2, 
                                "Credit: 0x%04x", 
                                r_cdt);
@@ -1189,13 +1189,13 @@ static int osi_decode_AK(const u_char *pd, int offset,
          length   = pd[offset + P_VAR_PART_EAK + i + 1];
          seq_nr = EXTRACT_SHORT(&pd[offset + P_VAR_PART_EAK + i + 2]);
          if (tree) {
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 0, 1, 
                                "Parameter code: 0x%02x (seq number)", code);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 1, 1, 
                                "Parameter length: %u", length);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 2, 2, 
                                "Sequence number: 0x%04x", seq_nr);
          }
@@ -1204,13 +1204,13 @@ static int osi_decode_AK(const u_char *pd, int offset,
         default :
          length   = pd[offset + P_VAR_PART_EAK + i + 1];
          if (tree) {
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 0, 1, 
                                "Parameter code: 0x%02x (unknown)", code);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 1, 1, 
                                "Parameter length: %u", length);
-           proto_tree_add_text(cotp_tree, 
+           proto_tree_add_text(cotp_tree, NullTVB, 
                                offset +  P_VAR_PART_EAK + i + 2, length, 
                                "Parameter value: <not shown>");
          }
@@ -1274,42 +1274,42 @@ static int osi_decode_EA(const u_char *pd, int offset,
                 "EA TPDU (%u) dst-ref: 0x%04x", tpdu_nr, dst_ref);
 
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
+    ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL);
     cotp_tree = proto_item_add_subtree(ti, ett_cotp);
-    proto_tree_add_text(cotp_tree, offset,      1,
+    proto_tree_add_text(cotp_tree, NullTVB, offset,      1,
                        "Length indicator: %u", li);
-    proto_tree_add_text(cotp_tree, offset +  1, 1, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                        "TPDU code: 0x%x (EA)", tpdu); 
-    proto_tree_add_text(cotp_tree, offset +  2, 2, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  2, 2, 
                        "Destination reference: 0x%04x", dst_ref);
 
     switch (li) {
       case LI_NORMAL_EA_WITH_CHECKSUM      :
-       proto_tree_add_text(cotp_tree, offset +  4, 1, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 1, 
                            "Your TPDU number: 0x%02x", tpdu_nr);
-       proto_tree_add_text(cotp_tree, offset +  5, 1, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  5, 1, 
                            "Parameter code: 0x%02x (checksum)", code);
-       proto_tree_add_text(cotp_tree, offset +  6, 1, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  6, 1, 
                            "Parameter length: %u", length);
-       proto_tree_add_text(cotp_tree, offset +  7, 2, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  7, 2, 
                            "Checksum: 0x%04x", checksum);
        break;
       case LI_NORMAL_EA_WITHOUT_CHECKSUM   :
-       proto_tree_add_text(cotp_tree, offset +  4, 1, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 1, 
                            "Your TPDU number: 0x%02x", tpdu_nr);
        break;
       case LI_EXTENDED_EA_WITH_CHECKSUM    :
-       proto_tree_add_text(cotp_tree, offset +  4, 4, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 4, 
                            "Your TPDU number: 0x%08x", tpdu_nr);
-       proto_tree_add_text(cotp_tree, offset +  8, 1, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  8, 1, 
                            "Parameter code: 0x%02x (checksum)", code);
-       proto_tree_add_text(cotp_tree, offset +  9, 1, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  9, 1, 
                            "Parameter length: %u", length);
-       proto_tree_add_text(cotp_tree, offset +  10, 2, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  10, 2, 
                            "Checksum: 0x%04x", checksum);
        break;
       case LI_EXTENDED_EA_WITHOUT_CHECKSUM :
-       proto_tree_add_text(cotp_tree, offset +  4, 4, 
+       proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 4, 
                            "Your TPDU number: 0x%08x", tpdu_nr);
        break;
       default :
@@ -1356,15 +1356,15 @@ static int osi_decode_ER(const u_char *pd, int offset,
     col_append_fstr(fd, COL_INFO, "ER TPDU dst-ref: 0x%04x", dst_ref);
 
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_cotp, offset, li + 1, NULL);
+    ti = proto_tree_add_item(tree, proto_cotp, NullTVB, offset, li + 1, NULL);
     cotp_tree = proto_item_add_subtree(ti, ett_cotp);
-    proto_tree_add_text(cotp_tree, offset,      1,
+    proto_tree_add_text(cotp_tree, NullTVB, offset,      1,
                        "Length indicator: %u", li);
-    proto_tree_add_text(cotp_tree, offset +  1, 1, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  1, 1, 
                        "TPDU code: 0x%x (ER)", tpdu); 
-    proto_tree_add_text(cotp_tree, offset +  2, 2, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  2, 2, 
                        "Destination reference: 0x%04x", dst_ref);
-    proto_tree_add_text(cotp_tree, offset +  4, 1, 
+    proto_tree_add_text(cotp_tree, NullTVB, offset +  4, 1, 
                        "Reject cause: %s", str);
   }
 
@@ -1509,9 +1509,9 @@ static void dissect_clnp(const u_char *pd, int offset, frame_data *fd,
     if (check_col(fd, COL_INFO))
       col_add_str(fd, COL_INFO, "Inactive subset");
     if (tree) {
-      ti = proto_tree_add_item(tree, proto_clnp, offset, 1, NULL);
+      ti = proto_tree_add_item(tree, proto_clnp, NullTVB, offset, 1, NULL);
       clnp_tree = proto_item_add_subtree(ti, ett_clnp);
-      proto_tree_add_uint_format(clnp_tree, hf_clnp_id, offset, 1, 
+      proto_tree_add_uint_format(clnp_tree, hf_clnp_id, NullTVB, offset, 1, 
                                 clnp.cnf_proto_id,
                                 "Inactive subset");
     } 
@@ -1544,27 +1544,27 @@ static void dissect_clnp(const u_char *pd, int offset, frame_data *fd,
   pdu_type_string = val_to_str(clnp.cnf_type & CNF_TYPE, npdu_type_vals,
                                "Unknown (0x%02x)");
   if (tree) {
-    ti = proto_tree_add_item(tree, proto_clnp, offset, clnp.cnf_hdr_len, NULL);
+    ti = proto_tree_add_item(tree, proto_clnp, NullTVB, offset, clnp.cnf_hdr_len, NULL);
     clnp_tree = proto_item_add_subtree(ti, ett_clnp);
-    proto_tree_add_item(clnp_tree, hf_clnp_id, offset, 1, 
+    proto_tree_add_item(clnp_tree, hf_clnp_id, NullTVB, offset, 1, 
                               clnp.cnf_proto_id);
-    proto_tree_add_item(clnp_tree, hf_clnp_length, offset +  1, 1, 
+    proto_tree_add_item(clnp_tree, hf_clnp_length, NullTVB, offset +  1, 1, 
                        clnp.cnf_hdr_len); 
-    proto_tree_add_item(clnp_tree, hf_clnp_version, offset +  2, 1, 
+    proto_tree_add_item(clnp_tree, hf_clnp_version, NullTVB, offset +  2, 1, 
                        clnp.cnf_vers);
-    proto_tree_add_uint_format(clnp_tree, hf_clnp_ttl, offset +  3, 1, 
+    proto_tree_add_uint_format(clnp_tree, hf_clnp_ttl, NullTVB, offset +  3, 1, 
                               clnp.cnf_ttl,
                               "Holding Time : %u (%u secs)", 
                               clnp.cnf_ttl, clnp.cnf_ttl / 2);
-    proto_tree_add_uint_format(clnp_tree, hf_clnp_type, offset +  4, 1, 
+    proto_tree_add_uint_format(clnp_tree, hf_clnp_type, NullTVB, offset +  4, 1, 
                               clnp.cnf_type,
                               "PDU Type     : 0x%02x (%s%s)",
                               clnp.cnf_type,
                               flag_string,
                               pdu_type_string);
-    proto_tree_add_item(clnp_tree, hf_clnp_pdu_length, offset +  5, 2, 
+    proto_tree_add_item(clnp_tree, hf_clnp_pdu_length, NullTVB, offset +  5, 2, 
                        segment_length);
-    proto_tree_add_uint_format(clnp_tree, hf_clnp_checksum, offset +  7, 2,
+    proto_tree_add_uint_format(clnp_tree, hf_clnp_checksum, NullTVB, offset +  7, 2,
                               EXTRACT_SHORT(&clnp.cnf_cksum_msb),
                               "Checksum     : 0x%04x",
                               EXTRACT_SHORT(&clnp.cnf_cksum_msb));
@@ -1588,15 +1588,15 @@ static void dissect_clnp(const u_char *pd, int offset, frame_data *fd,
   src_len = pd[offset + dst_len + 1];
 
   if (tree) {
-    proto_tree_add_item(clnp_tree, hf_clnp_dest_length, offset, 1, 
+    proto_tree_add_item(clnp_tree, hf_clnp_dest_length, NullTVB, offset, 1, 
                        dst_len);
-    proto_tree_add_bytes_format(clnp_tree, hf_clnp_dest, offset + 1 , dst_len, 
+    proto_tree_add_bytes_format(clnp_tree, hf_clnp_dest, NullTVB, offset + 1 , dst_len, 
                               &pd[offset + 1],
                               " DA : %s", 
                               print_nsap_net(&pd[offset + 1], dst_len));
-    proto_tree_add_item(clnp_tree, hf_clnp_src_length, 
+    proto_tree_add_item(clnp_tree, hf_clnp_src_length, NullTVB, 
                        offset + 1 + dst_len, 1, src_len);
-    proto_tree_add_bytes_format(clnp_tree, hf_clnp_src, 
+    proto_tree_add_bytes_format(clnp_tree, hf_clnp_src, NullTVB, 
                               offset + dst_len + 2, src_len,
                               &pd[offset + dst_len + 2],
                               " SA : %s", 
@@ -1622,13 +1622,13 @@ static void dissect_clnp(const u_char *pd, int offset, frame_data *fd,
     
     segment_offset = EXTRACT_SHORT(&pd[offset + 2]);
     if (tree) {
-      proto_tree_add_text(clnp_tree, offset, 2, 
+      proto_tree_add_text(clnp_tree, NullTVB, offset, 2, 
                        "Data unit identifier: %06u",
                        EXTRACT_SHORT(&pd[offset]));
-      proto_tree_add_text(clnp_tree, offset + 2 , 2,
+      proto_tree_add_text(clnp_tree, NullTVB, offset + 2 , 2,
                        "Segment offset      : %6u", 
                        segment_offset);
-      proto_tree_add_text(clnp_tree, offset + 4 , 2,
+      proto_tree_add_text(clnp_tree, NullTVB, offset + 4 , 2,
                        "Total length        : %6u", 
                        EXTRACT_SHORT(&pd[offset + 4]));
     }
@@ -1640,7 +1640,7 @@ static void dissect_clnp(const u_char *pd, int offset, frame_data *fd,
   if (tree) {
     /* To do : decode options  */
 /*
-    proto_tree_add_text(clnp_tree, offset, 
+    proto_tree_add_text(clnp_tree, NullTVB, offset, 
                        clnp.cnf_hdr_len + first_offset - offset,
                        "Options/Data: <not shown>");
 */
index fadbf405df44a2589e2d7b5d2a2fcdcfc38aeb3e..924f263649f078281db5f201824d43dbb308ceb8 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for raw data (default case)
  * Gilbert Ramirez <gram@xiexie.org>
  *
- * $Id: packet-data.c,v 1.15 2000/03/12 04:47:36 gram Exp $
+ * $Id: packet-data.c,v 1.16 2000/05/11 08:15:05 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -44,7 +44,7 @@ void
 dissect_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
 {
        if (IS_DATA_IN_FRAME(offset) && tree) {
-               proto_tree_add_protocol_format(tree, proto_data, offset,
+               proto_tree_add_protocol_format(tree, proto_data, NullTVB, offset,
                        END_OF_FRAME, "Data (%d byte%s)", END_OF_FRAME,
                        plurality(END_OF_FRAME, "", "s"));
        }
index 44f8e9ddcd1029dfaf8c7580194cb04bd448bd3c..73a82783694a06ffc0733c37220ff608274a1408 100644 (file)
@@ -3,7 +3,7 @@
  * see http://ddt.sourceforge.net/
  * Olivier Abad <abad@daba.dhis.net>
  *
- * $Id: packet-ddtp.c,v 1.2 2000/04/13 21:16:22 oabad Exp $
+ * $Id: packet-ddtp.c,v 1.3 2000/05/11 08:15:05 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -110,33 +110,33 @@ dissect_ddtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
        col_add_str (fd, COL_PROTOCOL, "DDTP");
     }
     if (tree) {
-       ti = proto_tree_add_item(tree, proto_ddtp, offset,
+       ti = proto_tree_add_item(tree, proto_ddtp, NullTVB, offset,
                END_OF_FRAME - offset, NULL);
        ddtp_tree = proto_item_add_subtree(ti, ett_ddtp);
 
        if (!BYTES_ARE_IN_FRAME(offset, 4)) {
-           proto_tree_add_text(ddtp_tree, offset, END_OF_FRAME-offset, "Frame too short");
+           proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short");
            return;
        }
-       proto_tree_add_item(ddtp_tree, hf_ddtp_version, offset, 4, pntohl(pd+offset));
+       proto_tree_add_item(ddtp_tree, hf_ddtp_version, NullTVB, offset, 4, pntohl(pd+offset));
        offset += 4;
        if (!BYTES_ARE_IN_FRAME(offset, 4)) {
-           proto_tree_add_text(ddtp_tree, offset, END_OF_FRAME-offset, "Frame too short");
+           proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short");
            return;
        }
-       proto_tree_add_item(ddtp_tree, hf_ddtp_encrypt, offset, 4, pntohl(pd+offset));
+       proto_tree_add_item(ddtp_tree, hf_ddtp_encrypt, NullTVB, offset, 4, pntohl(pd+offset));
        if (!BYTES_ARE_IN_FRAME(offset+4, 4)) {
-           proto_tree_add_text(ddtp_tree, offset+4, END_OF_FRAME-offset-4, "Frame too short");
+           proto_tree_add_text(ddtp_tree, NullTVB, offset+4, END_OF_FRAME-offset-4, "Frame too short");
            return;
        }
-       proto_tree_add_item(ddtp_tree, hf_ddtp_hostid, offset+4, 4, pntohl(pd+offset+4));
+       proto_tree_add_item(ddtp_tree, hf_ddtp_hostid, NullTVB, offset+4, 4, pntohl(pd+offset+4));
        if (pntohl(pd+offset) == DDTP_ENCRYPT_PLAINTEXT) {
            offset += 8;
            if (!BYTES_ARE_IN_FRAME(offset, 4)) {
-               proto_tree_add_text(ddtp_tree, offset, END_OF_FRAME-offset, "Frame too short");
+               proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short");
                return;
            }
-           proto_tree_add_item(ddtp_tree, hf_ddtp_msgtype, offset, 4, pntohl(pd+offset));
+           proto_tree_add_item(ddtp_tree, hf_ddtp_msgtype, NullTVB, offset, 4, pntohl(pd+offset));
            switch (pntohl(pd+offset)) {
            case DDTP_MESSAGE_ERROR :
                offset += 4;
@@ -146,51 +146,51 @@ dissect_ddtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
                offset += 4;
                if (check_col(fd, COL_INFO)) col_add_str (fd, COL_INFO, "Update Query");
                if (!BYTES_ARE_IN_FRAME(offset, 4)) {
-                   proto_tree_add_text(ddtp_tree, offset, END_OF_FRAME-offset, "Frame too short");
+                   proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short");
                    return;
                }
-               proto_tree_add_item(ddtp_tree, hf_ddtp_opcode, offset, 4, pntohl(pd+offset));
+               proto_tree_add_item(ddtp_tree, hf_ddtp_opcode, NullTVB, offset, 4, pntohl(pd+offset));
                offset += 4;
                if (!BYTES_ARE_IN_FRAME(offset, 4)) {
-                   proto_tree_add_text(ddtp_tree, offset, END_OF_FRAME-offset, "Frame too short");
+                   proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short");
                    return;
                }
-               proto_tree_add_item(ddtp_tree, hf_ddtp_ipaddr, offset, 4, pntohl(pd+offset));
+               proto_tree_add_item(ddtp_tree, hf_ddtp_ipaddr, NullTVB, offset, 4, pntohl(pd+offset));
                break;
            case DDTP_UPDATE_REPLY :
                offset += 4;
                if (check_col(fd, COL_INFO)) col_add_str (fd, COL_INFO, "Update Reply");
                if (!BYTES_ARE_IN_FRAME(offset, 4)) {
-                   proto_tree_add_text(ddtp_tree, offset, END_OF_FRAME-offset, "Frame too short");
+                   proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short");
                    return;
                }
-               proto_tree_add_item(ddtp_tree, hf_ddtp_status, offset, 4, pntohl(pd+offset));
+               proto_tree_add_item(ddtp_tree, hf_ddtp_status, NullTVB, offset, 4, pntohl(pd+offset));
                break;
            case DDTP_ALIVE_QUERY :
                offset += 4;
                if (check_col(fd, COL_INFO)) col_add_str (fd, COL_INFO, "Alive Query");
                if (!BYTES_ARE_IN_FRAME(offset, 4)) {
-                   proto_tree_add_text(ddtp_tree, offset, END_OF_FRAME-offset, "Frame too short");
+                   proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short");
                    return;
                }
-               proto_tree_add_text(ddtp_tree, offset, 4, "Dummy : %u", pntohl(pd+offset));
+               proto_tree_add_text(ddtp_tree, NullTVB, offset, 4, "Dummy : %u", pntohl(pd+offset));
                break;
            case DDTP_ALIVE_REPLY :
                offset += 4;
                if (check_col(fd, COL_INFO)) col_add_str (fd, COL_INFO, "Alive Reply");
                if (!BYTES_ARE_IN_FRAME(offset, 4)) {
-                   proto_tree_add_text(ddtp_tree, offset, END_OF_FRAME-offset, "Frame too short");
+                   proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short");
                    return;
                }
-               proto_tree_add_text(ddtp_tree, offset, 4, "Dummy : %u", pntohl(pd+offset));
+               proto_tree_add_text(ddtp_tree, NullTVB, offset, 4, "Dummy : %u", pntohl(pd+offset));
                break;
            default :
                if (check_col(fd, COL_INFO)) col_add_str (fd, COL_INFO, "Unknwon type");
                if (!BYTES_ARE_IN_FRAME(offset, 4)) {
-                   proto_tree_add_text(ddtp_tree, offset, END_OF_FRAME-offset, "Frame too short");
+                   proto_tree_add_text(ddtp_tree, NullTVB, offset, END_OF_FRAME-offset, "Frame too short");
                    return;
                }
-               proto_tree_add_text(ddtp_tree, offset, 4, "Unknown type : %u", pntohl(pd+offset));
+               proto_tree_add_text(ddtp_tree, NullTVB, offset, 4, "Unknown type : %u", pntohl(pd+offset));
            }
        }
    }
index a1ebf6b6ee1bd046953ef03f48c20c25104a4e67..c8e0dac521592944654192c278f9599b0160797f 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-dns.c
  * Routines for DNS packet disassembly
  *
- * $Id: packet-dns.c,v 1.43 2000/04/26 12:01:50 itojun Exp $
+ * $Id: packet-dns.c,v 1.44 2000/05/11 08:15:05 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -542,17 +542,17 @@ dissect_dns_query(const u_char *pd, int offset, int dns_data_offset,
   if (fd != NULL)
     col_append_fstr(fd, COL_INFO, " %s %s", type_name, name);
   if (dns_tree != NULL) {
-    tq = proto_tree_add_text(dns_tree, offset, len, "%s: type %s, class %s", 
+    tq = proto_tree_add_text(dns_tree, NullTVB, offset, len, "%s: type %s, class %s", 
                   name, type_name, class_name);
     q_tree = proto_item_add_subtree(tq, ett_dns_qd);
 
-    proto_tree_add_text(q_tree, offset, name_len, "Name: %s", name);
+    proto_tree_add_text(q_tree, NullTVB, offset, name_len, "Name: %s", name);
     offset += name_len;
 
-    proto_tree_add_text(q_tree, offset, 2, "Type: %s", long_type_name);
+    proto_tree_add_text(q_tree, NullTVB, offset, 2, "Type: %s", long_type_name);
     offset += 2;
 
-    proto_tree_add_text(q_tree, offset, 2, "Class: %s", class_name);
+    proto_tree_add_text(q_tree, NullTVB, offset, 2, "Class: %s", class_name);
     offset += 2;
   }
   
@@ -568,16 +568,16 @@ add_rr_to_tree(proto_item *trr, int rr_type, int offset, const char *name,
   proto_tree *rr_tree;
 
   rr_tree = proto_item_add_subtree(trr, rr_type);
-  proto_tree_add_text(rr_tree, offset, namelen, "Name: %s", name);
+  proto_tree_add_text(rr_tree, NullTVB, offset, namelen, "Name: %s", name);
   offset += namelen;
-  proto_tree_add_text(rr_tree, offset, 2, "Type: %s", type_name);
+  proto_tree_add_text(rr_tree, NullTVB, offset, 2, "Type: %s", type_name);
   offset += 2;
-  proto_tree_add_text(rr_tree, offset, 2, "Class: %s", class_name);
+  proto_tree_add_text(rr_tree, NullTVB, offset, 2, "Class: %s", class_name);
   offset += 2;
-  proto_tree_add_text(rr_tree, offset, 4, "Time to live: %s",
+  proto_tree_add_text(rr_tree, NullTVB, offset, 4, "Time to live: %s",
                                                time_secs_to_str(ttl));
   offset += 4;
-  proto_tree_add_text(rr_tree, offset, 2, "Data length: %u", data_len);
+  proto_tree_add_text(rr_tree, NullTVB, offset, 2, "Data length: %u", data_len);
   return rr_tree;
 }
 
@@ -588,22 +588,22 @@ add_opt_rr_to_tree(proto_item *trr, int rr_type, int offset, const char *name,
   proto_tree *rr_tree;
 
   rr_tree = proto_item_add_subtree(trr, rr_type);
-  proto_tree_add_text(rr_tree, offset, namelen, "Name: %s", name);
+  proto_tree_add_text(rr_tree, NullTVB, offset, namelen, "Name: %s", name);
   offset += namelen;
-  proto_tree_add_text(rr_tree, offset, 2, "Type: %s", type_name);
+  proto_tree_add_text(rr_tree, NullTVB, offset, 2, "Type: %s", type_name);
   offset += 2;
-  proto_tree_add_text(rr_tree, offset, 2, "UDP payload size: %u",
+  proto_tree_add_text(rr_tree, NullTVB, offset, 2, "UDP payload size: %u",
       class & 0xffff);
   offset += 2;
-  proto_tree_add_text(rr_tree, offset, 1, "Higher bits in extended RCODE: 0x%x",
+  proto_tree_add_text(rr_tree, NullTVB, offset, 1, "Higher bits in extended RCODE: 0x%x",
       (ttl >> 24) & 0xff0);
   offset++;
-  proto_tree_add_text(rr_tree, offset, 1, "EDNS0 version: %u",
+  proto_tree_add_text(rr_tree, NullTVB, offset, 1, "EDNS0 version: %u",
       (ttl >> 16) & 0xff);
   offset++;
-  proto_tree_add_text(rr_tree, offset, 2, "Must be zero: 0x%x", ttl & 0xffff);
+  proto_tree_add_text(rr_tree, NullTVB, offset, 2, "Must be zero: 0x%x", ttl & 0xffff);
   offset += 2;
-  proto_tree_add_text(rr_tree, offset, 2, "Data length: %u", data_len);
+  proto_tree_add_text(rr_tree, NullTVB, offset, 2, "Data length: %u", data_len);
   return rr_tree;
 }
 
@@ -676,7 +676,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
   if (fd != NULL)
     col_append_fstr(fd, COL_INFO, " %s", type_name);
   if (dns_tree != NULL) {
-    trr = proto_tree_add_notext(dns_tree, offset,
+    trr = proto_tree_add_notext(dns_tree, NullTVB, offset,
                                (dptr - data_start) + data_len);
     if (type != T_OPT) {
       rr_tree = add_rr_to_tree(trr, ett_dns_rr, offset, name, name_len,
@@ -705,7 +705,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
       proto_item_set_text(trr, "%s: type %s, class %s, addr %s",
                     name, type_name, class_name,
                     ip_to_str((guint8 *)dptr));
-      proto_tree_add_text(rr_tree, cur_offset, 4, "Addr: %s",
+      proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Addr: %s",
                     ip_to_str((guint8 *)dptr));
     }
     break;
@@ -730,7 +730,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
       if (dns_tree != NULL) {
        proto_item_set_text(trr, "%s: type %s, class %s, ns %s",
                       name, type_name, class_name, ns_name);
-       proto_tree_add_text(rr_tree, cur_offset, ns_name_len, "Name server: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, ns_name_len, "Name server: %s",
                        ns_name);
       }
     }
@@ -756,7 +756,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
       if (dns_tree != NULL) {
        proto_item_set_text(trr, "%s: type %s, class %s, cname %s",
                     name, type_name, class_name, cname);
-       proto_tree_add_text(rr_tree, cur_offset, cname_len, "Primary name: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, cname_len, "Primary name: %s",
                        cname);
       }
     }
@@ -789,7 +789,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
       if (dns_tree != NULL) {
        proto_item_set_text(trr, "%s: type %s, class %s, mname %s",
                     name, type_name, class_name, mname);
-       proto_tree_add_text(rr_tree, cur_offset, mname_len, "Primary name server: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, mname_len, "Primary name server: %s",
                       mname);
        cur_offset += mname_len;
       
@@ -798,7 +798,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          /* We ran past the end of the captured data in the packet. */
          return 0;
        }
-       proto_tree_add_text(rr_tree, cur_offset, rname_len, "Responsible authority's mailbox: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, rname_len, "Responsible authority's mailbox: %s",
                       rname);
        cur_offset += rname_len;
 
@@ -807,7 +807,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          return 0;
        }
        serial = pntohl(&pd[cur_offset]);
-       proto_tree_add_text(rr_tree, cur_offset, 4, "Serial number: %u",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Serial number: %u",
                       serial);
        cur_offset += 4;
 
@@ -816,7 +816,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          return 0;
        }
        refresh = pntohl(&pd[cur_offset]);
-       proto_tree_add_text(rr_tree, cur_offset, 4, "Refresh interval: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Refresh interval: %s",
                       time_secs_to_str(refresh));
        cur_offset += 4;
 
@@ -825,7 +825,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          return 0;
        }
        retry = pntohl(&pd[cur_offset]);
-       proto_tree_add_text(rr_tree, cur_offset, 4, "Retry interval: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Retry interval: %s",
                       time_secs_to_str(retry));
        cur_offset += 4;
 
@@ -834,7 +834,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          return 0;
        }
        expire = pntohl(&pd[cur_offset]);
-       proto_tree_add_text(rr_tree, cur_offset, 4, "Expiration limit: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Expiration limit: %s",
                       time_secs_to_str(expire));
        cur_offset += 4;
 
@@ -843,7 +843,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          return 0;
        }
        minimum = pntohl(&pd[cur_offset]);
-       proto_tree_add_text(rr_tree, cur_offset, 4, "Minimum TTL: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Minimum TTL: %s",
                       time_secs_to_str(minimum));
       }
     }
@@ -869,7 +869,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
       if (dns_tree != NULL) {
        proto_item_set_text(trr, "%s: type %s, class %s, ptr %s",
                     name, type_name, class_name, pname);
-       proto_tree_add_text(rr_tree, cur_offset, pname_len, "Domain name: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, pname_len, "Domain name: %s",
                        pname);
       }
       break;
@@ -902,19 +902,19 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
        proto_item_set_text(trr, "%s: type %s, class %s, addr %s",
                     name, type_name, class_name,
                     ip_to_str((guint8 *)dptr));
-       proto_tree_add_text(rr_tree, cur_offset, 4, "Addr: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Addr: %s",
                     ip_to_str((guint8 *)dptr));
        cur_offset += 4;
        rr_len -= 4;
 
        if (!BYTES_ARE_IN_FRAME(cur_offset, 1)) {
          /* We ran past the end of the captured data in the packet. */
-         proto_tree_add_text(rr_tree, cur_offset, END_OF_FRAME,
+         proto_tree_add_text(rr_tree, NullTVB, cur_offset, END_OF_FRAME,
                       "<Protocol goes past end of captured data in packet>");
          return 0;
        }
        protocol = pd[cur_offset];
-       proto_tree_add_text(rr_tree, cur_offset, 1, "Protocol: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 1, "Protocol: %s",
                     ipprotostr(protocol));
        cur_offset += 1;
        rr_len -= 1;
@@ -923,7 +923,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
        while (rr_len != 0) {
          if (!BYTES_ARE_IN_FRAME(cur_offset, 1)) {
            /* We ran past the end of the captured data in the packet. */
-           proto_tree_add_text(rr_tree, cur_offset, END_OF_FRAME,
+           proto_tree_add_text(rr_tree, NullTVB, cur_offset, END_OF_FRAME,
                       "<Bit map goes past end of captured data in packet>");
            return 0;
          }
@@ -954,7 +954,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
              mask >>= 1;
              port_num++;
            }
-           proto_tree_add_text(rr_tree, cur_offset, 1,
+           proto_tree_add_text(rr_tree, NullTVB, cur_offset, 1,
                "Bits: 0x%02x (%s)", bits, bitnames);
          } else
            port_num += 8;
@@ -1020,9 +1020,9 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
                     "%s: type %s, class %s, CPU %.*s, OS %.*s",
                     name, type_name, class_name,
                     cpu_len, &pd[cpu_offset + 1], os_len, &pd[os_offset + 1]);
-       proto_tree_add_text(rr_tree, cpu_offset, 1 + cpu_len, "CPU: %.*s",
+       proto_tree_add_text(rr_tree, NullTVB, cpu_offset, 1 + cpu_len, "CPU: %.*s",
                        cpu_len, &pd[cpu_offset + 1]);
-       proto_tree_add_text(rr_tree, os_offset, 1 + os_len, "OS: %.*s",
+       proto_tree_add_text(rr_tree, NullTVB, os_offset, 1 + os_len, "OS: %.*s",
                        os_len, &pd[os_offset + 1]);
       }
       break;
@@ -1061,8 +1061,8 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
        proto_item_set_text(trr,
                       "%s: type %s, class %s, preference %u, mx %s",
                       name, type_name, class_name, preference, mx_name);
-       proto_tree_add_text(rr_tree, cur_offset, 2, "Preference: %u", preference);
-       proto_tree_add_text(rr_tree, cur_offset + 2, mx_name_len, "Mail exchange: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 2, "Preference: %u", preference);
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset + 2, mx_name_len, "Mail exchange: %s",
                        mx_name);
       }
     }
@@ -1082,18 +1082,18 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
        while (rr_len != 0) {
          if (!BYTES_ARE_IN_FRAME(txt_offset, 1)) {
            /* We ran past the end of the captured data in the packet. */
-           proto_tree_add_text(rr_tree, txt_offset, END_OF_FRAME,
+           proto_tree_add_text(rr_tree, NullTVB, txt_offset, END_OF_FRAME,
                       "<String goes past end of captured data in packet>");
            return 0;
          }
          txt_len = pd[txt_offset];
          if (!BYTES_ARE_IN_FRAME(txt_offset + 1, txt_len)) {
            /* We ran past the end of the captured data in the packet. */
-           proto_tree_add_text(rr_tree, txt_offset, END_OF_FRAME,
+           proto_tree_add_text(rr_tree, NullTVB, txt_offset, END_OF_FRAME,
                       "<String goes past end of captured data in packet>");
            return 0;
          }
-         proto_tree_add_text(rr_tree, txt_offset, 1 + txt_len,
+         proto_tree_add_text(rr_tree, NullTVB, txt_offset, 1 + txt_len,
           "Text: %.*s", txt_len, &pd[txt_offset + 1]);
          txt_offset += 1 + txt_len;
          rr_len -= 1 + txt_len;
@@ -1117,7 +1117,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          /* We ran past the end of the captured data in the packet. */
          return 0;
         }
-       proto_tree_add_text(rr_tree, cur_offset, 2, "Type covered: %s (%s)",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 2, "Type covered: %s (%s)",
                dns_type_name(pntohs(&pd[cur_offset])),
                dns_long_type_name(pntohs(&pd[cur_offset])));
        cur_offset += 2;
@@ -1127,7 +1127,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          /* We ran past the end of the captured data in the packet. */
          return 0;
        }
-       proto_tree_add_text(rr_tree, cur_offset, 1, "Algorithm: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 1, "Algorithm: %s",
                val_to_str(pd[cur_offset], algo_vals,
                    "Unknown (0x%02X)"));
        cur_offset += 1;
@@ -1137,7 +1137,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          /* We ran past the end of the captured data in the packet. */
          return 0;
        }
-       proto_tree_add_text(rr_tree, cur_offset, 1, "Labels: %u",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 1, "Labels: %u",
                pd[cur_offset]);
        cur_offset += 1;
        rr_len -= 1;
@@ -1146,7 +1146,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          /* We ran past the end of the captured data in the packet. */
          return 0;
        }
-       proto_tree_add_text(rr_tree, cur_offset, 4, "Original TTL: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Original TTL: %s",
                time_secs_to_str(pntohl(&pd[cur_offset])));
        cur_offset += 4;
        rr_len -= 4;
@@ -1157,7 +1157,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
        }
        unixtime.tv_sec = pntohl(&pd[cur_offset]);
        unixtime.tv_usec = 0;
-       proto_tree_add_text(rr_tree, cur_offset, 4, "Signature expiration: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Signature expiration: %s",
                abs_time_to_str(&unixtime));
        cur_offset += 4;
        rr_len -= 4;
@@ -1168,7 +1168,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
        }
        unixtime.tv_sec = pntohl(&pd[cur_offset]);
        unixtime.tv_usec = 0;
-       proto_tree_add_text(rr_tree, cur_offset, 4, "Time signed: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Time signed: %s",
                abs_time_to_str(&unixtime));
        cur_offset += 4;
        rr_len -= 4;
@@ -1177,7 +1177,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          /* We ran past the end of the captured data in the packet. */
          return 0;
        }
-       proto_tree_add_text(rr_tree, cur_offset, 2, "Key footprint: 0x%04x",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 2, "Key footprint: 0x%04x",
                pntohs(&pd[cur_offset]));
        cur_offset += 2;
        rr_len -= 2;
@@ -1187,12 +1187,12 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          /* We ran past the end of the captured data in the packet. */
          return 0;
        }
-       proto_tree_add_text(rr_tree, cur_offset, signer_name_len,
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, signer_name_len,
                "Signer's name: %s", signer_name);
        cur_offset += signer_name_len;
        rr_len -= signer_name_len;
 
-       proto_tree_add_text(rr_tree, cur_offset, rr_len, "Signature");
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, rr_len, "Signature");
       }
     }
     break;
@@ -1213,43 +1213,43 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          return 0;
         }
         flags = pntohs(&pd[cur_offset]);
-       tf = proto_tree_add_text(rr_tree, cur_offset, 2, "Flags: 0x%04X", flags);
+       tf = proto_tree_add_text(rr_tree, NullTVB, cur_offset, 2, "Flags: 0x%04X", flags);
        flags_tree = proto_item_add_subtree(tf, ett_t_key_flags);
-       proto_tree_add_text(flags_tree, cur_offset, 2, "%s",
+       proto_tree_add_text(flags_tree, NullTVB, cur_offset, 2, "%s",
                decode_boolean_bitfield(flags, 0x8000,
                  2*8, "Key prohibited for authentication",
                       "Key allowed for authentication"));
-       proto_tree_add_text(flags_tree, cur_offset, 2, "%s",
+       proto_tree_add_text(flags_tree, NullTVB, cur_offset, 2, "%s",
                decode_boolean_bitfield(flags, 0x4000,
                  2*8, "Key prohibited for confidentiality",
                       "Key allowed for confidentiality"));
        if ((flags & 0xC000) != 0xC000) {
          /* We have a key */
-         proto_tree_add_text(flags_tree, cur_offset, 2, "%s",
+         proto_tree_add_text(flags_tree, NullTVB, cur_offset, 2, "%s",
                decode_boolean_bitfield(flags, 0x2000,
                  2*8, "Key is experimental or optional",
                       "Key is required"));
-         proto_tree_add_text(flags_tree, cur_offset, 2, "%s",
+         proto_tree_add_text(flags_tree, NullTVB, cur_offset, 2, "%s",
                decode_boolean_bitfield(flags, 0x0400,
                  2*8, "Key is associated with a user",
                       "Key is not associated with a user"));
-         proto_tree_add_text(flags_tree, cur_offset, 2, "%s",
+         proto_tree_add_text(flags_tree, NullTVB, cur_offset, 2, "%s",
                decode_boolean_bitfield(flags, 0x0200,
                  2*8, "Key is associated with the named entity",
                       "Key is not associated with the named entity"));
-         proto_tree_add_text(flags_tree, cur_offset, 2, "%s",
+         proto_tree_add_text(flags_tree, NullTVB, cur_offset, 2, "%s",
                decode_boolean_bitfield(flags, 0x0100,
                  2*8, "This is the zone key for the specified zone",
                       "This is not a zone key"));
-         proto_tree_add_text(flags_tree, cur_offset, 2, "%s",
+         proto_tree_add_text(flags_tree, NullTVB, cur_offset, 2, "%s",
                decode_boolean_bitfield(flags, 0x0080,
                  2*8, "Key is valid for use with IPSEC",
                       "Key is not valid for use with IPSEC"));
-         proto_tree_add_text(flags_tree, cur_offset, 2, "%s",
+         proto_tree_add_text(flags_tree, NullTVB, cur_offset, 2, "%s",
                decode_boolean_bitfield(flags, 0x0040,
                  2*8, "Key is valid for use with MIME security multiparts",
                       "Key is not valid for use with MIME security multiparts"));
-         proto_tree_add_text(flags_tree, cur_offset, 2, "%s",
+         proto_tree_add_text(flags_tree, NullTVB, cur_offset, 2, "%s",
                decode_numeric_bitfield(flags, 0x000F,
                  2*8, "Signatory = %u"));
        }
@@ -1260,7 +1260,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          /* We ran past the end of the captured data in the packet. */
          return 0;
        }
-       proto_tree_add_text(rr_tree, cur_offset, 1, "Protocol: %u",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 1, "Protocol: %u",
                pd[cur_offset]);
        cur_offset += 1;
        rr_len -= 1;
@@ -1269,13 +1269,13 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          /* We ran past the end of the captured data in the packet. */
          return 0;
        }
-       proto_tree_add_text(rr_tree, cur_offset, 1, "Algorithm: %s",
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 1, "Algorithm: %s",
                val_to_str(pd[cur_offset], algo_vals,
                    "Unknown (0x%02X)"));
        cur_offset += 1;
                rr_len -= 1;
 
-       proto_tree_add_text(rr_tree, cur_offset, rr_len, "Public key");
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, rr_len, "Public key");
       }
     }
     break;
@@ -1298,7 +1298,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
       proto_item_set_text(trr, "%s: type %s, class %s, addr %s",
                     name, type_name, class_name,
                     ip6_to_str((struct e_in6_addr *)dptr));
-      proto_tree_add_text(rr_tree, cur_offset, 16, "Addr: %s",
+      proto_tree_add_text(rr_tree, NullTVB, cur_offset, 16, "Addr: %s",
                     ip6_to_str((struct e_in6_addr *)dptr));
     }
     break;
@@ -1313,7 +1313,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          /* We ran past the end of the captured data in the packet. */
          return 0;
        }
-       proto_tree_add_text(rr_tree, cur_offset, 1, "Version: %u", pd[cur_offset]);
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, 1, "Version: %u", pd[cur_offset]);
        if (pd[cur_offset] == 0) {
          /* Version 0, the only version RFC 1876 discusses. */
          cur_offset++;
@@ -1322,7 +1322,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
                    /* We ran past the end of the captured data in the packet. */
            return 0;
          }
-         proto_tree_add_text(rr_tree, cur_offset, 1, "Size: %g m",
+         proto_tree_add_text(rr_tree, NullTVB, cur_offset, 1, "Size: %g m",
                                rfc1867_size(pd[cur_offset]));
          cur_offset++;
 
@@ -1330,7 +1330,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
                    /* We ran past the end of the captured data in the packet. */
            return 0;
          }
-         proto_tree_add_text(rr_tree, cur_offset, 1, "Horizontal precision: %g m",
+         proto_tree_add_text(rr_tree, NullTVB, cur_offset, 1, "Horizontal precision: %g m",
                                rfc1867_size(pd[cur_offset]));
          cur_offset++;
 
@@ -1338,7 +1338,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
                    /* We ran past the end of the captured data in the packet. */
            return 0;
          }
-         proto_tree_add_text(rr_tree, cur_offset, 1, "Vertical precision: %g m",
+         proto_tree_add_text(rr_tree, NullTVB, cur_offset, 1, "Vertical precision: %g m",
                                rfc1867_size(pd[cur_offset]));
          cur_offset++;
 
@@ -1346,7 +1346,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
            /* We ran past the end of the captured data in the packet. */
            return 0;
          }
-         proto_tree_add_text(rr_tree, cur_offset, 4, "Latitude: %s",
+         proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Latitude: %s",
                                rfc1867_angle(&pd[cur_offset], "NS"));
          cur_offset += 4;
 
@@ -1354,7 +1354,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
            /* We ran past the end of the captured data in the packet. */
            return 0;
          }
-         proto_tree_add_text(rr_tree, cur_offset, 4, "Longitude: %s",
+         proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Longitude: %s",
                                rfc1867_angle(&pd[cur_offset], "EW"));
          cur_offset += 4;
 
@@ -1362,10 +1362,10 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
            /* We ran past the end of the captured data in the packet. */
            return 0;
          }
-         proto_tree_add_text(rr_tree, cur_offset, 4, "Altitude: %g m",
+         proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Altitude: %g m",
                                (pntohl(&pd[cur_offset]) - 10000000)/100.0);
        } else
-         proto_tree_add_text(rr_tree, cur_offset, data_len, "Data");
+         proto_tree_add_text(rr_tree, NullTVB, cur_offset, data_len, "Data");
       }
       break;
     }
@@ -1397,7 +1397,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
       if (dns_tree != NULL) {
        proto_item_set_text(trr, "%s: type %s, class %s, next domain name %s",
                     name, type_name, class_name, next_domain_name);
-       proto_tree_add_text(rr_tree, cur_offset, next_domain_name_len,
+       proto_tree_add_text(rr_tree, NullTVB, cur_offset, next_domain_name_len,
                        "Next domain name: %s", next_domain_name);
        cur_offset += next_domain_name_len;
        rr_len -= next_domain_name_len;
@@ -1405,7 +1405,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
        while (rr_len != 0) {
          if (!BYTES_ARE_IN_FRAME(cur_offset, 1)) {
            /* We ran past the end of the captured data in the packet. */
-           proto_tree_add_text(rr_tree, cur_offset, END_OF_FRAME,
+           proto_tree_add_text(rr_tree, NullTVB, cur_offset, END_OF_FRAME,
                       "<Bit map goes past end of captured data in packet>");
            return 0;
          }
@@ -1413,7 +1413,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
          mask = 1<<7;
          for (i = 0; i < 8; i++) {
            if (bits & mask) {
-           &