From chuck@research.xxx.com Mon Aug 26 19:20:10 2002 Date: Mon, 26 Aug 2002 22:20:08 -0400 From: Chuck Cranor Subject: microannex http://www.ofb.net/~jheiss/annex/ for used annex, certainly the best thing to do is use the test button and do the ROM "erase" command. this gets you a clean, factory reset box. otherwise, you may inherit some strange config from the previous owner. the really nice thing about the annex is that all the unix hosted tools are included, in source form, in the tarball. the unfortunate thing is that there were bugs in the source code that prevented compiling on BSD (i'm using NetBSD) and also caused the "na" program to malfunction (this is true for the R10.0B-R2.3.tar.Z file at any rate, other versions are a bit better). i debugged the whole thing and now have "na" working properly. will include diffs below. you didn't say much about the "na" program. that is very useful because you can use it to save and restore your annex config from a text file on unix, like this: root_xbsd[8]# ./na Annex network administrator NA_R3.1 October 22, 1997 command: annex annex Password for 135.207.19.31 : annex: Micro-Annex-UX R10.0, 16 async ports command: write annex identifier: annex annex: Micro-Annex-UX R10.0, 16 async ports filename: /tmp/config.save writing... command: quit root_xbsd[9]# head /tmp/config.save # annex annex echo setting annex parameters set annex subnet_mask 255.255.240.0 set annex pref_load_addr 135.207.27.209 set annex pref_dump_addr 0.0.0.0 set annex load_broadcast N set annex broadcast_addr 135.207.31.255 set annex load_dump_gateway 135.207.31.1 set annex load_dump_sequence net root_xbsd[10]# (also makes it easier to play with config because you can browse that file look for interesting things you can type into "na" (or cli's admin) and have the correct syntax on hand). chuck Index: erpcd/acp_lib.c =================================================================== RCS file: /n/ha176/cvs/annexsrc/erpcd/acp_lib.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** acp_lib.c 2002/08/23 14:27:44 1.1.1.1 --- acp_lib.c 2002/08/23 14:30:34 1.2 *************** *** 2437,2443 **** int acp_annex_status_return(msg) struct annex_status_return *msg; { ! if (msg->errno == ESUCCESS)return(TRUE); else return(FALSE); } --- 2437,2443 ---- int acp_annex_status_return(msg) struct annex_status_return *msg; { ! if (msg->xerrno == ESUCCESS)return(TRUE); else return(FALSE); } Index: erpcd/acp_lib.h =================================================================== RCS file: /n/ha176/cvs/annexsrc/erpcd/acp_lib.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** acp_lib.h 2002/08/23 14:27:44 1.1.1.1 --- acp_lib.h 2002/08/23 14:30:04 1.2 *************** *** 9,15 **** #ifndef _WIN32 /* is this needed at all? */ struct annex_status_return { ! int errno; }; #endif /* not _WIN32 */ --- 9,15 ---- #ifndef _WIN32 /* is this needed at all? */ struct annex_status_return { ! int xerrno; }; #endif /* not _WIN32 */ Index: erpcd/session_dbunx.c =================================================================== RCS file: /n/ha176/cvs/annexsrc/erpcd/session_dbunx.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** session_dbunx.c 2002/08/23 14:27:44 1.1.1.1 --- session_dbunx.c 2002/08/23 14:33:11 1.2 *************** *** 117,123 **** --- 117,127 ---- key_t sem_key = 0; /* semaphore key */ int Asemid; /* Access semaphore id */ + #if defined(__NetBSD__) + int ctlinit; + #else union semun ctlinit; /* arg struct for semctl */ + #endif /* sembuf elements: index, op, flag */ struct sembuf sopwait = {0,-1, SEM_UNDO}; /* wait for semaphore */ struct sembuf soppost = {0, 1, SEM_UNDO}; /* set value to available */ *************** *** 290,296 **** --- 294,304 ---- return errno; } } + #if defined(__NetBSD__) + ctlinit = 1; + #else ctlinit.val = 1; + #endif if (semctl(Asemid, 0, SETVAL, ctlinit) == -1) { #ifdef USE_SYSLOG syslog(LOG_CRIT, "%s: Set semaphore, semctl error %d. No database access.", appname, errno); Index: erpcd/spy.c =================================================================== RCS file: /n/ha176/cvs/annexsrc/erpcd/spy.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** spy.c 2002/08/23 14:27:43 1.1.1.1 --- spy.c 2002/08/23 14:33:23 1.2 *************** *** 35,41 **** --- 35,43 ---- int debug = 0; extern int errno; + #if !defined(__NetBSD__) extern char *sys_errlist[]; /* errno strings */ + #endif static void timeout(); Index: inc/na/cmd.h =================================================================== RCS file: /n/ha176/cvs/annexsrc/inc/na/cmd.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** cmd.h 2002/08/23 14:27:33 1.1.1.1 --- cmd.h 2002/08/23 15:01:27 1.2 *************** *** 1881,1893 **** , { 0, 0, 0, V_BIG_BIRD_N, V_BIG_BIRD_N, 0, V_BIG_BIRD_N, V_PRIMATE_N } #endif }, ! #ifndef NA {ARPT_TTKILLC, DFE_CAT, DFE_ARPT_TTKILLC , B_GENERIC_CAT, CARDINAL_P, CNV_BYTE #ifdef NA , { 0, 0, 0, 0, 0, 0, 0, 0 } #endif }, - #endif {FAIL_TO_CONNECT, DFE_CAT, DFE_FAIL_TO_CONNECT, B_GENERIC_CAT, CARDINAL_P, CNV_INT #ifdef NA , { 0, 0, 0, V_14_0_N, V_14_0_N, 0, 0, V_14_0_N } --- 1881,1892 ---- , { 0, 0, 0, V_BIG_BIRD_N, V_BIG_BIRD_N, 0, V_BIG_BIRD_N, V_PRIMATE_N } #endif }, ! /* XXXCDC: was ifndef NA, need this or indexs off by 1! */ {ARPT_TTKILLC, DFE_CAT, DFE_ARPT_TTKILLC , B_GENERIC_CAT, CARDINAL_P, CNV_BYTE #ifdef NA , { 0, 0, 0, 0, 0, 0, 0, 0 } #endif }, {FAIL_TO_CONNECT, DFE_CAT, DFE_FAIL_TO_CONNECT, B_GENERIC_CAT, CARDINAL_P, CNV_INT #ifdef NA , { 0, 0, 0, V_14_0_N, V_14_0_N, 0, 0, V_14_0_N } Index: inc/na/help.h =================================================================== RCS file: /n/ha176/cvs/annexsrc/inc/na/help.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -c -r1.1.1.1 -r1.2 *** help.h 2002/08/23 14:27:33 1.1.1.1 --- help.h 2002/08/23 14:39:29 1.2 *************** *** 298,311 **** , "Show the AppleTalk subset of port parameters" #endif /* NA */ }, ! #ifndef NA {"arpt_kill_timer", BOX_PARAM, ARPT_TTKILLC #ifdef NA , "Time for a temporary created entry in an ARP Table to remain active.\n\t\ Value in minutes: range 1 to 255, default value is 20 minutes." #endif /* NA */ }, - #endif {"arap_v42bis", PORT_PARAM, P_ARAP_V42BIS #ifdef NA , "Allow the enabling of V.42bis compression\n\t\ --- 298,310 ---- , "Show the AppleTalk subset of port parameters" #endif /* NA */ }, ! /* XXXCDC: was ifndef NA, need this or annex_params[26] is null! */ {"arpt_kill_timer", BOX_PARAM, ARPT_TTKILLC #ifdef NA , "Time for a temporary created entry in an ARP Table to remain active.\n\t\ Value in minutes: range 1 to 255, default value is 20 minutes." #endif /* NA */ }, {"arap_v42bis", PORT_PARAM, P_ARAP_V42BIS #ifdef NA , "Allow the enabling of V.42bis compression\n\t\