Re: [tkined] Source code preview

Viktor Dukhovni (Viktor-Dukhovni@deshaw.com)
Wed, 08 Apr 1998 11:33:13 -0400

>Yes. You can find a snapshot of my sources at:

>ftp://ftp.ibr.cs.tu-bs.de/pub/local/tkined/devel/scotty-98-02-20.tar.gz

>Note: This is a development snapshot. Things might not even compile
>or they might crash. The documentation is not necessarily up-to-date
>with the implementation. Use at your own risk.
> Juergen

Here are some bug fixes for the 98-02-20 snapshot:

1) The ASN.1 decoder breaks on value lengths between 128 and 256.
This is because right shifts of signed ints are sign extended. Fix
is to use an unsigned shift.

2) Fixes to make it possible to build tnm outside the source tree
using /path/to/src/configure ...

3) Mib installation would try to install "CVS" directories. Now
skip directories when copying mibs.

4) Changed --with-tcl-config to --with-tcl to be consistent with Tk.
(see tk/unix/configure.in). I am building multiple Tcl extensions using
a uniform set of configure options, and each extension seems to have a
slightly different way of specifying the location of Tcl and Tk. I am
trying to convince the various maintainers to use --with-{tcl,tk} to
specify the directories of {tcl,tk}Config.sh

Index: tnm/snmp/tnmAsn1.c
===================================================================
RCS file: /u/viktor/cvs/tcl/vspecific/scotty/tnm/snmp/tnmAsn1.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 tnmAsn1.c
--- tnmAsn1.c 1998/03/27 19:36:18 1.1.1.2
+++ tnmAsn1.c 1998/03/28 06:43:34
@@ -447,7 +447,7 @@
}
memcpy((char *) length, (char *) packet + 1, (int) *packet);
*length = ntohl(*length);
- *length >>= ( 8 * ( (sizeof(*length)) - (int) *packet));
+ *(u_int *)length >>= ( 8 * ( (sizeof(*length)) - (int) *packet));

*packetlen += ( 1 + *packet );
packet += ( 1 + *packet );
Index: unix/Makefile.in
===================================================================
RCS file: /u/viktor/cvs/tcl/vspecific/scotty/unix/Makefile.in,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 Makefile.in
--- Makefile.in 1998/03/27 19:36:31 1.1.1.2
+++ Makefile.in 1998/03/28 03:48:31
@@ -444,12 +444,12 @@
tnm$(SHLIB_SUFFIX): $(TNM_OBJS)
$(SHLIB_LD) $(TNM_OBJS) -o tnm$(SHLIB_SUFFIX) $(LIBS)

-tkined: tkined$(SHLIB_SUFFIX) tkined.in
+tkined: tkined$(SHLIB_SUFFIX) $(UNIX_DIR)/tkined.in
@sed -e 's+%WISH%+$(TK_WISH)+' \
-e 's+%TCL_VERSION%+$(TCL_VERSION)+' \
-e 's+%TK_VERSION%+$(TK_VERSION)+' \
-e 's+%TKI_VERSION%+$(TKI_VERSION)+' \
- tkined.in > tkined
+ $(UNIX_DIR)/tkined.in > tkined

tkined$(SHLIB_SUFFIX): $(TKI_GENERIC_OBJS)
$(SHLIB_LD) $(TKI_GENERIC_OBJS) -o tkined$(SHLIB_SUFFIX) $(LIBS)
@@ -550,6 +550,7 @@
done;
@for i in $(TNM_MIB_DIR)/* ; \
do \
+ if [ -d $$i ]; then continue; fi;\
echo "Installing $$i"; \
$(INSTALL_DATA) $$i $(TNM_INSTALL_DIR)/mibs ; \
done
@@ -661,7 +662,7 @@
fi; \
done;
@echo "Installing tkined$(TKI_VERSION) and tkined$(TKI_VERSION)$(SHLIB_SUFFIX)"
- @$(INSTALL_PROGRAM) $(UNIX_DIR)/tkined $(BIN_INSTALL_DIR)/tkined$(TKI_VERSION)
+ @$(INSTALL_PROGRAM) tkined $(BIN_INSTALL_DIR)/tkined$(TKI_VERSION)
@$(INSTALL_DATA) tkined$(SHLIB_SUFFIX) $(LIB_RUNTIME_DIR)/tkined$(TKI_VERSION)$(SHLIB_SUFFIX)
@chmod 555 $(LIB_RUNTIME_DIR)/tkined$(TKI_VERSION)$(SHLIB_SUFFIX)
@echo 'package ifneeded Tkined $(TKI_VERSION) "load $(LIB_RUNTIME_DIR)/tkined$(TKI_VERSION)[info sharedlibextension]"' > $(TKI_INSTALL_DIR)/pkgIndex.tcl
Index: unix/configure.in
===================================================================
RCS file: /u/viktor/cvs/tcl/vspecific/scotty/unix/configure.in,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 configure.in
--- configure.in 1998/03/27 19:36:32 1.1.1.2
+++ configure.in 1998/03/27 19:51:48
@@ -33,8 +33,8 @@
tclsh_prefix=`dirname $tclsh_prefix`
fi

-AC_ARG_WITH(tcl-config,
- [ --with-tcl-config=DIR path to the tcl configuration file],
+AC_ARG_WITH(tcl,
+ [ --with-tcl=DIR path to the tcl configuration file],
tnm_path_tcl_config=$withval)

dirs="$tnm_path_tcl_config $prefix/lib $tclsh_prefix/lib /usr/local/lib"
@@ -53,7 +53,7 @@
done

if test "$found" -eq 0 ; then
- AC_MSG_ERROR([tclConfig.sh not found - use the --with-tcl-config option])
+ AC_MSG_ERROR([tclConfig.sh not found - use the --with-tcl option])
fi

. $tnm_cv_path_tcl_config/tclConfig.sh
@@ -87,8 +87,8 @@
wish_prefix=`dirname $wish_prefix`
fi

-AC_ARG_WITH(tk-config,
- [ --with-tk-config=DIR path to the tk configuration file],
+AC_ARG_WITH(tk,
+ [ --with-tk=DIR path to the tk configuration file],
tnm_path_tk_config=$withval)

dirs="$tnm_path_tk_config $prefix/lib $wish_prefix/lib /usr/local/lib"
@@ -107,7 +107,7 @@
done

if test "$found" -eq 0 ; then
- AC_MSG_ERROR("tkConfig.sh not found - use the --with-tk-config option")
+ AC_MSG_ERROR("tkConfig.sh not found - use the --with-tk option")
fi

. $tnm_cv_path_tk_config/tkConfig.sh

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.