INFO Patch TNT V1.1alpha2 ------------------------- Hello, TNT V1.1alpha1 did not compile with module-xx-patched 2.0.x-kernels or 2.1.x-kernels and the 2.1.22b-ax25-utilities. Apply the following patch and you can compile and use TNT. It was tested with Kernel 2.0.29 with module-12 and ax25-utilities 2.1.22b. Of course the 'lib'-link in the source directory of TNT must point to the 'lib'-directory of the ax25-utilities 2.1.22b. Thanks to Jonathan, G4KLX and Joerg, DL1BKE for patches. As Rose and Netrom support needs some restructuring of the code, support for these will follow later. 73, Mark -----------------------------------snip--------------------------------------- diff -u tnt1.1/ax25k.c tnt1.1a2/ax25k.c --- tnt1.1/ax25k.c Sun Mar 9 14:20:01 1997 +++ tnt1.1a2/ax25k.c Mon Mar 31 18:18:50 1997 @@ -3,7 +3,7 @@ For license details see documentation Procedures for interfacing AX25-Kernel (ax25k.c) created: Mark Wahl DL4YBG 97/02/09 - updated: Mark Wahl DL4YBG 97/03/09 + updated: Mark Wahl DL4YBG 97/03/31 */ #include "tnt.h" @@ -20,7 +20,13 @@ #include #include +#ifndef SIOCAX25GETPARMS +#define NEW_KERNEL +#endif #include +#ifdef NEW_KERNEL +#include +#endif #include /* includes from ax25 utilities */ @@ -71,6 +77,47 @@ extern char ok_text[]; extern int is_root; +#ifdef NEW_KERNEL +enum { + AX25_VALUES_IPDEFMODE, + AX25_VALUES_AXDEFMODE, + AX25_VALUES_BACKOFF, + AX25_VALUES_CONMODE, + AX25_VALUES_WINDOW, + AX25_VALUES_EWINDOW, + AX25_VALUES_T1, + AX25_VALUES_T2, + AX25_VALUES_T3, + AX25_VALUES_N2, + AX25_VALUES_DIGI, + AX25_VALUES_IDLE, + AX25_VALUES_PACLEN, + AX25_VALUES_MAXQUEUE, + AX25_VALUES_PROTOCOL, + AX25_VALUES_DS_TIMEOUT, + AX25_MAX_VALUES +}; + +static char * AXParamTable[AX25_MAX_VALUES] = { + "ip_default_mode", + "ax25_default_mode", + "backoff_type", + "connect_mode", + "standard_window_size", + "extended_window_size", + "t1_timeout", + "t2_timeout", + "t3_timeout", + "maximum_retry_count", + "digipeat_mode", /* gone with the wind... */ + "idle_timeout", + "maximum_packet_length", + "maxqueue", /* gone... */ + "protocol", + "dama_slave_timeout" +}; +#endif + struct ax25k_stat { int fd; int af_type; @@ -1488,6 +1535,38 @@ unsigned short *value; int change; { +#ifdef NEW_KERNEL +/* dl1bke 970319: set AX.25 parameters for newer kernels through + * /proc/sys/net/ax25... Sadly we cannot use + * sysctl() as I forgot an entry that gives back + * the device name, argh. OTOH this hack doesn't look + * that bad, anyway... + */ + char *dev; + char path[128]; + FILE *fp; + + if ((dev = ax25_config_get_dev(port)) == NULL) + return -1; + + sprintf(path, PROC_AX25_SYSCTL_DIR"/%s/%s", dev, AXParamTable[value_nr]); + + if (!change) + { + fp = fopen(path, "r"); + if (fp == NULL) + return -1; + fscanf(fp, "%hd", value); + } else { + fp = fopen(path, "w"); + if (fp == NULL) + return -1; + fprintf(fp, "%d\n", *value); + } + + fclose(fp); + return 0; +#else struct ax25_parms_struct ax25_parms; ax25_address callsign; char *addr; @@ -1520,6 +1599,7 @@ } close(sfd); return 0; +#endif } static void ax_value(int channel,char *data,int len,int value_nr, @@ -1562,6 +1642,12 @@ } else { err = handle_parms(port,value_nr,&value,0); +#ifdef NEW_KERNEL + if (sockopt_nr == AX25_BACKOFF) { + if (value) value = 'E'; + else value = 'L'; + } +#endif } if (err == -1) { cmd_display(req_flag,channel,errparms_txt,1); @@ -1622,6 +1708,12 @@ &value_int,value_len); } else { +#ifdef NEW_KERNEL + if (sockopt_nr == AX25_BACKOFF) { + if (value == 'E') value = 1; + else value = 0; + } +#endif err = handle_parms(port,value_nr,&value,1); } if (err == -1) { diff -u tnt1.1/main.c tnt1.1a2/main.c --- tnt1.1/main.c Sun Mar 9 15:13:05 1997 +++ tnt1.1a2/main.c Mon Mar 31 17:39:09 1997 @@ -3,11 +3,11 @@ For license details see documentation Main procedure (main.c) created: Mark Wahl DL4YBG 93/08/07 - updated: Mark Wahl DL4YBG 97/03/09 + updated: Mark Wahl DL4YBG 97/03/31 */ #include "tnt.h" -#define TNT_DATE "97/03/09" -#define TNT_VERSION "V1.1alpha1" +#define TNT_DATE "97/03/31" +#define TNT_VERSION "V1.1alpha2" #ifdef USE_AX25K #ifdef BCAST #define TNT_VERSION_ADD "(AX25K,BC)" ------------------------------------snip-------------------------------------- ------------------------------------------------------------------------ Mark Wahl, DL4YBG EMAIL: wahlm@berlin.snafu.de WWW: http://www.snafu.de/~wahlm/ HamRadio: DL4YBG @ DB0GR.#BLN.DEU.EU ------------------------------------------------------------------------