Commit 1fdd018d authored by Ben Avison's avatar Ben Avison
Browse files

Brought up-to-date with respect to Tungsten ROM releases - sources from

Kevin's hard disc.
Also automated version numbering of !Run/!Boot/!Help/AUNMap.

Version 5.42. Tagged as 'Internet-5_42'
parent a4b3fb30
**/s/** gitlab-language=armasm linguist-language=armasm linguist-detectable=true
awk/** gitlab-language=awk linguist-language=awk linguist-detectable=true
**/c/** gitlab-language=c linguist-language=c linguist-detectable=true
**/h/** gitlab-language=c linguist-language=c linguist-detectable=true
......@@ -42,6 +42,7 @@ ATTR = -attr
CP = copy
RM = remove
WIPE = -wipe
AWK = GNU.gawk
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
......@@ -58,8 +59,6 @@ COMMONFILES=\
${SDIR}.sysctl.SysCtl\
${SDIR}.traceroute.TraceRoute
# ${SDIR}.utils.utl.X
STBFILES=${SDIR}.pong.Pong
DISCFILES= ${RDIR}.!Boot\
......@@ -90,6 +89,22 @@ FILES=\
${COMMONFILES} \
${DISCFILES} \
${STBFILE}
BAREMINUTILS = \
${SDIR}.ifconfig.IfConfig \
${SDIR}.ping.Ping \
${RDIR}.!Boot
EMERGENCYUTILS = \
${SDIR}.arp.ARP \
${SDIR}.ifconfig.IfConfig \
${SDIR}.ping.Ping \
${SDIR}.pong.Pong \
${SDIR}.utils.utl.CheckMem \
${SDIR}.newfiler.NewFiler \
${SDIR}.sysctl.SysCtl \
${RDIR}.!Boot \
${RDIR}.!Run \
NETUTILS = \
${SDIR}.arp.ARP \
......@@ -136,7 +151,7 @@ install_common: ${COMMONFILES}
install_STB: ${STBFILES}
${MKDIR} ${INSTAPP}.files
${CP} LocalUserIFRes:!Boot ${INSTAPP}.!Boot ${CPFLAGS}
${AWK} -f awk.Version LocalUserIFRes:!Boot > ${INSTAPP}.!Boot
${CP} LocalUserIFRes:CopyLocal ${INSTAPP}.CopyLocal ${CPFLAGS}
${CP} LocalUserIFRes:RTime ${INSTAPP}.bin.RTime ${CPFLAGS}
${CP} ${SDIR}.pong.Pong ${INSTAPP}.bin.Pong ${CPFLAGS}
......@@ -147,9 +162,9 @@ install_STB: ${STBFILES}
${CP} ${RDIR}.files.Services ${INSTAPP}.files.Services ${CPFLAGS}
install_: ${DISCFILES} dirs
${CP} ${RDIR}.!Boot ${INSTAPP}.!Boot ${CPFLAGS}
${CP} ${LDIR}.!Help ${INSTAPP}.!Help ${CPFLAGS}
${CP} ${RDIR}.!Run ${INSTAPP}.!Run ${CPFLAGS}
${AWK} -f awk.Version ${RDIR}.!Boot > ${INSTAPP}.!Boot
${AWK} -f awk.Version ${LDIR}.!Help > ${INSTAPP}.!Help
${AWK} -f awk.Version ${RDIR}.!Run > ${INSTAPP}.!Run
${CP} ${RDIR}.!Sprites ${INSTAPP}.!Sprites ${CPFLAGS}
${CP} ${RDIR}.!Sprites22 ${INSTAPP}.!Sprites22 ${CPFLAGS}
${CP} ${RDIR}.bin ${INSTAPP}.bin ${CPFLAGS}
......@@ -202,17 +217,47 @@ resources-NetUtils: ${NETUTILS}
${CP} ${SDIR}.sysctl.SysCtl ${RESD}.bin.SysCtl ${CPFLAGS}
${CP} ${SDIR}.showstat.ShowStat ${RESD}.bin.ShowStat ${CPFLAGS}
${CP} ${SDIR}.traceroute.TraceRoute ${RESD}.bin.TraceRoute ${CPFLAGS}
${CP} ${SDIR}.utils.utl.X ${RESD}.bin.X ${CPFLAGS}
${CP} ${RDIR}.files.AUNMap ${RESD}.files.AUNMap ${CPFLAGS}
${AWK} -f awk.Version ${RDIR}.files.AUNMap > ${RESD}.files.AUNMap
${CP} ${RDIR}.files.Hosts ${RESD}.files.Hosts ${CPFLAGS}
${CP} ${RDIR}.files.Networks ${RESD}.files.Networks ${CPFLAGS}
${CP} ${RDIR}.files.Protocols ${RESD}.files.Protocols ${CPFLAGS}
${CP} ${RDIR}.files.Services ${RESD}.files.Services ${CPFLAGS}
${CP} ${RDIR}.!Boot ${RESD}.!Boot ${CPFLAGS}
${CP} ${RDIR}.!Run ${RESD}.!Run ${CPFLAGS}
${AWK} -f awk.Version ${RDIR}.!Boot > ${RESD}.!Boot
${AWK} -f awk.Version ${RDIR}.!Run > ${RESD}.!Run
${CP} ${RDIR}.!Sprites ${RESD}.!Sprites ${CPFLAGS}
${CP} ${RDIR}.!Sprites22 ${RESD}.!Sprites22 ${CPFLAGS}
resources-EmergencyUtils: ${EMERGENCYUTILS}
${MKDIR} ${RESD}
${MKDIR} ${RESD}.bin
${MKDIR} ${RESD}.utils
${MKDIR} ${RESD}.files
${CP} ${SDIR}.arp.ARP ${RESD}.bin.ARP ${CPFLAGS}
${CP} ${SDIR}.ifconfig.IfConfig ${RESD}.bin.IfConfig ${CPFLAGS}
${CP} ${SDIR}.ping.Ping ${RESD}.bin.Ping ${CPFLAGS}
${CP} ${SDIR}.pong.Pong ${RESD}.bin.Pong ${CPFLAGS}
${CP} ${SDIR}.utils.utl.CheckMem ${RESD}.utils.CheckMem ${CPFLAGS}
${CP} ${SDIR}.newfiler.NewFiler ${RESD}.utils.NewFiler ${CPFLAGS}
${CP} ${SDIR}.sysctl.SysCtl ${RESD}.bin.SysCtl ${CPFLAGS}
${AWK} -f awk.Version ${RDIR}.files.AUNMap > ${RESD}.files.AUNMap
${CP} ${RDIR}.files.Hosts ${RESD}.files.Hosts ${CPFLAGS}
${CP} ${RDIR}.files.Networks ${RESD}.files.Networks ${CPFLAGS}
${CP} ${RDIR}.files.Protocols ${RESD}.files.Protocols ${CPFLAGS}
${CP} ${RDIR}.files.Services ${RESD}.files.Services ${CPFLAGS}
${AWK} -f awk.Version ${RDIR}.!Boot > ${RESD}.!Boot
${AWK} -f awk.Version ${RDIR}.!Run > ${RESD}.!Run
resources-BareMinUtils: ${BAREMINUTILS}
${MKDIR} ${RESD}
${MKDIR} ${RESD}.bin
${MKDIR} ${RESD}.files
${CP} ${SDIR}.ifconfig.IfConfig ${RESD}.bin.IfConfig ${CPFLAGS}
${CP} ${SDIR}.ping.Ping ${RESD}.bin.Ping ${CPFLAGS}
${CP} ${RDIR}.files.Hosts ${RESD}.files.Hosts ${CPFLAGS}
${CP} ${RDIR}.files.Protocols ${RESD}.files.Protocols ${CPFLAGS}
${CP} ${RDIR}.files.Services ${RESD}.files.Services ${CPFLAGS}
${AWK} -f awk.Version ${RDIR}.!Boot > ${RESD}.!Boot
${SDIR}.arp.ARP: ${SDIR}.arp.c.ARP
dir ${SDIR}.arp
@amu_machine
......
|================================================================|
| Boot file for !Internet |
BOOTVERSION
| |
| Copyright (C) Acorn Computers Ltd., 1996 |
|================================================================|
......
|================================================================|
| Run file for !Internet |
RUNVERSION
| |
| Copyright (C) Acorn Computers Ltd., 1996 |
|================================================================|
......
!Internet version 5.41 (03-Oct-03)
HELPVERSION
==================================
This is the Internet resource directory. It stores
......
|===============================================================|
| AUN map file for !Internet |
AUNMAPVERSION
| |
| This file is used if you are running AUN protocols, but have |
| enabled the full TCP/IP Protocol Suite. |
......
......@@ -12,49 +12,38 @@
# MIME type RISC OS Hex Extensions...
#
text/plain Text fff .txt
text/html HTML faf .html .htm .iso-html .shtml
text/richtext RTF c32 .rtx
text/x-teletext Teletext 112 .ttx
text/x-vcard vCard acf .vcf
text/html html FAF .html .htm .iso-html
text/richtext RTF c32 .rtx
text/* Text fff
image/gif GIF 695 .gif
image/jpeg JPEG c85 .jpeg .jpg .jfif .jpe .jfi
image/photo-cd PhotoCD be8 .pcd
image/jpeg JPEG c85 .jpeg .jpg .jfif .jpe
image/pjpeg JPEG c85 .pjpeg .pjpg
image/tiff TIFF ff0 .tiff .tif
image/xbm XBitMap b61 .xbm
image/svg SVG aad .svg
image/png PNG b60 .png
image/xpng PNG b60
image/x-xbitmap XBitMap b61
image/x-xpixmap XPM 301 .xpm
image/png PNG b60 .png
image/x-png PNG b60
image/x-photo-cd PhotoCD be8 .pcd
image/x-MS-bmp BMP 69C .bmp
image/x-bitmap XBitMap b61 .bm
image/x-ms-bmp BMP 69c .bmp
image/x-xbitmap XBitMap b61 .bm
image/x-xpixmap XPM 301 .xpm
image/x-photo-cd PhotoCD be8 .pcd
image/x-riscos-sprite Sprite ff9 .spr
image/x-xpixmap XPM 301 .xpm
video/mpeg MPEG bf8 .mpeg .mpg .mpv
video/x-mpeg2 MPEG bf8
video/x-msvideo AVI fb2 .avi
video/quicktime AVI fb2 .mov
video/avi AVI fb2 .avi
video/msvideo AVI fb2 .avi
video/x-msvideo AVI fb2
video/acorn-replay ARMovie ae7 .replay .rpl
x-world/x-vrml VRML b29 .wrl
model/vrml VRML b29 .wrl
x-world/x-vrml VRML b29 .wrl
model/vrml VRML b29 .wrl
audio/basic WaveForm fb1 .au .snd
audio/wav WaveForm fb1 .wav
audio/x-wav WaveForm fb1
audio/aiff AIFF fc2 .aifc .aif .aiff
audio/x-aiff AIFF fc2
audio/mp3 AMPEG 1ad
audio/mpeg MPEG bf8 .mpa
audio/x-mpeg MPEG bf8
audio/x-pn-realaudio RealAud f88 .ram .rpm .ra
......@@ -64,41 +53,24 @@ audio/x-scpls pls aa8 .pls
audio/x-mpegurl M3UFile aa7 .m3u
audio/* GenSound f96 .voc
application/hyperstudio HStudio b44 .stk .stak
application/x-tar tar c46 .tar
application/x-director Director ae3 .dxr .dcr .dir
application/x-tar tar c46 .tar
application/x-director Director ae3 .dxr .dcr .dir
application/x-dvi DVI ce4 .dvi
application/x-latex latex 2a8 .ltx
application/x-tex tex ce5 .tex
application/x-tex tex 2a7 .tex
application/x-tex tex ce5 .tex
application/x-tex tex 2a7 .tex
application/postscript PoScript ff5 .ps .eps
application/pdf PDF adf .pdf
application/nc-download NCDown f93 .ncd
application/nc-smartcard SCBBlk f94 .scb
application/octet-stream Data ffd .z .Z .exe
application/dvi DVI ce4
application/gzip GZip f89 .gz .gzip .tgz
application/octet-stream Data ffd .z .Z .exe
application/zip Archive ddc .zip .arc .spk .lha .arj .lzh
application/compress Archive ddc .Z .z
application/java-vm Java ae4 .class
application/msword MSWord ae6 .doc
application/rtf RTF c32 .rtf
application/gzip GZip f89 .gz .tgz
application/x-shockwave-flash Flash 188 .swf
application/x-chat Chat 17a .chat .cha
application/x-compress Archive ddc
application/x-director Director ae3 .dxr .dcr .dir
application/x-dvi DVI ce4 .dvi
application/x-gzip GZip f89
application/x-latex LaTex 2a8 .ltx
application/x-nschat Chat 17a .nsc
application/x-shockwave-flash Flash 188 .swf
application/x-tar Tar c46 .tar
application/x-tex TeX ce5 .tex .texi .texinfo
application/x-tex TeX 2a7 .tex
application/riscos * *
multipart/x-mixed-replace Data ffd
multipart/x-mixed-replace Data FFD
message/* Text fff
*/* data ffd
*/* data ffd
......@@ -23,7 +23,6 @@ CP = copy
LD = link
RM = remove
WIPE = -wipe
SQUEEZE = squeeze
DEFINES = -DRISCOS_TWEAK -Dlint
AFLAGS = -depend !Depend -Stamp -quit
......@@ -53,7 +52,7 @@ DIRS = o._dirs
COMPONENT = Host
TARGET = bin.Host
OBJS = o.ns o.host o.res o.dst o.base64 o.getaddrinfo
OBJS = o.ns o.host o.res o.dst
#
# Rule patterns
......@@ -78,6 +77,5 @@ ${DIRS}:
bin.Host: ${OBJS} ${NET5LIBS} ${CLIB} ${DIRS}
${LD} -o $@ ${OBJS} ${NET5LIBS} ${CLIB}
${SQUEEZE} $@
# Dynamic dependencies:
......@@ -12,10 +12,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Domain Signature Tools functions */
/* These functions do nothing */
/* DST functions */
#include "sys/types.h"
#define NOTUSED(k) k=k;
typedef struct dst_key {
......@@ -27,19 +27,23 @@ typedef struct dst_key {
u_int16_t dk_id; /* identifier of the key */
} DST_KEY;
/*
* dst_dnskey_to_public_key
* This function converts the contents of a DNS KEY RR into a DST
* key structure.
* Paramters
* len Length of the RDATA of the KEY RR RDATA
* rdata A pointer to the the KEY RR RDATA.
* in_name Key name to be stored in key structure.
* Returns
* NULL Failure
* NON-NULL Success. Pointer to key structure.
* Caller's responsibility to free() it.
*/
extern DST_KEY *dst_dnskey_to_key(const char *in_name, /* KEY record name */
const u_char *key, /* KEY RDATA */
const int len); /* size of input buffer*/
extern void dst_init(void);
extern int dst_verify_data(const int mode, /* specifies INIT/UPDATE/FINAL/ALL */
DST_KEY *in_key, /* the key to use */
void **context, /* pointer to state structure */
const u_char *data, /* data to be verified */
const int len, /* length of input data */
const u_char *signature,/* buffer containing signature */
const int sig_len); /* length of signature */
extern DST_KEY *dst_free_key(DST_KEY *f_key);
extern int getaddrinfo(char *,int *,void *,void *);
extern void freeaddrinfo(void *);
extern int __dn_skipname (const u_char *a, const u_char *b);
extern int __dn_expand (const u_char *a, const u_char *b, const u_char *c,
char *d, int e);
DST_KEY *dst_dnskey_to_key(const char *in_name, /* KEY record name */
const u_char *key, /* KEY RDATA */
......@@ -49,48 +53,13 @@ DST_KEY *dst_dnskey_to_key(const char *in_name, /* KEY record name */
(void)in_name;
(void)key;
return NULL;
return 0;
}
/*
* dst_init
* This function initializes the Digital Signature Toolkit.
* Right now, it just checks the DSTKEYPATH environment variable.
* Parameters
* none
* Returns
* none
*/
void dst_init()
{
}
/*
* dst_verify_data
* An incremental verify function. Data is verified in steps.
* First the context must be initialized (SIG_MODE_INIT).
* Then data is hashed (SIG_MODE_UPDATE). Finally the signature
* is verified (SIG_MODE_FINAL). This function can be called
* once with INIT, UPDATE and FINAL modes all set, or it can be
* called separately with a different mode set for each step. The
* UPDATE step can be repeated.
* Parameters
* mode Operations to perform this time.
* SIG_MODE_INIT 1 Initialize digest
* SIG_MODE_UPDATE 2 add data to digest
* SIG_MODE_FINAL 4 verify signature
* SIG_MODE_ALL
* (SIG_MODE_INIT,SIG_MODE_UPDATE,SIG_MODE_FINAL)
* data Data to pass through the hash function.
* len Length of the data in bytes.
* in_key Key for verification.
* signature Location of signature.
* sig_len Length of the signature in bytes.
* Returns
* 0 Verify success
* Non-Zero Verify Failure
*/
int dst_verify_data(const int mode, /* specifies INIT/UPDATE/FINAL/ALL */
DST_KEY *in_key, /* the key to use */
void **context, /* pointer to state structure */
......@@ -99,28 +68,30 @@ int dst_verify_data(const int mode, /* specifies INIT/UPDATE/FINAL/ALL */
const u_char *signature,/* buffer containing signature */
const int sig_len)
{
NOTUSED(in_key)
NOTUSED(context)
(void)data;
(void)len;
(void)signature;
(void)sig_len;
(void)mode;
return 0;
}
return -1;
DST_KEY *dst_free_key(DST_KEY *f_key)
{
return 0;
}
/*
* dst_free_key
* Release all data structures pointed to by a key structure.
* Parameters
* f_key Key structure to be freed.
*/
int getaddrinfo(char *a,int *b,void *c,void *d)
{
return 0;
}
DST_KEY *dst_free_key(DST_KEY *f_key)
void freeaddrinfo(void *a)
{
NOTUSED(f_key)
}
return (NULL);
int __dn_skipname (const u_char *a, const u_char *b)
{
return 0;
}
int __dn_expand (const u_char *a, const u_char *b, const u_char *c,
char *d, int e)
{
return 0;
}
......@@ -127,7 +127,7 @@ static const char copyright[] =
#define NUMMX 50
#ifdef RISCOS_TWEAK
/* rrstruct gives a whopper MY_PACKETSZ * NUMRR */
#define NUMRR 15 /* max rr's per node to verify signatures for */
#define NUMRR 31 /* max rr's per node to verify signatures for */
#else
#define NUMRR 127 /* max rr's per node to verify signatures for */
#endif
......@@ -143,7 +143,7 @@ static const char copyright[] =
#ifdef RISCOS_TWEAK
/* rrstruct gives a whopper MY_PACKETSZ * NUMRR */
#define MY_PACKETSZ 8*1024 /* need this to hold tcp answers */
#define MY_PACKETSZ 4*1024 /* need this to hold tcp answers */
#else
/* rrstruct gives a whopper MY_PACKETSZ * NUMRR */
#define MY_PACKETSZ 64*1024 /* need this to hold tcp answers */
......
......@@ -12,524 +12,65 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Name server related functions required by Host */
/* Name server related functions required by host */
#include "sys/types.h"
#include "sys/param.h"
#include "sys/socket.h"
#include "netinet/in.h"
#include "arpa/inet.h"
#include "arpa/nameser.h"
#define NOTUSED(k) k=k;
#include "ctype.h"
#include "netdb.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "unistd.h"
extern u_int ns_get16(const u_char *);
extern u_long ns_get32(const u_char *);
extern void ns_put16(u_int,u_char *);
extern int ns_name_unpack(const u_char *,const u_char *,const u_char *, u_char *, size_t);
extern int ns_name_ntol(const u_char *, u_char *, size_t);
extern int ns_samename (const char *, const char *);
extern void ns_put16(u_int,u_char *);
extern int __b64_ntop (u_char const *, size_t, char *, size_t);
#include "memory.h"
#include "sys/errno.h"
#include "sys/stat.h"
#include "dst.h"
#include "resolv.h"
#include "port_after.h"
/*
* Inline versions of get/put short/long. Pointer is advanced.
*/
#define NS_GET16(s, cp) { \
register u_char *t_cp = (u_char *)(cp); \
(s) = ((u_int16_t)t_cp[0] << 8) \
| ((u_int16_t)t_cp[1]) \
; \
(cp) += NS_INT16SZ; \
}
#define NS_GET32(l, cp) { \
register u_char *t_cp = (u_char *)(cp); \
(l) = ((u_int32_t)t_cp[0] << 24) \
| ((u_int32_t)t_cp[1] << 16) \
| ((u_int32_t)t_cp[2] << 8) \
| ((u_int32_t)t_cp[3]) \
; \
(cp) += NS_INT32SZ; \
}
#define NS_PUT16(s, cp) { \
register u_int16_t t_s = (u_int16_t)(s); \
register u_char *t_cp = (u_char *)(cp); \
*t_cp++ = t_s >> 8; \
*t_cp = t_s; \
(cp) += NS_INT16SZ; \
}
static const char digits[] = "0123456789";
void ns_put16(u_int src,u_char * dst)
{
NS_PUT16(src, dst);
}
u_int ns_get16(const u_char *src)
int __b64_ntop (u_char const * a, size_t b, char * c, size_t d)
{
u_int dst;
NS_GET16(dst, src);
return (dst);
}
u_long ns_get32(const u_char *src)
{
u_long dst;
NS_GET32(dst, src);
return (dst);
}
static int
decode_bitstring(const char **cpp, char *dn, const char *eom)
{
const char *cp = *cpp;
char *beg = dn, tc;
int b, blen, plen;
if ((blen = (*cp & 0xff)) == 0)
blen = 256;
plen = (blen + 3) / 4;
plen += sizeof("\\[x/]") + (blen > 99 ? 3 : (blen > 9) ? 2 : 1);
if (dn + plen >= eom)
return(-1);
cp++;
dn += sprintf(dn, "\\[x");
for (b = blen; b > 7; b -= 8, cp++)
dn += sprintf(dn, "%02x", *cp & 0xff);
if (b > 4) {
tc = *cp++;
dn += sprintf(dn, "%02x", tc & (0xff << (8 - b)));
} else if (b > 0) {
tc = *cp++;
dn += sprintf(dn, "%1x",
((tc >> 4) & 0x0f) & (0x0f << (4 - b)));
}
dn += sprintf(dn, "/%d]", blen);
*cpp = cp;
return(dn - beg);
}
/*
* special(ch)
* Thinking in noninternationalized USASCII (per the DNS spec),
* is this characted special ("in need of quoting") ?
* return:
* boolean.
*/
static int
special(int ch) {
switch (ch) {
case 0x22: /* '"' */
case 0x2E: /* '.' */
case 0x3B: /* ';' */
case 0x5C: /* '\\' */
case 0x28: /* '(' */
case 0x29: /* ')' */
/* Special modifiers in zone files. */
case 0x40: /* '@' */
case 0x24: /* '$' */
return (1);
default:
return (0);
}
}
/*
* printable(ch)
* Thinking in noninternationalized USASCII (per the DNS spec),
* is this character visible and not a space when printed ?
* return:
* boolean.
*/
static int
printable(int ch) {
return (ch > 0x20 && ch < 0x7f);
return 0;
}
static int
labellen(const u_char *lp)
void ns_put16(u_int a,u_char * b)
{
int bitlen;
u_char l = *lp;
if ((l & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
/* should be avoided by the caller */
return(-1);
}
if ((l & NS_CMPRSFLGS) == NS_TYPE_ELT) {
if (l == DNS_LABELTYPE_BITSTRING) {
if ((bitlen = *(lp + 1)) == 0)
bitlen = 256;
return((bitlen + 7 ) / 8 + 1);
}
return(-1); /* unknwon ELT */
}
return(l);
NOTUSED(a)
NOTUSED(b)
}
/*
* ns_name_ntol(src, dst, dstsiz)
* Convert a network strings labels into all lowercase.