--- mopd-2.5.3.orig/Makefile +++ mopd-2.5.3/Makefile @@ -3,3 +3,4 @@ SUBDIR= mopd mopprobe moptrace mopchk mopa.out .include + --- mopd-2.5.3.orig/TODO +++ mopd-2.5.3/TODO @@ -0,0 +1,7 @@ +Remove this file before release. + +TESTING +------- +Boot both VAXes +Compile on HPPA +Boot alpha ??? --- mopd-2.5.3.orig/patches/mopd-2.5.3-linux.patch +++ mopd-2.5.3/patches/mopd-2.5.3-linux.patch @@ -0,0 +1,1471 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/Makefile mopd-2.5.3/Makefile +--- mopd-2.5.3.macro/Makefile 1996-08-16 22:38:14.000000000 +0000 ++++ mopd-2.5.3/Makefile 2001-10-27 19:51:19.000000000 +0000 +@@ -1,5 +1,16 @@ +-# $Id: Makefile,v 1.5 1996/08/16 22:37:51 moj Exp $ ++AR = ar ++CC = gcc ++RANLIB = ranlib + +-SUBDIR= mopd mopprobe moptrace mopchk mopa.out ++CFLAGS = -O2 -g ++LDFLAGS = + +-.include ++SUBDIRS = common mopd mopchk mopprobe moptrace ++ ++all clean: ++ @for dir in $(SUBDIRS); do \ ++ (cd $$dir && \ ++ $(MAKE) "AR=$(AR)" "CC=$(CC)" "RANLIB=$(RANLIB)" \ ++ "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" $@) || \ ++ exit 1; \ ++ done +diff -up --recursive --new-file mopd-2.5.3.macro/Makefile.inc mopd-2.5.3/Makefile.inc +--- mopd-2.5.3.macro/Makefile.inc 1996-01-28 18:47:57.000000000 +0000 ++++ mopd-2.5.3/Makefile.inc 1970-01-01 00:00:00.000000000 +0000 +@@ -1,4 +0,0 @@ +-# from: @(#)Makefile.inc 5.1 (Berkeley) 5/11/90 +-# $Id: Makefile.inc,v 1.0 1996/01/28 18:47:38 moj Exp $ +- +-BINDIR?= /usr/sbin +diff -up --recursive --new-file mopd-2.5.3.macro/README-0 mopd-2.5.3/README-0 +--- mopd-2.5.3.macro/README-0 1970-01-01 00:00:00.000000000 +0000 ++++ mopd-2.5.3/README-0 1997-01-12 04:27:21.000000000 +0000 +@@ -0,0 +1,19 @@ ++This is a port of Mats O Jansson's mopd to linux, special thanx to David ++Hornsby from the University of Melbourne for the use of pf.c from the ++arns package. ++ ++I have booted test images on my Vaxstation 3100 from my PC running Linux ++2.0.20 with an AE-2 NE2000 compatable card. There are bound to be bugs, ++especially with dealing with different network cards etc. Please report ++any bugs you find in this linux version to me and I will do the best I ++can to fix them. ++ ++To compile mopd, simply go into the directory and type 'make'. The man ++files have also been included from the BSD version of mopd. ++ ++Enjoy ++ ++Karl Maftoum ++ ++u963870@student.canberra.edu.au ++ +diff -up --recursive --new-file mopd-2.5.3.macro/common/Makefile mopd-2.5.3/common/Makefile +--- mopd-2.5.3.macro/common/Makefile 1970-01-01 00:00:00.000000000 +0000 ++++ mopd-2.5.3/common/Makefile 2001-10-27 19:41:26.000000000 +0000 +@@ -0,0 +1,21 @@ ++LIBS = libcommon.a ++OBJS = cmp.o device.o dl.o file.o get.o loop-bsd.o mopdef.o nma.o pf-linux.o \ ++ pf.o print.o put.o rc.o version.o ++ ++CPPFLAGS = ++ ++all: $(LIBS) ++ ++libcommon.a: $(OBJS) ++ -rm -f libcommon.a ++ $(AR) cru libcommon.a $(OBJS) ++ $(RANLIB) libcommon.a ++ ++.c.o: ++ $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< ++ ++version.c: VERSION ++ sed 's/.*/char version[] = "&";/' < VERSION > version.c ++ ++clean: ++ rm -f core *.a *.o version.c +diff -up --recursive --new-file mopd-2.5.3.macro/common/device.c mopd-2.5.3/common/device.c +--- mopd-2.5.3.macro/common/device.c 1996-08-08 00:01:54.000000000 +0000 ++++ mopd-2.5.3/common/device.c 2001-10-27 18:49:32.000000000 +0000 +@@ -32,8 +32,8 @@ static char rcsid[] = "$Id: device.c,v 1 + #endif + + #include "os.h" +-#include "common/common.h" +-#include "common/mopdef.h" ++#include "common.h" ++#include "mopdef.h" + + struct if_info *iflist; /* Interface List */ + +@@ -147,6 +147,13 @@ deviceOpen(ifname, proto, trans) + + #ifdef DEV_NEW_CONF + deviceEthAddr(p->if_name,&p->eaddr[0]); ++#elif defined(__linux__) ++ { ++ int s; ++ s = socket(AF_INET,SOCK_DGRAM,0); ++ pfEthAddr(s,p->if_name,&p->eaddr[0]); ++ (void) close(s); ++ } + #else + p->eaddr[0]= tmp.eaddr[0]; + p->eaddr[1]= tmp.eaddr[1]; +@@ -206,7 +213,11 @@ deviceInitOne(ifname) + + /* Ok, get transport information */ + ++#ifdef __linux__ ++ trans = TRANS_ETHER+TRANS_8023+TRANS_AND; ++#else + trans = pfTrans(interface); ++#endif + + #ifndef NORC + /* Start with MOP Remote Console */ +diff -up --recursive --new-file mopd-2.5.3.macro/common/dl.c mopd-2.5.3/common/dl.c +--- mopd-2.5.3.macro/common/dl.c 1996-08-05 07:39:01.000000000 +0000 ++++ mopd-2.5.3/common/dl.c 2001-10-27 18:49:32.000000000 +0000 +@@ -32,9 +32,9 @@ static char rcsid[] = "$Id: dl.c,v 1.7 1 + #endif + + #include "os.h" +-#include "common/get.h" +-#include "common/print.h" +-#include "common/mopdef.h" ++#include "get.h" ++#include "print.h" ++#include "mopdef.h" + + void + mopDumpDL(fd, pkt, trans) +diff -up --recursive --new-file mopd-2.5.3.macro/common/file.c mopd-2.5.3/common/file.c +--- mopd-2.5.3.macro/common/file.c 1996-08-16 22:39:41.000000000 +0000 ++++ mopd-2.5.3/common/file.c 2001-10-27 21:45:14.000000000 +0000 +@@ -32,8 +32,8 @@ static char rcsid[] = "$Id: file.c,v 1.4 + #endif + + #include "os.h" +-#include "common/common.h" +-#include "common/mopdef.h" ++#include "common.h" ++#include "mopdef.h" + + #ifndef NOAOUT + #if defined(__NetBSD__) || defined(__OpenBSD__) +@@ -50,6 +50,8 @@ static char rcsid[] = "$Id: file.c,v 1.4 + #endif + #endif + ++int fileinfo; ++ + void + mopFilePutLX(buf, index, value, cnt) + u_char *buf; +@@ -129,11 +131,11 @@ CheckMopFile(fd) + u_char header[512]; + short image_type; + ++ (void)lseek(fd, (off_t) 0, SEEK_SET); ++ + if (read(fd, header, 512) != 512) + return(-1); + +- (void)lseek(fd, (off_t) 0, SEEK_SET); +- + image_type = (u_short)(header[IHD_W_ALIAS+1]*256 + + header[IHD_W_ALIAS]); + +@@ -162,6 +164,8 @@ GetMopFileInfo(fd, load, xfr) + short image_type; + u_long load_addr, xfr_addr, isd, iha, hbcnt, isize; + ++ (void)lseek(fd, (off_t) 0, SEEK_SET); ++ + if (read(fd, header, 512) != 512) + return(-1); + +@@ -184,43 +188,43 @@ GetMopFileInfo(fd, load, xfr) + header[iha+IHA_L_TFRADR1+2]*0x10000 + + header[iha+IHA_L_TFRADR1+1]*0x100 + + header[iha+IHA_L_TFRADR1]) & 0x7fffffff; +-#ifdef INFO +- printf("Native Image (VAX)\n"); +- printf("Header Block Count: %d\n",hbcnt); +- printf("Image Size: %08x\n",isize); +- printf("Load Address: %08x\n",load_addr); +- printf("Transfer Address: %08x\n",xfr_addr); +-#endif ++ if (fileinfo) { ++ printf("Native Image (VAX)\n"); ++ printf("Header Block Count: %d\n",hbcnt); ++ printf("Image Size: %08x\n",isize); ++ printf("Load Address: %08x\n",load_addr); ++ printf("Transfer Address: %08x\n",xfr_addr); ++ } + break; + case IHD_C_RSX: /* RSX image produced by TKB */ + hbcnt = header[L_BBLK+1]*256 + header[L_BBLK]; + isize = (header[L_BLDZ+1]*256 + header[L_BLDZ]) * 64; + load_addr = header[L_BSA+1]*256 + header[L_BSA]; + xfr_addr = header[L_BXFR+1]*256 + header[L_BXFR]; +-#ifdef INFO +- printf("RSX Image\n"); +- printf("Header Block Count: %d\n",hbcnt); +- printf("Image Size: %08x\n",isize); +- printf("Load Address: %08x\n",load_addr); +- printf("Transfer Address: %08x\n",xfr_addr); +-#endif ++ if (fileinfo) { ++ printf("RSX Image\n"); ++ printf("Header Block Count: %d\n",hbcnt); ++ printf("Image Size: %08x\n",isize); ++ printf("Load Address: %08x\n",load_addr); ++ printf("Transfer Address: %08x\n",xfr_addr); ++ } + break; + case IHD_C_BPA: /* BASIC plus analog */ +-#ifdef INFO +- printf("BASIC-Plus Image, not supported\n"); +-#endif ++ if (fileinfo) { ++ printf("BASIC-Plus Image, not supported\n"); ++ } + return(-1); + break; + case IHD_C_ALIAS: /* Alias */ +-#ifdef INFO +- printf("Alias, not supported\n"); +-#endif ++ if (fileinfo) { ++ printf("Alias, not supported\n"); ++ } + return(-1); + break; + case IHD_C_CLI: /* Image is CLI */ +-#ifdef INFO +- printf("CLI, not supported\n"); +-#endif ++ if (fileinfo) { ++ printf("CLI, not supported\n"); ++ } + return(-1); + break; + case IHD_C_PMAX: /* PMAX system image */ +@@ -237,13 +241,13 @@ GetMopFileInfo(fd, load, xfr) + header[iha+IHA_L_TFRADR1+2]*0x10000 + + header[iha+IHA_L_TFRADR1+1]*0x100 + + header[iha+IHA_L_TFRADR1]); +-#ifdef INFO +- printf("PMAX Image \n"); +- printf("Header Block Count: %d\n",hbcnt); +- printf("Image Size: %08x\n",isize); +- printf("Load Address: %08x\n",load_addr); +- printf("Transfer Address: %08x\n",xfr_addr); +-#endif ++ if (fileinfo) { ++ printf("PMAX Image \n"); ++ printf("Header Block Count: %d\n",hbcnt); ++ printf("Image Size: %08x\n",isize); ++ printf("Load Address: %08x\n",load_addr); ++ printf("Transfer Address: %08x\n",xfr_addr); ++ } + break; + case IHD_C_ALPHA: /* ALPHA system image */ + isd = (header[EIHD_L_ISDOFF+3]*0x1000000 + +@@ -260,18 +264,18 @@ GetMopFileInfo(fd, load, xfr) + header[isd+EISD_L_SECSIZE]); + load_addr = 0; + xfr_addr = 0; +-#ifdef INFO +- printf("Alpha Image \n"); +- printf("Header Block Count: %d\n",hbcnt); +- printf("Image Size: %08x\n",isize); +- printf("Load Address: %08x\n",load_addr); +- printf("Transfer Address: %08x\n",xfr_addr); +-#endif ++ if (fileinfo) { ++ printf("Alpha Image \n"); ++ printf("Header Block Count: %d\n",hbcnt); ++ printf("Image Size: %08x\n",isize); ++ printf("Load Address: %08x\n",load_addr); ++ printf("Transfer Address: %08x\n",xfr_addr); ++ } + break; + default: +-#ifdef INFO +- printf("Unknown Image (%d)\n",image_type); +-#endif ++ if (fileinfo) { ++ printf("Unknown Image (%d)\n",image_type); ++ } + return(-1); + } + +@@ -412,17 +416,15 @@ CheckAOutFile(fd) + struct exec ex, ex_swap; + int mid = -1; + ++ (void)lseek(fd, (off_t) 0, SEEK_SET); ++ + /*###416 [cc] `fd' undeclared (first use this function)%%%*/ + if (read(fd, (char *)&ex, sizeof(ex)) != sizeof(ex)) + return(-1); + +- (void)lseek(fd, (off_t) 0, SEEK_SET); +- +- if (read(fd, (char *)&ex_swap, sizeof(ex_swap)) != sizeof(ex_swap)) +- return(-1); ++ bcopy(&ex, &ex_swap, sizeof(ex_swap)); ++ mopFileSwapX((u_char *)&ex_swap, 0, 4); + +- (void)lseek(fd, (off_t) 0, SEEK_SET); +- + mid = getMID(mid, N_GETMID (ex)); + + if (mid == -1) { +@@ -452,14 +454,12 @@ GetAOutFileInfo(fd, load, xfr, a_text, a + int mid = -1; + u_long magic, clbytes, clofset; + +- if (read(fd, (char *)&ex, sizeof(ex)) != sizeof(ex)) +- return(-1); +- + (void)lseek(fd, (off_t) 0, SEEK_SET); + +- if (read(fd, (char *)&ex_swap, sizeof(ex_swap)) != sizeof(ex_swap)) ++ if (read(fd, (char *)&ex, sizeof(ex)) != sizeof(ex)) + return(-1); + ++ bcopy(&ex, &ex_swap, sizeof(ex_swap)); + mopFileSwapX((u_char *)&ex_swap, 0, 4); + + mid = getMID(mid, N_GETMID (ex)); +@@ -526,83 +526,83 @@ GetAOutFileInfo(fd, load, xfr, a_text, a + /*###525 [cc] syntax error before `}'%%%*/ + } + +-#ifdef INFO +- printf("a.out image ("); +- switch (N_GETMID (ex)) { +- case MID_I386: +- printf("i386"); +- break; ++ if (fileinfo) { ++ printf("a.out image ("); ++ switch (N_GETMID (ex)) { ++ case MID_I386: ++ printf("i386"); ++ break; + #ifdef MID_M68K +- case MID_M68K: +- printf("m68k"); +- break; ++ case MID_M68K: ++ printf("m68k"); ++ break; + #endif + #ifdef MID_M68K4K +- case MID_M68K4K: +- printf("m68k 4k"); +- break; ++ case MID_M68K4K: ++ printf("m68k 4k"); ++ break; + #endif + #ifdef MID_NS32532 +- case MID_NS32532: +- printf("pc532"); +- break; ++ case MID_NS32532: ++ printf("pc532"); ++ break; + #endif +- case MID_SPARC: +- printf("sparc"); +- break; ++ case MID_SPARC: ++ printf("sparc"); ++ break; + #ifdef MID_PMAX +- case MID_PMAX: +- printf("pmax"); +- break; ++ case MID_PMAX: ++ printf("pmax"); ++ break; + #endif + #ifdef MID_VAX +- case MID_VAX: +- printf("vax"); +- break; ++ case MID_VAX: ++ printf("vax"); ++ break; + #endif + #ifdef MID_ALPHA +- case MID_ALPHA: +- printf("alpha"); +- break; ++ case MID_ALPHA: ++ printf("alpha"); ++ break; + #endif + #ifdef MID_MIPS +- case MID_MIPS: +- printf("mips"); +- break; ++ case MID_MIPS: ++ printf("mips"); ++ break; + #endif + #ifdef MID_ARM6 +- case MID_ARM6: +- printf("arm32"); +- break; ++ case MID_ARM6: ++ printf("arm32"); ++ break; + #endif +- default: +- } +- printf(") Magic: "); +- switch (N_GETMAGIC (ex)) { +- case OMAGIC: +- printf("OMAGIC"); +- break; +- case NMAGIC: +- printf("NMAGIC"); +- break; +- case ZMAGIC: +- printf("ZMAGIC"); +- break; +- case QMAGIC: +- printf("QMAGIC"); +- break; +- default: +- printf("Unknown %d",N_GETMAGIC (ex)); ++ default: break; ++ } ++ printf(") Magic: "); ++ switch (N_GETMAGIC (ex)) { ++ case OMAGIC: ++ printf("OMAGIC"); ++ break; ++ case NMAGIC: ++ printf("NMAGIC"); ++ break; ++ case ZMAGIC: ++ printf("ZMAGIC"); ++ break; ++ case QMAGIC: ++ printf("QMAGIC"); ++ break; ++ default: ++ printf("Unknown %d",N_GETMAGIC (ex)); ++ } ++ printf("\n"); ++ printf("Size of text: %08x\n",ex.a_text); ++ printf("Size of data: %08x\n",ex.a_data); ++ printf("Size of bss: %08x\n",ex.a_bss); ++ printf("Size of symbol tab: %08x\n",ex.a_syms); ++ printf("Transfer Address: %08x\n",ex.a_entry); ++ printf("Size of reloc text: %08x\n",ex.a_trsize); ++ printf("Size of reloc data: %08x\n",ex.a_drsize); + } +- printf("\n"); +- printf("Size of text: %08x\n",ex.a_text); +- printf("Size of data: %08x\n",ex.a_data); +- printf("Size of bss: %08x\n",ex.a_bss); +- printf("Size of symbol tab: %08x\n",ex.a_syms); +- printf("Transfer Address: %08x\n",ex.a_entry); +- printf("Size of reloc text: %08x\n",ex.a_trsize); +- printf("Size of reloc data: %08x\n",ex.a_drsize); +-#endif + magic = N_GETMAGIC (ex); + clbytes = getCLBYTES(mid); + clofset = clbytes - 1; +diff -up --recursive --new-file mopd-2.5.3.macro/common/file.h mopd-2.5.3/common/file.h +--- mopd-2.5.3.macro/common/file.h 1996-08-13 18:36:33.000000000 +0000 ++++ mopd-2.5.3/common/file.h 2001-10-27 20:49:08.000000000 +0000 +@@ -33,6 +33,8 @@ + #ifndef _FILE_H_ + #define _FILE_H_ + ++extern int fileinfo; ++ + #ifdef NO__P + void mopFilePutLX (/* u_char *, int, u_long, int */); + void mopFilePutBX (/* u_char *, int, u_long, int */); +diff -up --recursive --new-file mopd-2.5.3.macro/common/get.c mopd-2.5.3/common/get.c +--- mopd-2.5.3.macro/common/get.c 1996-03-31 18:52:56.000000000 +0000 ++++ mopd-2.5.3/common/get.c 2001-10-27 18:27:16.000000000 +0000 +@@ -32,7 +32,7 @@ static char rcsid[] = "$Id: get.c,v 1.5 + #endif + + #include +-#include "common/mopdef.h" ++#include "mopdef.h" + + u_char + mopGetChar(pkt, index) +diff -up --recursive --new-file mopd-2.5.3.macro/common/loop-bsd.c mopd-2.5.3/common/loop-bsd.c +--- mopd-2.5.3.macro/common/loop-bsd.c 1996-08-16 22:41:43.000000000 +0000 ++++ mopd-2.5.3/common/loop-bsd.c 2001-10-27 18:49:32.000000000 +0000 +@@ -37,13 +37,15 @@ static char rcsid[] = "$Id: loop-bsd.c,v + #if defined(__bsdi__) || defined(__FreeBSD__) + #include + #endif ++#if !defined(__linux__) + #include ++#endif + #include + #include + + #include "os.h" +-#include "common/common.h" +-#include "common/mopdef.h" ++#include "common.h" ++#include "mopdef.h" + + int + mopOpenRC(p, trans) +@@ -110,12 +112,16 @@ Loop() + syslog(LOG_ERR, "no interfaces"); + exit(0); + } ++#ifndef __linux__ + if (iflist->fd != -1) { + if (ioctl(iflist->fd, BIOCGBLEN, (caddr_t) & bufsize) < 0) { + syslog(LOG_ERR, "BIOCGBLEN: %m"); + exit(0); + } + } ++#else ++ bufsize = 8192; ++#endif + buf = (u_char *) malloc((unsigned) bufsize); + if (buf == 0) { + syslog(LOG_ERR, "malloc: %m"); +@@ -166,6 +172,7 @@ Loop() + #define bhp ((struct bpf_hdr *)bp) + bp = buf; + ep = bp + cc; ++#ifndef __linux__ + while (bp < ep) { + register int caplen, hdrlen; + +@@ -174,6 +181,11 @@ Loop() + mopProcess(ii, bp + hdrlen); + bp += BPF_WORDALIGN(hdrlen + caplen); + } ++#else ++ if (bp < ep) { ++ mopProcess(ii,buf); ++ } ++#endif + } + } + } +diff -up --recursive --new-file mopd-2.5.3.macro/common/mopdef.c mopd-2.5.3/common/mopdef.c +--- mopd-2.5.3.macro/common/mopdef.c 1995-10-02 16:50:37.000000000 +0000 ++++ mopd-2.5.3/common/mopdef.c 2001-10-27 18:27:24.000000000 +0000 +@@ -32,7 +32,7 @@ static char rcsid[] = "$Id: mopdef.c,v 1 + #endif + + #define MOPDEF_SURPESS_EXTERN +-#include "common/mopdef.h" ++#include "mopdef.h" + + char dl_mcst[6] = MOP_DL_MULTICAST; /* Dump/Load Multicast */ + char rc_mcst[6] = MOP_RC_MULTICAST; /* Remote Console Multicast */ +diff -up --recursive --new-file mopd-2.5.3.macro/common/nma.c mopd-2.5.3/common/nma.c +--- mopd-2.5.3.macro/common/nma.c 1995-09-28 13:38:45.000000000 +0000 ++++ mopd-2.5.3/common/nma.c 2001-10-27 18:27:27.000000000 +0000 +@@ -32,7 +32,7 @@ static char rcsid[] = "$Id: nma.c,v 1.5 + #endif + + #include +-#include "common/nmadef.h" ++#include "nmadef.h" + + struct commDev { + int val; +diff -up --recursive --new-file mopd-2.5.3.macro/common/os.h mopd-2.5.3/common/os.h +--- mopd-2.5.3.macro/common/os.h 1995-08-05 18:54:02.000000000 +0000 ++++ mopd-2.5.3/common/os.h 2001-10-25 22:19:18.000000000 +0000 +@@ -33,8 +33,20 @@ + #ifndef _OS_H_ + #define _OS_H_ + ++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) ++#define DEV_NEW_CONF ++#endif ++ ++#if defined(__linux__) ++#define SETPGRP_NOPARAM ++#endif ++ + #include + ++#ifndef FILENAME_MAX ++#define FILENAME_MAX 255 /* SunOS 4 is missing it */ ++#endif ++ + #include + #include + #include +@@ -42,16 +54,24 @@ + #include + #include + #include ++#ifdef DEV_NEW_CONF + #include + #include ++#endif + #include + #include + #include + #include + #include ++#if defined(sun) ++#include ++#else + #include ++#endif + #include + +-#define DEV_NEW_CONF ++#if defined(sun) ++typedef int ssize_t; ++#endif + + #endif _OS_H_ +diff -up --recursive --new-file mopd-2.5.3.macro/common/pf-linux.c mopd-2.5.3/common/pf-linux.c +--- mopd-2.5.3.macro/common/pf-linux.c 1970-01-01 00:00:00.000000000 +0000 ++++ mopd-2.5.3/common/pf-linux.c 2001-10-27 18:49:32.000000000 +0000 +@@ -0,0 +1,357 @@ ++/* ++ * General Purpose AppleTalk Packet Filter Interface ++ * ++ * Copyright (c) 1992-1995, The University of Melbourne. ++ * All Rights Reserved. Permission to redistribute or ++ * use any part of this software for any purpose must ++ * be obtained in writing from the copyright owner. ++ * ++ * This software is supplied "as is" without express ++ * or implied warranty. ++ * ++ * djh@munnari.OZ.AU ++ * ++ * Supports: ++ * Linux SOCK_PACKET ++ * ++ * $Author: djh $ ++ * $Revision: 1.21 $ ++ * ++ * ++ * Modified for use with the linux-mopd port by Karl Maftoum ++ * u963870@student.canberra.edu.au ++ * ++ */ ++ ++#ifdef __linux__ ++ ++/* ++ * include header files ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * map compatible functions ++ * ++ */ ++ ++#ifdef MAPFUNCS ++#define bcopy(a,b,l) memcpy((char *)(b),(char *)(a),(l)) ++#define bcmp(a,b,l) memcmp((char *)(a),(char *)(b),(l)) ++#define bzero(a,l) memset((char *)(a),0,(l)) ++#define rindex(s,c) strrchr((char *)(s),(c)) ++#define index(s,c) strchr((char *)(s),(c)) ++#endif MAPFUNCS ++ ++/* ++ * select common modules ++ * ++ */ ++ ++ ++#define USE_SADDMULTI ++ ++/* ++ * definitions ++ * ++ */ ++ ++#define READBUFSIZ 4096 ++#define NUMRDS 32 ++ ++struct RDS { ++ u_short dataLen; ++ u_char *dataPtr; ++}; ++ ++/* ++ * variables ++ * ++ */ ++ ++struct socklist { ++ int iflen; ++ struct sockaddr sa; ++} socklist[32]; ++ ++struct ifreq ifr; ++extern int errno; ++extern int promisc; ++ ++struct RDS RDS[NUMRDS]; ++ ++/* ++ * establish protocol filter ++ * ++ */ ++ ++int ++setup_pf(s, prot, typ) ++int s, typ; ++u_short prot; ++{ ++ int ioarg; ++ u_short offset; ++ return(0); ++} ++ ++/* ++ * Open and initialize packet filter ++ * for a particular protocol type. ++ * ++ */ ++ ++ ++int ++pfInit(interface, mode, protocol, typ) ++char *interface; ++u_short protocol; ++int typ, mode; ++{ ++ int s; ++ int ioarg; ++ char device[64]; ++ unsigned long if_flags; ++ ++ ++ { u_short prot; ++ ++ prot = ((typ == 2) ? htons(ETH_P_802_2) : htons(protocol)); ++ if ((s = socket(AF_INET, SOCK_PACKET, prot)) < 0) { ++ perror(interface); ++ return(-1); ++ } ++ if (s >= 32) { ++ close(s); ++ return(-1); ++ } ++ } ++ ++ /* ++ * set filter for protocol and type (IPTalk, Phase 1/2) ++ * ++ */ ++ ++ if (setup_pf(s, protocol, typ) < 0) ++ return(-1); ++ ++ /* ++ * set options, bind to underlying interface ++ * ++ */ ++ ++ strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name)); ++ ++ /* record socket interface name and length */ ++ strncpy(socklist[s].sa.sa_data, interface, sizeof(socklist[s].sa.sa_data)); ++ socklist[s].iflen = strlen(interface); ++ ++ return(s); ++} ++ ++/* ++ * get the interface ethernet address ++ * ++ */ ++ ++int ++pfEthAddr(s, interface, addr) ++int s; ++char *interface; ++u_char *addr; ++{ ++ strcpy(ifr.ifr_name, interface); ++ ifr.ifr_addr.sa_family = AF_INET; ++ if (ioctl(s, SIOCGIFHWADDR, &ifr) < 0) { ++ perror("SIOCGIFHWADDR"); ++ return(-1); ++ } ++ memcpy((char *)addr, ifr.ifr_hwaddr.sa_data, 6); ++ return(0); ++} ++ ++/* ++ * add a multicast address to the interface ++ * ++ */ ++ ++int ++pfAddMulti(s, interface, addr) ++int s; ++char *interface; ++u_char *addr; ++{ ++ int sock; ++ ++#ifdef USE_SADDMULTI ++ ++ strcpy(ifr.ifr_name, interface); ++ ++#ifdef UPFILT ++ /* get the real interface name */ ++ if (ioctl(s, EIOCIFNAME, &ifr) < 0) { ++ perror("EIOCIFNAME"); ++ return(-1); ++ } ++#endif UPFILT ++ ++ ++ ++ ifr.ifr_addr.sa_family = AF_UNSPEC; ++ bcopy((char *)addr, ifr.ifr_addr.sa_data, 6); ++ ++ /* ++ * open a socket, temporarily, to use for SIOC* ioctls ++ * ++ */ ++ if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { ++ perror("socket()"); ++ return(-1); ++ } ++ if (ioctl(sock, SIOCADDMULTI, (caddr_t)&ifr) < 0) { ++ perror("SIOCADDMULTI"); ++ close(sock); ++ return(-1); ++ } ++ close(sock); ++#endif USE_SADDMULTI ++ return(0); ++} ++ ++/* ++ * delete a multicast address from the interface ++ * ++ */ ++ ++int ++pfDelMulti(s, interface, addr) ++int s; ++char *interface; ++u_char *addr; ++{ ++ int sock; ++ ++#ifdef USE_SADDMULTI ++ ++ strcpy(ifr.ifr_name, interface); ++ ++ ifr.ifr_addr.sa_family = AF_UNSPEC; ++ bcopy((char *)addr, ifr.ifr_addr.sa_data, 6); ++ ++ /* ++ * open a socket, temporarily, to use for SIOC* ioctls ++ * ++ */ ++ if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { ++ perror("socket()"); ++ return(-1); ++ } ++ if (ioctl(sock, SIOCDELMULTI, (caddr_t)&ifr) < 0) { ++ perror("SIOCDELMULTI"); ++ close(sock); ++ return(-1); ++ } ++ close(sock); ++#endif USE_SADDMULTI ++ ++ ++ return(0); ++} ++ ++/* ++ * return 1 if ethernet interface capable of multiple opens ++ * ++ */ ++ ++int ++eth_mopen(phase) ++int phase; ++{ ++ if (phase == 2) ++ return(0); ++ return(1); ++} ++ ++/* ++ * read a packet ++ * Read Data Structure describes packet(s) received ++ * ++ */ ++ ++ ++ ++ ++int ++pfRead(fd, buf, len) ++int fd, len; ++u_char *buf; ++{ ++ int i, cc; ++ ++ int fromlen; ++ struct sockaddr sa; ++ ++ RDS[0].dataLen = 0; ++ fromlen = sizeof(struct sockaddr); ++ ++ if ((cc = recvfrom(fd, (char *)buf, len, 0, &sa, &fromlen)) <= 0) ++ return(cc); ++ ++ /* check if from right interface */ ++ for (i = socklist[fd].iflen-1; i >= 0; i--) ++ if (sa.sa_data[i] != socklist[fd].sa.sa_data[i]) ++ return(0); ++ ++ RDS[0].dataLen = cc; ++ RDS[0].dataPtr = buf; ++ RDS[1].dataLen = 0; ++ ++ return(cc); ++} ++ ++/* ++ * write a packet ++ * ++ */ ++ ++int ++pfWrite(fd, buf, len) ++int fd, len; ++u_char *buf; ++{ ++ ++#ifdef USE_WRITEV ++ struct iovec iov[2]; ++ iov[0].iov_base = (caddr_t)buf; ++ iov[0].iov_len = 14; ++ iov[1].iov_base = (caddr_t)buf+14; ++ iov[1].iov_len = len-14; ++ ++ if (writev(fd, iov, 2) == len) ++ return(len); ++ ++#endif USE_WRITEV ++ ++ ++ if (sendto(fd, buf, len, 0, &socklist[fd].sa, sizeof(struct sockaddr)) == len) ++ return(len); ++ ++ return(-1); ++} ++ ++#endif /* __linux__ */ +diff -up --recursive --new-file mopd-2.5.3.macro/common/pf.c mopd-2.5.3/common/pf.c +--- mopd-2.5.3.macro/common/pf.c 1996-08-06 14:20:27.000000000 +0000 ++++ mopd-2.5.3/common/pf.c 2001-10-27 18:27:34.000000000 +0000 +@@ -31,6 +31,8 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + ++#ifndef __linux__ ++ + #ifndef LINT + static char rcsid[] = "$Id: pf.c,v 1.16 1996/08/06 14:19:48 moj Exp $"; + #endif +@@ -58,7 +60,7 @@ static char rcsid[] = "$Id: pf.c,v 1.16 + #include + #include + +-#include "common/mopdef.h" ++#include "mopdef.h" + + /* + * Variables +@@ -277,3 +279,4 @@ pfWrite(fd, buf, len, trans) + return(-1); + } + ++#endif /* !__linux__ */ +diff -up --recursive --new-file mopd-2.5.3.macro/common/print.c mopd-2.5.3/common/print.c +--- mopd-2.5.3.macro/common/print.c 1996-08-16 22:42:26.000000000 +0000 ++++ mopd-2.5.3/common/print.c 2001-10-27 18:27:40.000000000 +0000 +@@ -35,11 +35,11 @@ static char rcsid[] = "$Id: print.c,v 1. + #include + + #include "os.h" +-#include "common/mopdef.h" +-#include "common/nmadef.h" +-#include "common/nma.h" +-#include "common/cmp.h" +-#include "common/get.h" ++#include "mopdef.h" ++#include "nmadef.h" ++#include "nma.h" ++#include "cmp.h" ++#include "get.h" + + #define SHORT_PRINT + +diff -up --recursive --new-file mopd-2.5.3.macro/common/put.c mopd-2.5.3/common/put.c +--- mopd-2.5.3.macro/common/put.c 1996-08-16 22:43:15.000000000 +0000 ++++ mopd-2.5.3/common/put.c 2001-10-27 18:27:44.000000000 +0000 +@@ -34,7 +34,7 @@ static char rcsid[] = "$Id: put.c,v 1.5 + #include + #include + #include +-#include "common/mopdef.h" ++#include "mopdef.h" + + void + mopPutChar(pkt, index, value) +diff -up --recursive --new-file mopd-2.5.3.macro/common/rc.c mopd-2.5.3/common/rc.c +--- mopd-2.5.3.macro/common/rc.c 1995-10-13 19:26:23.000000000 +0000 ++++ mopd-2.5.3/common/rc.c 2001-10-27 18:49:32.000000000 +0000 +@@ -32,9 +32,9 @@ static char rcsid[] = "$Id: rc.c,v 1.8 1 + #endif + + #include "os.h" +-#include "common/get.h" +-#include "common/print.h" +-#include "common/mopdef.h" ++#include "get.h" ++#include "print.h" ++#include "mopdef.h" + + void + mopDumpRC(fd, pkt, trans) +diff -up --recursive --new-file mopd-2.5.3.macro/mopa.out/Makefile mopd-2.5.3/mopa.out/Makefile +--- mopd-2.5.3.macro/mopa.out/Makefile 1996-08-16 22:44:52.000000000 +0000 ++++ mopd-2.5.3/mopa.out/Makefile 2002-11-17 14:54:22.000000000 +0000 +@@ -1,10 +1,19 @@ ++PROGS = mopa.out ++OBJS = mopa.out.o ++LIBS = ../common/libcommon.a + +-# $Id: Makefile,v 1.3 1996/08/16 22:44:35 moj Exp $ ++CPPFLAGS = -I.. + +-PROG= mopa.out +-SRCS= mopa.out.c file.c ++all: $(PROGS) + +-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/.. -I${.CURDIR}/../common +-.PATH: ${.CURDIR}/../common ++mopa.out: $(OBJS) $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o mopa.out $(OBJS) $(LIBS) + +-.include ++../common/libcommon.a: ++ cd ../common && $(MAKE) libcommon.a ++ ++.c.o: ++ $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< ++ ++clean: ++ rm -f core $(PROGS) *.o +diff -up --recursive --new-file mopd-2.5.3.macro/mopa.out/mopa.out.c mopd-2.5.3/mopa.out/mopa.out.c +--- mopd-2.5.3.macro/mopa.out/mopa.out.c 1996-08-16 22:45:27.000000000 +0000 ++++ mopd-2.5.3/mopa.out/mopa.out.c 2001-10-27 18:55:02.000000000 +0000 +@@ -50,10 +50,6 @@ + static char rcsid[] = "$Id: mopa.out.c,v 1.5 1996/08/16 22:44:58 moj Exp $"; + #endif + +-#include "os.h" +-#include "common/common.h" +-#include "common/mopdef.h" +-#include "common/file.h" + #if defined(__NetBSD__) || defined(__OpenBSD__) + #include + #endif +@@ -68,20 +64,24 @@ static char rcsid[] = "$Id: mopa.out.c,v + #define MID_VAX 140 + #endif + ++#include ++#include ++#include ++#include ++ + u_char header[512]; /* The VAX header we generate is 1 block. */ + struct exec ex, ex_swap; + + int + main (int argc, char **argv) + { +- FILE *out; /* A FILE because that is easier. */ +- int i; +- struct dllist dl; +- + #ifdef NOAOUT + fprintf(stderr, "%s: has no function in OS/BSD\n", argv[0]); + return(1); +-#endif ++#else ++ FILE *out; /* A FILE because that is easier. */ ++ int i; ++ struct dllist dl; + + if (argc != 3) { + fprintf (stderr, "usage: %s kernel-in sys-out\n", argv[0]); +@@ -151,4 +151,7 @@ main (int argc, char **argv) + } + + fclose (out); ++ ++ return (0); ++#endif + } +diff -up --recursive --new-file mopd-2.5.3.macro/mopchk/Makefile mopd-2.5.3/mopchk/Makefile +--- mopd-2.5.3.macro/mopchk/Makefile 1996-08-16 22:46:38.000000000 +0000 ++++ mopd-2.5.3/mopchk/Makefile 2002-11-17 14:55:42.000000000 +0000 +@@ -1,18 +1,19 @@ +-# $Id: Makefile,v 1.4 1996/08/16 22:46:24 moj Exp $ ++PROGS = mopchk ++OBJS = mopchk.o ++LIBS = ../common/libcommon.a + +-PROG= mopchk +-SRCS= mopchk.c device.c version.c pf.c loop-bsd.c file.c +-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/.. -I${.CURDIR}/../common -DINFO +-CLEANFILES= version.c version.h +-LDADD= -lkvm +-.PATH: ${.CURDIR}/.. ${.CURDIR}/../common +- +-version.c version.h: ${.CURDIR}/../common/VERSION +- rm -f version.c; \ +- sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c +- set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \ +- { echo '#define VERSION_MAJOR' $$1 ; \ +- echo '#define VERSION_MINOR' $$2 ; } > version.h ++CPPFLAGS = -I.. + ++all: $(PROGS) + +-.include ++mopchk: $(OBJS) $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o mopchk $(OBJS) $(LIBS) ++ ++../common/libcommon.a: ++ cd ../common && $(MAKE) libcommon.a ++ ++.c.o: ++ $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< ++ ++clean: ++ rm -f core $(PROGS) *.o +diff -up --recursive --new-file mopd-2.5.3.macro/mopchk/mopchk.c mopd-2.5.3/mopchk/mopchk.c +--- mopd-2.5.3.macro/mopchk/mopchk.c 1996-08-16 22:47:15.000000000 +0000 ++++ mopd-2.5.3/mopchk/mopchk.c 2001-10-27 21:08:11.000000000 +0000 +@@ -37,12 +37,12 @@ static char rcsid[] = "$Id: mopchk.c,v 1 + * Usage: mopchk [-a] [-v] [filename...] + */ + +-#include "os.h" +-#include "common/common.h" +-#include "common/mopdef.h" +-#include "common/device.h" +-#include "common/pf.h" +-#include "common/file.h" ++#include ++#include ++#include ++#include ++#include ++#include + + /* + * The list of all interfaces that are being listened to. rarp_loop() +@@ -62,7 +62,8 @@ int AllFlag = 0; /* listen on "all" + int VersionFlag = 0; /* Show version */ + int promisc = 0; /* promisc mode not needed */ + char *Program; +-char version[]; ++ ++extern char version[]; + + void + main(argc, argv) +@@ -100,6 +101,8 @@ main(argc, argv) + /* NOTREACHED */ + } + } ++ ++ fileinfo = 1; + + if (VersionFlag) + printf("%s: Version %s\n",Program,version); +diff -up --recursive --new-file mopd-2.5.3.macro/mopd/Makefile mopd-2.5.3/mopd/Makefile +--- mopd-2.5.3.macro/mopd/Makefile 1996-08-16 22:36:26.000000000 +0000 ++++ mopd-2.5.3/mopd/Makefile 2002-11-17 14:56:16.000000000 +0000 +@@ -1,20 +1,19 @@ +-# $Id: Makefile,v 1.11 1996/08/16 22:36:06 moj Exp $ ++PROGS = mopd ++OBJS = mopd.o process.o ++LIBS = ../common/libcommon.a + +-PROG= mopd +-SRCS= mopd.c process.c print.c cmp.c get.c put.c mopdef.c nma.c device.c \ +- version.c pf.c loop-bsd.c dl.c rc.c file.c +-MAN= mopd.8 +-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/.. -I${.CURDIR}/../common +-CLEANFILES= version.c version.h +-LDADD= -lkvm +-.PATH: ${.CURDIR}/../common +- +-version.c version.h: ${.CURDIR}/../common/VERSION +- rm -f version.c; \ +- sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c +- set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \ +- { echo '#define VERSION_MAJOR' $$1 ; \ +- echo '#define VERSION_MINOR' $$2 ; } > version.h ++CPPFLAGS = -I.. + ++all: $(PROGS) + +-.include ++mopd: $(OBJS) $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o mopd $(OBJS) $(LIBS) ++ ++../common/libcommon.a: ++ cd ../common && $(MAKE) libcommon.a ++ ++.c.o: ++ $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< ++ ++clean: ++ rm -f core $(PROGS) *.o +diff -up --recursive --new-file mopd-2.5.3.macro/mopd/mopd.c mopd-2.5.3/mopd/mopd.c +--- mopd-2.5.3.macro/mopd/mopd.c 1996-03-31 19:21:00.000000000 +0000 ++++ mopd-2.5.3/mopd/mopd.c 2001-10-27 18:42:06.000000000 +0000 +@@ -38,16 +38,16 @@ static char rcsid[] = "$Id: mopd.c,v 1.1 + * mopd [ -d -f -v ] [ -3 | -4 ] interface + */ + +-#include "os.h" +-#include "common/common.h" +-#include "common/mopdef.h" +-#include "common/device.h" +-#include "common/print.h" +-#include "common/pf.h" +-#include "common/cmp.h" +-#include "common/get.h" +-#include "common/dl.h" +-#include "common/rc.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + #include "process.h" + + /* +diff -up --recursive --new-file mopd-2.5.3.macro/mopd/process.c mopd-2.5.3/mopd/process.c +--- mopd-2.5.3.macro/mopd/process.c 1996-08-22 17:07:38.000000000 +0000 ++++ mopd-2.5.3/mopd/process.c 2001-10-27 18:49:32.000000000 +0000 +@@ -31,18 +31,19 @@ + static char rcsid[] = "$Id: process.c,v 1.21 1996/08/22 17:04:07 moj Exp $"; + #endif + +-#include "os.h" +-#include "common/common.h" +-#include "common/mopdef.h" +-#include "common/nmadef.h" +-#include "common/get.h" +-#include "common/put.h" +-#include "common/print.h" +-#include "common/pf.h" +-#include "common/cmp.h" +-#include "common/dl.h" +-#include "common/rc.h" +-#include "common/file.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "process.h" + + extern u_char buf[]; + extern int DebugFlag; +diff -up --recursive --new-file mopd-2.5.3.macro/mopprobe/Makefile mopd-2.5.3/mopprobe/Makefile +--- mopd-2.5.3.macro/mopprobe/Makefile 1996-08-16 22:48:44.000000000 +0000 ++++ mopd-2.5.3/mopprobe/Makefile 2002-11-17 14:56:33.000000000 +0000 +@@ -1,17 +1,19 @@ +-# $Id: Makefile,v 1.10 1996/08/16 22:48:30 moj Exp $ ++PROGS = mopprobe ++OBJS = mopprobe.o ++LIBS = ../common/libcommon.a + +-PROG= mopprobe +-SRCS= mopprobe.c device.c get.c cmp.c mopdef.c version.c pf.c loop-bsd.c +-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/.. -I${.CURDIR}/../common -DNODL +-CLEANFILES= version.c version.h +-LDADD= -lkvm +-.PATH: ${.CURDIR}/../common +- +-version.c version.h: ${.CURDIR}/../common/VERSION +- rm -f version.c; \ +- sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c +- set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \ +- { echo '#define VERSION_MAJOR' $$1 ; \ +- echo '#define VERSION_MINOR' $$2 ; } > version.h ++CPPFLAGS = -I.. + +-.include ++all: $(PROGS) ++ ++mopprobe: $(OBJS) $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o mopprobe $(OBJS) $(LIBS) ++ ++../common/libcommon.a: ++ cd ../common && $(MAKE) libcommon.a ++ ++.c.o: ++ $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< ++ ++clean: ++ rm -f core $(PROGS) *.o +diff -up --recursive --new-file mopd-2.5.3.macro/mopprobe/mopprobe.c mopd-2.5.3/mopprobe/mopprobe.c +--- mopd-2.5.3.macro/mopprobe/mopprobe.c 1996-08-11 22:31:43.000000000 +0000 ++++ mopd-2.5.3/mopprobe/mopprobe.c 2001-10-27 18:50:09.000000000 +0000 +@@ -38,15 +38,15 @@ static char rcsid[] = "$Id: mopprobe.c,v + * mopprobe [ -3 | -4 ] interface + */ + +-#include "os.h" +-#include "common/common.h" +-#include "common/mopdef.h" +-#include "common/device.h" +-#include "common/print.h" +-#include "common/get.h" +-#include "common/cmp.h" +-#include "common/pf.h" +-#include "common/nmadef.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + /* + * The list of all interfaces that are being listened to. rarp_loop() +diff -up --recursive --new-file mopd-2.5.3.macro/moptrace/Makefile mopd-2.5.3/moptrace/Makefile +--- mopd-2.5.3.macro/moptrace/Makefile 1996-08-16 22:49:27.000000000 +0000 ++++ mopd-2.5.3/moptrace/Makefile 2002-11-17 14:56:54.000000000 +0000 +@@ -1,20 +1,19 @@ +-# $Id: Makefile,v 1.6 1996/08/16 22:49:14 moj Exp $ ++PROGS = moptrace ++OBJS = moptrace.o ++LIBS = ../common/libcommon.a + +-PROG= moptrace +-SRCS= moptrace.c print.c cmp.c get.c mopdef.c nma.c device.c version.c pf.c \ +- loop-bsd.c dl.c rc.c +-MAN= moptrace.1 +-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/.. -I${.CURDIR}/../common +-CLEANFILES= version.c version.h +-LDADD= -lkvm +-.PATH: ${.CURDIR}/../common +- +-version.c version.h: ${.CURDIR}/../common/VERSION +- rm -f version.c; \ +- sed 's/.*/char version[] = "&";/' ${.ALLSRC} > version.c +- set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' ${.ALLSRC}` ; \ +- { echo '#define VERSION_MAJOR' $$1 ; \ +- echo '#define VERSION_MINOR' $$2 ; } > version.h ++CPPFLAGS = -I.. + ++all: $(PROGS) + +-.include ++moptrace: $(OBJS) $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o moptrace $(OBJS) $(LIBS) ++ ++../common/libcommon.a: ++ cd ../common && $(MAKE) libcommon.a ++ ++.c.o: ++ $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< ++ ++clean: ++ rm -f core $(PROGS) *.o +diff -up --recursive --new-file mopd-2.5.3.macro/moptrace/moptrace.c mopd-2.5.3/moptrace/moptrace.c +--- mopd-2.5.3.macro/moptrace/moptrace.c 1996-08-07 22:48:04.000000000 +0000 ++++ mopd-2.5.3/moptrace/moptrace.c 2001-10-27 18:50:29.000000000 +0000 +@@ -38,15 +38,15 @@ static char rcsid[] = "$Id: moptrace.c,v + * moptrace [ -d ] [ -3 | -4 ] interface + */ + +-#include "os.h" +-#include "common/common.h" +-#include "common/mopdef.h" +-#include "common/device.h" +-#include "common/print.h" +-#include "common/pf.h" +-#include "common/dl.h" +-#include "common/rc.h" +-#include "common/get.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + /* + * The list of all interfaces that are being listened to. --- mopd-2.5.3.orig/patches/alpha.patch +++ mopd-2.5.3/patches/alpha.patch @@ -0,0 +1,14 @@ +diff -u mopd-2.5.3/common/file.c.orig mopd-2.5.3/common/file.c +--- mopd-2.5.3/common/file.c.orig 2003-05-10 11:14:07.000000000 +0100 ++++ mopd-2.5.3/common/file.c 2003-05-10 11:14:52.000000000 +0100 +@@ -42,6 +42,9 @@ + #if defined(__bsdi__) + #define NOAOUT + #endif ++#if defined(__linux__) && (defined(__alpha__) || defined(__ia64__)) ++#define NOAOUT ++#endif + #if defined(__FreeBSD__) + #include + #endif + --- mopd-2.5.3.orig/patches/mopd-2.5.3-fddi.patch +++ mopd-2.5.3/patches/mopd-2.5.3-fddi.patch @@ -0,0 +1,675 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/common/device.c mopd-2.5.3/common/device.c +--- mopd-2.5.3.macro/common/device.c 2002-11-17 12:50:33.000000000 +0000 ++++ mopd-2.5.3/common/device.c 2002-11-17 13:05:38.000000000 +0000 +@@ -147,6 +147,7 @@ deviceOpen(ifname, proto, trans) + p->read = tmp.read; + bzero((char *)p->eaddr,sizeof(p->eaddr)); + p->fd = tmp.fd; ++ p->trans = trans; + + #ifdef DEV_NEW_CONF + deviceEthAddr(p->if_name,&p->eaddr[0]); +@@ -218,17 +219,26 @@ deviceInitOne(ifname) + + switch (trans) { + case TRANS_ETHER: +- deviceOpen(interface,MOP_K_PROTO_RC,TRANS_ETHER); +- break; + case TRANS_8023: +- deviceOpen(interface,MOP_K_PROTO_RC,TRANS_8023); +- break; +- case TRANS_ETHER+TRANS_8023: +- deviceOpen(interface,MOP_K_PROTO_RC,TRANS_ETHER); +- deviceOpen(interface,MOP_K_PROTO_RC,TRANS_8023); +- break; +- case TRANS_ETHER+TRANS_8023+TRANS_AND: +- deviceOpen(interface,MOP_K_PROTO_RC,TRANS_ETHER+TRANS_8023); ++ case TRANS_FDDI_8021H: ++ case TRANS_FDDI_8022: ++ deviceOpen(interface, MOP_K_PROTO_RC, trans); ++ break; ++ case TRANS_ETHER + TRANS_8023: ++ deviceOpen(interface, MOP_K_PROTO_RC, TRANS_ETHER); ++ deviceOpen(interface, MOP_K_PROTO_RC, TRANS_8023); ++ break; ++ case TRANS_FDDI_8021H + TRANS_FDDI_8022: ++ deviceOpen(interface, MOP_K_PROTO_RC, TRANS_FDDI_8021H); ++ deviceOpen(interface, MOP_K_PROTO_RC, TRANS_FDDI_8022); ++ break; ++ case TRANS_ETHER + TRANS_8023 + TRANS_AND: ++ deviceOpen(interface, MOP_K_PROTO_RC, ++ TRANS_ETHER + TRANS_8023); ++ break; ++ case TRANS_FDDI_8021H + TRANS_FDDI_8022 + TRANS_AND: ++ deviceOpen(interface, MOP_K_PROTO_RC, ++ TRANS_FDDI_8021H + TRANS_FDDI_8022); + break; + } + #endif +@@ -238,17 +248,26 @@ deviceInitOne(ifname) + + switch (trans) { + case TRANS_ETHER: +- deviceOpen(interface,MOP_K_PROTO_DL,TRANS_ETHER); +- break; + case TRANS_8023: +- deviceOpen(interface,MOP_K_PROTO_DL,TRANS_8023); +- break; +- case TRANS_ETHER+TRANS_8023: +- deviceOpen(interface,MOP_K_PROTO_DL,TRANS_ETHER); +- deviceOpen(interface,MOP_K_PROTO_DL,TRANS_8023); +- break; +- case TRANS_ETHER+TRANS_8023+TRANS_AND: +- deviceOpen(interface,MOP_K_PROTO_DL,TRANS_ETHER+TRANS_8023); ++ case TRANS_FDDI_8021H: ++ case TRANS_FDDI_8022: ++ deviceOpen(interface, MOP_K_PROTO_DL, trans); ++ break; ++ case TRANS_ETHER + TRANS_8023: ++ deviceOpen(interface, MOP_K_PROTO_DL, TRANS_ETHER); ++ deviceOpen(interface, MOP_K_PROTO_DL, TRANS_8023); ++ break; ++ case TRANS_FDDI_8021H + TRANS_FDDI_8022: ++ deviceOpen(interface, MOP_K_PROTO_DL, TRANS_FDDI_8021H); ++ deviceOpen(interface, MOP_K_PROTO_DL, TRANS_FDDI_8022); ++ break; ++ case TRANS_ETHER + TRANS_8023 + TRANS_AND: ++ deviceOpen(interface, MOP_K_PROTO_DL, ++ TRANS_ETHER + TRANS_8023); ++ break; ++ case TRANS_FDDI_8021H + TRANS_FDDI_8022 + TRANS_AND: ++ deviceOpen(interface, MOP_K_PROTO_DL, ++ TRANS_FDDI_8021H + TRANS_FDDI_8022); + break; + } + #endif +diff -up --recursive --new-file mopd-2.5.3.macro/common/dl.c mopd-2.5.3/common/dl.c +--- mopd-2.5.3.macro/common/dl.c 2001-10-27 19:14:58.000000000 +0000 ++++ mopd-2.5.3/common/dl.c 2002-11-17 13:05:38.000000000 +0000 +@@ -50,13 +50,21 @@ mopDumpDL(fd, pkt, trans) + len = mopGetLength(pkt, trans); + + switch (trans) { ++ case TRANS_ETHER: ++ index = 16; ++ moplen = len; ++ break; + case TRANS_8023: + index = 22; + moplen = len - 8; + break; +- default: +- index = 16; ++ case TRANS_FDDI_8021H: ++ case TRANS_FDDI_8022: ++ index = 23; + moplen = len; ++ break; ++ default: ++ moplen = 0; + } + if (moplen < 1) /* broken packet */ + return; +diff -up --recursive --new-file mopd-2.5.3.macro/common/get.c mopd-2.5.3/common/get.c +--- mopd-2.5.3.macro/common/get.c 2001-10-27 18:27:16.000000000 +0000 ++++ mopd-2.5.3/common/get.c 2002-11-17 13:05:38.000000000 +0000 +@@ -94,15 +94,30 @@ mopGetTrans(pkt, trans) + { + u_short *ptype; + +- if (trans == 0) { ++ if ((trans & (TRANS_ETHER + TRANS_8023))) { + ptype = (u_short *)(pkt+12); + if (ntohs(*ptype) < 1600) { +- trans = TRANS_8023; ++ trans &= TRANS_8023; + } else { +- trans = TRANS_ETHER; ++ trans &= TRANS_ETHER; + } ++ return(trans); + } +- return(trans); ++ if ((trans & (TRANS_FDDI_8021H + TRANS_FDDI_8022))) { ++ if (*pkt >= MOP_K_FDDI_FC_MIN && *pkt <= MOP_K_FDDI_FC_MAX) { ++ if (!bcmp((char *)(pkt+16), (char *)dl_802_proto, 3)) { ++ trans &= TRANS_FDDI_8022; ++ return(trans); ++ } ++ if (!bcmp((char *)(pkt+16), ++ (char *)dl_8021h_proto, 3)) { ++ trans &= TRANS_FDDI_8021H; ++ return(trans); ++ } ++ } ++ return(0); ++ } ++ return(0); + } + + void +@@ -111,23 +126,35 @@ mopGetHeader(pkt, index, dst, src, proto + int *index, *len, trans; + u_short *proto; + { +- *dst = pkt; +- *src = pkt + 6; +- *index = *index + 12; +- + switch(trans) { + case TRANS_ETHER: ++ *dst = pkt; ++ *src = pkt + 6; ++ *index = *index + 12; + *proto = (u_short)(pkt[*index]*256 + pkt[*index+1]); + *index = *index + 2; + *len = (int)(pkt[*index+1]*256 + pkt[*index]); + *index = *index + 2; + break; + case TRANS_8023: ++ *dst = pkt; ++ *src = pkt + 6; ++ *index = *index + 12; + *len = (int)(pkt[*index]*256 + pkt[*index+1]); + *index = *index + 8; + *proto = (u_short)(pkt[*index]*256 + pkt[*index+1]); + *index = *index + 2; + break; ++ case TRANS_FDDI_8021H: ++ case TRANS_FDDI_8022: ++ *dst = pkt + 1; ++ *src = pkt + 7; ++ *index = *index + 19; ++ *proto = (u_short)(pkt[*index]*256 + pkt[*index+1]); ++ *index = *index + 2; ++ *len = (int)(pkt[*index+1]*256 + pkt[*index]); ++ *index = *index + 2; ++ break; + } + } + +@@ -143,6 +170,10 @@ mopGetLength(pkt, trans) + case TRANS_8023: + return(pkt[12]*256 + pkt[13]); + break; ++ case TRANS_FDDI_8021H: ++ case TRANS_FDDI_8022: ++ return(pkt[22]*256 + pkt[21]); ++ break; + } + return(0); + } +diff -up --recursive --new-file mopd-2.5.3.macro/common/mopdef.c mopd-2.5.3/common/mopdef.c +--- mopd-2.5.3.macro/common/mopdef.c 2001-10-27 18:27:24.000000000 +0000 ++++ mopd-2.5.3/common/mopdef.c 2002-11-17 13:05:38.000000000 +0000 +@@ -39,6 +39,9 @@ char rc_mcst[6] = MOP_RC_MULTICAST; /* R + char dl_802_proto[5] = MOP_K_PROTO_802_DL; /* MOP Dump/Load 802.2 */ + char rc_802_proto[5] = MOP_K_PROTO_802_RC; /* MOP Remote Console 802.2 */ + char lp_802_proto[5] = MOP_K_PROTO_802_LP; /* Loopback 802.2 */ ++char dl_8021h_proto[5] = MOP_K_PROTO_8021H_DL; /* MOP Dump/Load 802.1H */ ++char rc_8021h_proto[5] = MOP_K_PROTO_8021H_RC; /* MOP Remote Console 802.1H */ ++char lp_8021h_proto[5] = MOP_K_PROTO_8021H_LP; /* Loopback 802.1H */ + + int + mopdef_dummy() +diff -up --recursive --new-file mopd-2.5.3.macro/common/mopdef.h mopd-2.5.3/common/mopdef.h +--- mopd-2.5.3.macro/common/mopdef.h 1995-10-12 20:23:13.000000000 +0000 ++++ mopd-2.5.3/common/mopdef.h 2002-11-16 21:58:47.000000000 +0000 +@@ -41,13 +41,24 @@ + #define MOP_K_PROTO_802_RC { 0x08, 0x00, 0x2b, 0x60, 0x02 } + #define MOP_K_PROTO_802_LP { 0x08, 0x00, 0x2b, 0x90, 0x00 } + ++#define MOP_K_PROTO_8021H_DL { 0x00, 0x00, 0x00, 0x60, 0x01 } ++#define MOP_K_PROTO_8021H_RC { 0x00, 0x00, 0x00, 0x60, 0x02 } ++#define MOP_K_PROTO_8021H_LP { 0x00, 0x00, 0x00, 0x90, 0x00 } ++ + #define MOP_K_PROTO_802_DSAP 0xaa + #define MOP_K_PROTO_802_SSAP 0xaa + #define MOP_K_PROTO_802_CNTL 0x03 + ++#define MOP_K_FDDI_FC_MIN 0x50 /* Accepted frame types: async LLC */ ++#define MOP_K_FDDI_FC_MAX 0x57 ++ ++#define MOP_K_FDDI_FC_DEF 0x54 /* Sent frame type: async4 LLC */ ++ + #define TRANS_ETHER 1 /* Packet in Ethernet format */ + #define TRANS_8023 2 /* Packet in 802.3 format */ +-#define TRANS_AND 0x1000 /* Both Ethernet and 802.3 */ ++#define TRANS_FDDI_8021H 4 /* Packet in FDDI 802.1H format */ ++#define TRANS_FDDI_8022 8 /* Packet in FDDI 802.2 format */ ++#define TRANS_AND 0x1000 /* All formats specified */ + + /* The following constants are defined in module MOPDEF.SDL in MOM */ + +@@ -191,6 +202,9 @@ extern char rc_mcst[]; + extern char dl_802_proto[]; + extern char rc_802_proto[]; + extern char lp_802_proto[]; ++extern char dl_8021h_proto[]; ++extern char rc_8021h_proto[]; ++extern char lp_8021h_proto[]; + #endif MOPDEF_SUPRESS_EXTERN + + #endif _MOPDEF_H_ +diff -up --recursive --new-file mopd-2.5.3.macro/common/pf-linux.c mopd-2.5.3/common/pf-linux.c +--- mopd-2.5.3.macro/common/pf-linux.c 2002-11-17 13:05:11.000000000 +0000 ++++ mopd-2.5.3/common/pf-linux.c 2002-11-17 13:05:38.000000000 +0000 +@@ -39,7 +39,8 @@ + #include + #include + #include +-#include ++#include ++#include + #include + #include + #include +@@ -372,15 +373,37 @@ u_char *buf; + + /* + * Return information to device.c how to open device. +- * In this case the driver can handle both Ethernet type II and +- * IEEE 802.3 frames (SNAP) in a single pfOpen. ++ * The driver requires a separate pfOpen for Ethernet type II ++ * and IEEE 802.3 frames (SNAP). ++ * The driver can handle FDDI IEEE 802.1H (SNAP, RFC1042) and ++ * IEEE 802.2 (SNAP) frames in a single pfOpen. + */ + + int + pfTrans(interface) + char *interface; + { +- return TRANS_ETHER+TRANS_8023; ++ int s, err; ++ ++ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) - 1); ++ ifr.ifr_name[sizeof(ifr.ifr_name)] = 0; ++ ifr.ifr_addr.sa_family = AF_INET; ++ s = socket(AF_INET,SOCK_DGRAM,0); ++ err = ioctl(s, SIOCGIFHWADDR, &ifr); ++ (void) close(s); ++ if (err < 0) { ++ syslog(LOG_ERR, "pfTrans: %s: SIOCGIFHWADDR: %m", interface); ++ exit(-1); ++ } ++ ++ switch (ifr.ifr_hwaddr.sa_family) { ++ case ARPHRD_ETHER: ++ return TRANS_ETHER + TRANS_8023; ++ case ARPHRD_FDDI: ++ return TRANS_FDDI_8021H + TRANS_FDDI_8022 + TRANS_AND; ++ default: ++ return(0); ++ } + } + + #endif /* __linux__ */ +diff -up --recursive --new-file mopd-2.5.3.macro/common/print.c mopd-2.5.3/common/print.c +--- mopd-2.5.3.macro/common/print.c 2001-10-27 18:27:40.000000000 +0000 ++++ mopd-2.5.3/common/print.c 2002-11-17 13:05:38.000000000 +0000 +@@ -145,18 +145,24 @@ mopPrintOneline(fd, pkt, trans) + } + } + +- if (trans == TRANS_8023) { ++ switch (trans) { ++ case TRANS_ETHER: ++ (void)fprintf(fd, "EthII "); ++ break; ++ case TRANS_8023: + (void)fprintf(fd, "802.3 "); ++ break; ++ case TRANS_FDDI_8021H: ++ (void)fprintf(fd, "FDDI 802.1H "); ++ break; ++ case TRANS_FDDI_8022: ++ (void)fprintf(fd, "FDDI 802.2 "); ++ break; + } + + mopPrintHWA(fd, src); (void)fprintf(fd," > "); + mopPrintHWA(fd, dst); +- if (len < 1600) { +- (void)fprintf(fd, " len %4d code %02x ",len,code); +- } else { +- (void)fprintf(fd, " len %4d code %02x ", +- (len % 256)*256 + (len /256), code); +- } ++ (void)fprintf(fd, " len %4d code %02x ", len, code); + + switch (proto) { + case MOP_K_PROTO_DL: +@@ -279,37 +285,30 @@ mopPrintHeader(fd, pkt, trans) + (void)fprintf(fd,"Proto : %04x ",proto); + switch (proto) { + case MOP_K_PROTO_DL: +- switch (trans) { +- case TRANS_8023: +- (void)fprintf(fd, "MOP Dump/Load (802.3)\n"); +- break; +- default: +- (void)fprintf(fd, "MOP Dump/Load\n"); +- } ++ (void)fprintf(fd, "MOP Dump/Load "); + break; + case MOP_K_PROTO_RC: +- switch (trans) { +- case TRANS_8023: +- (void)fprintf(fd, "MOP Remote Console (802.3)\n"); +- break; +- default: +- (void)fprintf(fd, "MOP Remote Console\n"); +- } ++ (void)fprintf(fd, "MOP Remote Console "); + break; + case MOP_K_PROTO_LP: +- switch (trans) { +- case TRANS_8023: +- (void)fprintf(fd, "MOP Loopback (802.3)\n"); +- break; +- default: +- (void)fprintf(fd, "MOP Loopback\n"); +- } ++ (void)fprintf(fd, "MOP Loopback "); + break; +- default: +- (void)fprintf(fd, "\n"); ++ } ++ switch (trans) { ++ case TRANS_ETHER: ++ (void)fprintf(fd, "(EthII)"); ++ break; ++ case TRANS_8023: ++ (void)fprintf(fd, "(802.3)"); ++ break; ++ case TRANS_FDDI_8021H: ++ (void)fprintf(fd, "(FDDI 802.1H)"); ++ break; ++ case TRANS_FDDI_8022: ++ (void)fprintf(fd, "(FDDI 802.2)"); + break; + } +- ++ (void)fprintf(fd, "\n"); + + (void)fprintf(fd,"Length : %04x (%d)\n",len,len); + } +@@ -471,6 +470,10 @@ mopPrintInfo(fd, pkt, index, moplen, mop + case TRANS_8023: + moplen = moplen + 14; + break; ++ case TRANS_FDDI_8021H: ++ case TRANS_FDDI_8022: ++ moplen = moplen + 23; ++ break; + } + + itype = mopGetShort(pkt,index); +diff -up --recursive --new-file mopd-2.5.3.macro/common/put.c mopd-2.5.3/common/put.c +--- mopd-2.5.3.macro/common/put.c 2001-10-27 18:27:44.000000000 +0000 ++++ mopd-2.5.3/common/put.c 2002-11-17 13:05:38.000000000 +0000 +@@ -126,13 +126,23 @@ mopPutHeader(pkt, index, dst, src, proto + int trans; + { + ++ if (trans == TRANS_FDDI_8021H || trans == TRANS_FDDI_8022) ++ mopPutChar (pkt, index, MOP_K_FDDI_FC_DEF); + mopPutMulti(pkt, index, dst, 6); + mopPutMulti(pkt, index, src, 6); +- if (trans == TRANS_8023) { ++ if (trans == TRANS_8023) + mopPutShort(pkt, index, 0); ++ if (trans != TRANS_ETHER) { + mopPutChar (pkt, index, MOP_K_PROTO_802_DSAP); + mopPutChar (pkt, index, MOP_K_PROTO_802_SSAP); + mopPutChar (pkt, index, MOP_K_PROTO_802_CNTL); ++ } ++ if (trans == TRANS_FDDI_8021H) { ++ mopPutChar (pkt, index, 0x00); ++ mopPutChar (pkt, index, 0x00); ++ mopPutChar (pkt, index, 0x00); ++ } ++ if (trans == TRANS_8023 || trans == TRANS_FDDI_8022) { + mopPutChar (pkt, index, 0x08); + mopPutChar (pkt, index, 0x00); + mopPutChar (pkt, index, 0x2b); +@@ -141,15 +151,15 @@ mopPutHeader(pkt, index, dst, src, proto + mopPutChar(pkt, index, (proto / 256)); + mopPutChar(pkt, index, (proto % 256)); + #else +- if (trans == TRANS_8023) { +- mopPutChar(pkt, index, (proto / 256)); ++ if (trans == TRANS_ETHER) { + mopPutChar(pkt, index, (proto % 256)); ++ mopPutChar(pkt, index, (proto / 256)); + } else { +- mopPutChar(pkt, index, (proto % 256)); + mopPutChar(pkt, index, (proto / 256)); ++ mopPutChar(pkt, index, (proto % 256)); + } + #endif +- if (trans == TRANS_ETHER) ++ if (trans != TRANS_8023) + mopPutShort(pkt, index, 0); + + } +@@ -178,6 +188,12 @@ mopPutLength(pkt, trans, len) + mopPutChar(pkt, &index, ((len - 14) / 256)); + #endif + break; ++ case TRANS_FDDI_8021H: ++ case TRANS_FDDI_8022: ++ index = 21; ++ mopPutChar(pkt, &index, ((len - 23) % 256)); ++ mopPutChar(pkt, &index, ((len - 23) / 256)); ++ break; + } + + } +diff -up --recursive --new-file mopd-2.5.3.macro/common/rc.c mopd-2.5.3/common/rc.c +--- mopd-2.5.3.macro/common/rc.c 2001-10-27 19:14:58.000000000 +0000 ++++ mopd-2.5.3/common/rc.c 2002-11-17 13:05:38.000000000 +0000 +@@ -50,13 +50,21 @@ mopDumpRC(fd, pkt, trans) + len = mopGetLength(pkt, trans); + + switch (trans) { ++ case TRANS_ETHER: ++ index = 16; ++ moplen = len; ++ break; + case TRANS_8023: + index = 22; + moplen = len - 8; + break; +- default: +- index = 16; ++ case TRANS_FDDI_8021H: ++ case TRANS_FDDI_8022: ++ index = 23; + moplen = len; ++ break; ++ default: ++ moplen = 0; + } + if (moplen < 1) /* broken packet */ + return; +diff -up --recursive --new-file mopd-2.5.3.macro/mopd/mopd.c mopd-2.5.3/mopd/mopd.c +--- mopd-2.5.3.macro/mopd/mopd.c 2001-10-27 18:42:06.000000000 +0000 ++++ mopd-2.5.3/mopd/mopd.c 2002-11-17 13:05:38.000000000 +0000 +@@ -211,12 +211,14 @@ mopProcess(ii, pkt) + + /* We don't known with transport, Guess! */ + +- trans = mopGetTrans(pkt, 0); ++ trans = mopGetTrans(pkt, ii->trans); + + /* Ok, return if we don't wan't this message */ + +- if ((trans == TRANS_ETHER) && Not3Flag) return; +- if ((trans == TRANS_8023) && Not4Flag) return; ++ if ((trans == TRANS_ETHER || trans == TRANS_FDDI_8021H) && Not3Flag) ++ return; ++ if ((trans == TRANS_8023 || trans == TRANS_FDDI_8022) && Not4Flag) ++ return; + + index = 0; + mopGetHeader(pkt, &index, &dst, &src, &ptype, &len, trans); +diff -up --recursive --new-file mopd-2.5.3.macro/mopd/process.c mopd-2.5.3/mopd/process.c +--- mopd-2.5.3.macro/mopd/process.c 2002-11-17 13:00:56.000000000 +0000 ++++ mopd-2.5.3/mopd/process.c 2002-11-17 13:05:38.000000000 +0000 +@@ -76,6 +76,10 @@ mopProcessInfo(pkt,index,moplen,dl_rpr,t + case TRANS_8023: + moplen = moplen + 14; + break; ++ case TRANS_FDDI_8021H: ++ case TRANS_FDDI_8022: ++ moplen = moplen + 23; ++ break; + } + + itype = mopGetShort(pkt,index); +@@ -276,10 +280,10 @@ mopStartLoad(dst, src, dl_rpr, trans) + dllist[slot].dl_bsz = 1010; + if (dllist[slot].dl_bsz == 0) /* Needed by "big" VAXen */ + dllist[slot].dl_bsz = MOP_K_DLBSZ_DEFAULT; +- if (trans == TRANS_8023) ++ if (trans == TRANS_8023 || trans == TRANS_FDDI_8022) + if (dllist[slot].dl_bsz > MAX_ETH_PAYLOAD - 8) + dllist[slot].dl_bsz = MAX_ETH_PAYLOAD - 8; +- if (trans == TRANS_ETHER) ++ if (trans != TRANS_8023) + dllist[slot].dl_bsz -= 2; /* For packet length */ + dllist[slot].dl_bsz -= 6; /* For Memory Load header */ + +diff -up --recursive --new-file mopd-2.5.3.macro/mopprobe/mopprobe.c mopd-2.5.3/mopprobe/mopprobe.c +--- mopd-2.5.3.macro/mopprobe/mopprobe.c 2001-10-27 18:50:09.000000000 +0000 ++++ mopd-2.5.3/mopprobe/mopprobe.c 2002-11-17 13:05:38.000000000 +0000 +@@ -148,27 +148,55 @@ mopProcess(ii, pkt) + u_char *pkt; + { + u_char *dst, *src, *p, mopcode, tmpc, ilen; +- u_short *ptype, moplen, tmps, itype, len; ++ u_short *ptype, moplen, tmps, itype; + int index, i, device, trans; + +- dst = pkt; +- src = pkt+6; +- ptype = (u_short *)(pkt+12); +- index = 0; +- +- if (*ptype < 1600) { +- len = *ptype; +- trans = TRANS_8023; +- ptype = (u_short *)(pkt+20); +- p = pkt+22; +- if (Not4Flag) return; +- } else { +- len = 0; +- trans = TRANS_ETHER; +- p = pkt+14; +- if (Not3Flag) return; ++ trans = ii->trans; ++ if ((trans & (TRANS_ETHER + TRANS_8023))) { ++ ptype = (u_short *)(pkt+12); ++ if (ntohs(*ptype) < 1600) { ++ trans &= TRANS_8023; ++ if (Not4Flag) ++ return; ++ } else { ++ trans &= TRANS_ETHER; ++ if (Not3Flag) ++ return; ++ } ++ } else if ((trans & (TRANS_FDDI_8021H + TRANS_FDDI_8022))) { ++ if (*pkt >= MOP_K_FDDI_FC_MIN && *pkt <= MOP_K_FDDI_FC_MAX) { ++ if (!bcmp((char *)(pkt+16), ++ (char *)dl_802_proto, 3)) { ++ trans &= TRANS_FDDI_8022; ++ if (Not4Flag) ++ return; ++ } else if (!bcmp((char *)(pkt+16), ++ (char *)dl_8021h_proto, 3)) { ++ trans &= TRANS_FDDI_8021H; ++ if (Not3Flag) ++ return; ++ } else ++ return; ++ } else ++ return; ++ } else ++ return; ++ ++ switch (trans) { ++ case TRANS_8023: ++ case TRANS_ETHER: ++ dst = pkt; ++ src = pkt + 6; ++ break; ++ case TRANS_FDDI_8022: ++ case TRANS_FDDI_8021H: ++ dst = pkt + 1; ++ src = pkt + 7; ++ break; ++ default: ++ return; + } +- ++ + /* Ignore our own messages */ + + if (mopCmpEAddr(ii->eaddr,src) == 0) { +@@ -183,11 +211,21 @@ mopProcess(ii, pkt) + + switch (trans) { + case TRANS_8023: +- moplen = len; ++ index = 22; ++ moplen = ntohs(*ptype); + break; +- default: ++ case TRANS_ETHER: ++ index = 14; ++ moplen = mopGetShort(pkt,&index); ++ break; ++ case TRANS_FDDI_8022: ++ case TRANS_FDDI_8021H: ++ index = 21; + moplen = mopGetShort(pkt,&index); ++ break; + } ++ p = pkt + index; ++ index = 0; + mopcode = mopGetChar(p,&index); + + /* Just process System Information */ +@@ -203,7 +241,7 @@ mopProcess(ii, pkt) + + itype = mopGetShort(pkt,&index); + +- while (index < (int)(moplen + 2)) { ++ while (index < (int)(moplen)) { + ilen = mopGetChar(pkt,&index); + switch (itype) { + case 0: +diff -up --recursive --new-file mopd-2.5.3.macro/moptrace/moptrace.c mopd-2.5.3/moptrace/moptrace.c +--- mopd-2.5.3.macro/moptrace/moptrace.c 2001-10-27 18:50:29.000000000 +0000 ++++ mopd-2.5.3/moptrace/moptrace.c 2002-11-17 13:05:38.000000000 +0000 +@@ -149,12 +149,14 @@ mopProcess(ii, pkt) + + /* We don't known which transport, Guess! */ + +- trans = mopGetTrans(pkt, 0); ++ trans = mopGetTrans(pkt, ii->trans); + + /* Ok, return if we don't want this message */ + +- if ((trans == TRANS_ETHER) && Not3Flag) return; +- if ((trans == TRANS_8023) && Not4Flag) return; ++ if ((trans == TRANS_ETHER || trans == TRANS_FDDI_8021H) && Not3Flag) ++ return; ++ if ((trans == TRANS_8023 || trans == TRANS_FDDI_8022) && Not4Flag) ++ return; + + mopPrintHeader(stdout, pkt, trans); + mopPrintMopHeader(stdout, pkt, trans); --- mopd-2.5.3.orig/patches/253patched-254.patch +++ mopd-2.5.3/patches/253patched-254.patch @@ -0,0 +1,3697 @@ +diff -rwu mopd-2.5.3.patched/Makefile mopd-2.5.4.orig/Makefile +--- mopd-2.5.3.patched/Makefile 2003-03-27 09:12:15.000000000 +0000 ++++ mopd-2.5.4.orig/Makefile 2000-08-09 00:57:03.000000000 +0100 +@@ -1,18 +1,19 @@ +-AR = ar +-CC = gcc +-RANLIB = ranlib ++#make file to build linux-mopd ++SUBDIRS=common mopd mopchk mopprobe moptrace ++CFLAGS=-g + +-CFLAGS = -O2 -g +-LDFLAGS = +-LIBELF = -lelf ++all: ++ for dir in ${SUBDIRS}; \ ++ do \ ++ echo making $$dir; \ ++ (cd $$dir; make CFLAGS=$(CFLAGS) ) ; \ ++ done + +-SUBDIRS = common mopd mopchk mopprobe moptrace + +-all clean: +- @for dir in $(SUBDIRS); do \ +- (cd $$dir && \ +- $(MAKE) "AR=$(AR)" "CC=$(CC)" "RANLIB=$(RANLIB)" \ +- "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" \ +- "LIBELF=$(LIBELF)" $@) || \ +- exit 1; \ ++clean: ++ for dir in ${SUBDIRS} ; \ ++ do \ ++ (cd $$dir ; make clean); \ + done ++ ++ +diff -rwu mopd-2.5.3.patched/common/Makefile mopd-2.5.4.orig/common/Makefile +--- mopd-2.5.3.patched/common/Makefile 2003-03-27 09:05:58.000000000 +0000 ++++ mopd-2.5.4.orig/common/Makefile 2000-08-09 00:57:49.000000000 +0100 +@@ -1,21 +1,14 @@ +-LIBS = libcommon.a +-OBJS = cmp.o device.o dl.o file.o get.o loop-bsd.o mopdef.o nma.o pf-linux.o \ +- pf.o print.o put.o rc.o version.o ++#simple make file for linux + +-CPPFLAGS = + +-all: $(LIBS) ++OBJS=cmp.o dl.o get.o mopdef.o pf-linux2.o put.o device.o file.o loop-linux2.o nma.o print.o rc.o + +-libcommon.a: $(OBJS) +- -rm -f libcommon.a +- $(AR) cru libcommon.a $(OBJS) +- $(RANLIB) libcommon.a ++libcommon.a: ${OBJS} ++ ar -rs libcommon.a ${OBJS} + +-.c.o: +- $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< +- +-version.c: VERSION +- sed 's/.*/char version[] = "&";/' < VERSION > version.c ++.c.o: .o ++ cc -c $(CFLAGS) $< + + clean: +- rm -f core *.a *.o version.c ++ rm -f *.o *.a *~ ++ +diff -rwu mopd-2.5.3.patched/common/cmp.c mopd-2.5.4.orig/common/cmp.c +--- mopd-2.5.3.patched/common/cmp.c 1995-09-29 13:32:23.000000000 +0100 ++++ mopd-2.5.4.orig/common/cmp.c 2000-08-08 23:41:50.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: cmp.c,v 1.2 1997/03/25 03:07:02 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -27,15 +29,17 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: cmp.c,v 1.2 1995/09/29 12:30:42 moj Exp $"; ++#include ++#ifndef lint ++static char rcsid[]="$NetBSD: cmp.c,v 1.2 1997/03/25 03:07:02 thorpej Exp $"; + #endif + + #include "os.h" ++#include "cmp.h" + + int + mopCmpEAddr(addr1, addr2) +- register u_char *addr1, *addr2; ++ u_char *addr1, *addr2; + { +- return(bcmp((char *)addr1, (char *)addr2, 6)); ++ return(memcmp((char *)addr1, (char *)addr2, 6)); + } +diff -rwu mopd-2.5.3.patched/common/cmp.h mopd-2.5.4.orig/common/cmp.h +--- mopd-2.5.3.patched/common/cmp.h 1995-09-28 11:26:09.000000000 +0100 ++++ mopd-2.5.4.orig/common/cmp.h 2000-08-08 22:48:05.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: cmp.h,v 1.2 1997/03/25 03:07:04 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -26,19 +28,15 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: cmp.h,v 1.2 1995/09/28 10:24:01 moj Exp $ ++ * $NetBSD: cmp.h,v 1.2 1997/03/25 03:07:04 thorpej Exp $ + * + */ + + #ifndef _CMP_H_ + #define _CMP_H_ + +-#ifdef NO__P +-int mopCmpEAddr (/* u_char *,u_char * */); +-#else + __BEGIN_DECLS + int mopCmpEAddr __P((u_char *,u_char *)); + __END_DECLS +-#endif + + #endif _CMP_H_ +diff -rwu mopd-2.5.3.patched/common/device.c mopd-2.5.4.orig/common/device.c +--- mopd-2.5.3.patched/common/device.c 2003-03-27 09:14:41.000000000 +0000 ++++ mopd-2.5.4.orig/common/device.c 2000-08-08 23:42:20.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: device.c,v 1.2 1997/03/25 03:07:06 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -27,29 +29,20 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: device.c,v 1.21 1996/08/08 00:00:59 moj Exp $"; ++#include ++#ifndef lint ++static char rcsid[]="$NetBSD: device.c,v 1.2 1997/03/25 03:07:06 thorpej Exp $"; + #endif + + #include "os.h" + #include "common.h" ++#include "device.h" + #include "mopdef.h" + #include "pf.h" + + struct if_info *iflist; /* Interface List */ + +-void mopReadDL(); +-void mopReadRC(); +-#ifdef NO__P +-int mopOpenDL(/* struct if_info *, int */); +-int mopOpenRC(/* struct if_info *, int */); +-#else +-int mopOpenDL(struct if_info *, int); +-int mopOpenRC(struct if_info *, int); +-#endif +-int pfTrans(); +-int pfInit(); +-int pfWrite(); ++void deviceOpen __P((char *, u_short, int)); + + #ifdef DEV_NEW_CONF + /* +@@ -83,7 +76,6 @@ + if (ioctl(fd, SIOCGIFCONF, (caddr_t)&ifc) < 0 || + ifc.ifc_len < sizeof(struct ifreq)) { + syslog(LOG_ERR, "deviceEthAddr: SIOGIFCONF: %m"); +- (void) close(fd); + exit(1); + } + ifr = ifc.ifc_req; +@@ -95,14 +87,12 @@ + sdl->sdl_alen != 6) + continue; + if (!strncmp(ifr->ifr_name, ifname, sizeof(ifr->ifr_name))) { +- bcopy((caddr_t)LLADDR(sdl), (caddr_t)eaddr, 6); +- (void) close(fd); ++ memmove((caddr_t)eaddr, (caddr_t)LLADDR(sdl), 6); + return; + } + } + + syslog(LOG_ERR, "deviceEthAddr: Never saw interface `%s'!", ifname); +- (void) close(fd); + exit(1); + } + #endif /* DEV_NEW_CONF */ +@@ -146,14 +136,11 @@ + p->iopen = tmp.iopen; + p->write = pfWrite; + p->read = tmp.read; +- bzero((char *)p->eaddr,sizeof(p->eaddr)); ++ memset((char *)p->eaddr, 0, sizeof(p->eaddr)); + p->fd = tmp.fd; +- p->trans = trans; + + #ifdef DEV_NEW_CONF + deviceEthAddr(p->if_name,&p->eaddr[0]); +-#elif defined(__linux__) +- pfEthAddr(0, p->if_name,&p->eaddr[0]); + #else + p->eaddr[0]= tmp.eaddr[0]; + p->eaddr[1]= tmp.eaddr[1]; +@@ -163,16 +150,6 @@ + p->eaddr[5]= tmp.eaddr[5]; + #endif /* DEV_NEW_CONF */ + +- switch (proto) { +- case MOP_K_PROTO_RC: +- pfAddMulti(-1,p->if_name,&rc_mcst[0]); +- break; +- case MOP_K_PROTO_DL: +- pfAddMulti(-1,p->if_name,&dl_mcst[0]); +- break; +- default: +- break; +- } + } + } + +@@ -230,26 +207,17 @@ + + switch (trans) { + case TRANS_ETHER: ++ deviceOpen(interface,MOP_K_PROTO_RC,TRANS_ETHER); ++ break; + case TRANS_8023: +- case TRANS_FDDI_8021H: +- case TRANS_FDDI_8022: +- deviceOpen(interface, MOP_K_PROTO_RC, trans); ++ deviceOpen(interface,MOP_K_PROTO_RC,TRANS_8023); + break; + case TRANS_ETHER + TRANS_8023: + deviceOpen(interface, MOP_K_PROTO_RC, TRANS_ETHER); + deviceOpen(interface, MOP_K_PROTO_RC, TRANS_8023); + break; +- case TRANS_FDDI_8021H + TRANS_FDDI_8022: +- deviceOpen(interface, MOP_K_PROTO_RC, TRANS_FDDI_8021H); +- deviceOpen(interface, MOP_K_PROTO_RC, TRANS_FDDI_8022); +- break; + case TRANS_ETHER + TRANS_8023 + TRANS_AND: +- deviceOpen(interface, MOP_K_PROTO_RC, +- TRANS_ETHER + TRANS_8023); +- break; +- case TRANS_FDDI_8021H + TRANS_FDDI_8022 + TRANS_AND: +- deviceOpen(interface, MOP_K_PROTO_RC, +- TRANS_FDDI_8021H + TRANS_FDDI_8022); ++ deviceOpen(interface,MOP_K_PROTO_RC,TRANS_ETHER+TRANS_8023); + break; + } + #endif +@@ -259,26 +227,17 @@ + + switch (trans) { + case TRANS_ETHER: ++ deviceOpen(interface,MOP_K_PROTO_DL,TRANS_ETHER); ++ break; + case TRANS_8023: +- case TRANS_FDDI_8021H: +- case TRANS_FDDI_8022: +- deviceOpen(interface, MOP_K_PROTO_DL, trans); ++ deviceOpen(interface,MOP_K_PROTO_DL,TRANS_8023); + break; + case TRANS_ETHER + TRANS_8023: + deviceOpen(interface, MOP_K_PROTO_DL, TRANS_ETHER); + deviceOpen(interface, MOP_K_PROTO_DL, TRANS_8023); + break; +- case TRANS_FDDI_8021H + TRANS_FDDI_8022: +- deviceOpen(interface, MOP_K_PROTO_DL, TRANS_FDDI_8021H); +- deviceOpen(interface, MOP_K_PROTO_DL, TRANS_FDDI_8022); +- break; + case TRANS_ETHER + TRANS_8023 + TRANS_AND: +- deviceOpen(interface, MOP_K_PROTO_DL, +- TRANS_ETHER + TRANS_8023); +- break; +- case TRANS_FDDI_8021H + TRANS_FDDI_8022 + TRANS_AND: +- deviceOpen(interface, MOP_K_PROTO_DL, +- TRANS_FDDI_8021H + TRANS_FDDI_8022); ++ deviceOpen(interface,MOP_K_PROTO_DL,TRANS_ETHER+TRANS_8023); + break; + } + #endif +@@ -344,7 +303,7 @@ + ifc.ifc_len = sizeof ibuf; + ifc.ifc_buf = (caddr_t)ibuf; + if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) < 0 || +- ifc.ifc_len < (int)sizeof(struct ifreq)) { ++ ifc.ifc_len < sizeof(struct ifreq)) { + syslog(LOG_ERR, "deviceInitAll: old SIOCGIFCONF: %m"); + exit(1); + } +diff -rwu mopd-2.5.3.patched/common/device.h mopd-2.5.4.orig/common/device.h +--- mopd-2.5.3.patched/common/device.h 1995-09-28 11:51:48.000000000 +0100 ++++ mopd-2.5.4.orig/common/device.h 2000-08-08 22:48:05.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: device.h,v 1.2 1997/03/25 03:07:07 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -26,27 +28,26 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: device.h,v 1.3 1995/09/28 10:49:41 moj Exp $ ++ * $NetBSD: device.h,v 1.2 1997/03/25 03:07:07 thorpej Exp $ + * + */ + + #ifndef _DEVICE_H_ + #define _DEVICE_H_ + +-#ifdef NO__P +-#ifdef DEV_NEW_CONF +-void deviceEthAddr (/* char *,u_char * */); +-#endif +-void deviceInitOne (/* char * */); +-void deviceInitAll (/* void */); +-#else + __BEGIN_DECLS + #ifdef DEV_NEW_CONF + void deviceEthAddr __P((char *,u_char *)); + #endif + void deviceInitOne __P((char *)); + void deviceInitAll __P((void)); ++ ++/* from loop-bsd.c */ ++void Loop __P((void)); ++int mopOpenDL __P((struct if_info *, int)); ++int mopOpenRC __P((struct if_info *, int)); ++void mopReadDL __P((void)); ++void mopReadRC __P((void)); + __END_DECLS +-#endif + + #endif _DEVICE_H_ +Only in mopd-2.5.3.patched/common: device.o +diff -rwu mopd-2.5.3.patched/common/dl.c mopd-2.5.4.orig/common/dl.c +--- mopd-2.5.3.patched/common/dl.c 2003-03-27 09:14:41.000000000 +0000 ++++ mopd-2.5.4.orig/common/dl.c 2000-08-09 19:36:41.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: dl.c,v 1.3 1997/10/16 23:24:31 lukem Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -27,14 +29,16 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: dl.c,v 1.7 1996/08/05 07:37:53 moj Exp $"; ++#include ++#ifndef lint ++static char rcsid[]="$NetBSD: dl.c,v 1.3 1997/10/16 23:24:31 lukem Exp $"; + #endif + + #include "os.h" ++#include "dl.h" + #include "get.h" +-#include "print.h" + #include "mopdef.h" ++#include "print.h" + + void + mopDumpDL(fd, pkt, trans) +@@ -43,33 +47,26 @@ + int trans; + { + int i,index = 0; +- u_int tmpl; ++ u_int32_t tmpl; + u_char tmpc,c,program[257],code,*ucp; +- int len,tmps,moplen; ++ u_short len,tmps,moplen; + + len = mopGetLength(pkt, trans); + + switch (trans) { +- case TRANS_ETHER: +- index = 16; +- moplen = len; +- break; + case TRANS_8023: + index = 22; + moplen = len - 8; + break; +- case TRANS_FDDI_8021H: +- case TRANS_FDDI_8022: +- index = 23; +- moplen = len; +- break; + default: +- moplen = 0; ++ index = 16; ++ moplen = len; + } +- if (moplen < 1) /* broken packet */ +- return; + code = mopGetChar(pkt,&index); + ++ /* see above, if (len < 8) then moplen ends up around 65535 */ ++ if (moplen > len) moplen = len; ++ + switch (code) { + case MOP_K_CODE_MLT: + +diff -rwu mopd-2.5.3.patched/common/dl.h mopd-2.5.4.orig/common/dl.h +--- mopd-2.5.3.patched/common/dl.h 1995-10-13 20:29:04.000000000 +0100 ++++ mopd-2.5.4.orig/common/dl.h 2000-08-08 22:48:06.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: dl.h,v 1.2 1997/03/25 03:07:10 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -26,19 +28,15 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: dl.h,v 1.4 1995/10/13 19:28:38 moj Exp $ ++ * $NetBSD: dl.h,v 1.2 1997/03/25 03:07:10 thorpej Exp $ + * + */ + + #ifndef _DL_H_ + #define _DL_H_ + +-#ifdef NO__P +-void mopDumpDL (/* FILE *, u_char *, int */); +-#else + __BEGIN_DECLS + void mopDumpDL __P((FILE *, u_char *, int)); + __END_DECLS +-#endif + + #endif _DL_H_ +Only in mopd-2.5.3.patched/common: dl.o +diff -rwu mopd-2.5.3.patched/common/get.c mopd-2.5.4.orig/common/get.c +--- mopd-2.5.3.patched/common/get.c 2003-03-27 09:14:41.000000000 +0000 ++++ mopd-2.5.4.orig/common/get.c 2000-08-08 23:43:28.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: get.c,v 1.2 1997/03/25 03:07:15 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -27,18 +29,19 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: get.c,v 1.5 1996/03/31 18:50:14 moj Exp $"; ++#include ++#ifndef lint ++static char rcsid[]="$NetBSD: get.c,v 1.2 1997/03/25 03:07:15 thorpej Exp $"; + #endif + +-#include +-#include ++#include "os.h" ++#include "get.h" + #include "mopdef.h" + + u_char + mopGetChar(pkt, index) +- register u_char *pkt; +- register int *index; ++ u_char *pkt; ++ int *index; + { + u_char ret; + +@@ -49,8 +52,8 @@ + + u_short + mopGetShort(pkt, index) +- register u_char *pkt; +- register int *index; ++ u_char *pkt; ++ int *index; + { + u_short ret; + +@@ -59,12 +62,12 @@ + return(ret); + } + +-u_int ++u_int32_t + mopGetLong(pkt, index) +- register u_char *pkt; +- register int *index; ++ u_char *pkt; ++ int *index; + { +- u_long ret; ++ u_int32_t ret; + + ret = pkt[*index] + + pkt[*index+1]*0x100 + +@@ -76,8 +79,8 @@ + + void + mopGetMulti(pkt, index, dest, size) +- register u_char *pkt,*dest; +- register int *index,size; ++ u_char *pkt,*dest; ++ int *index,size; + { + int i; + +@@ -95,31 +98,16 @@ + { + u_short *ptype; + +- if ((trans & (TRANS_ETHER + TRANS_8023))) { ++ if (trans == 0) { + ptype = (u_short *)(pkt+12); + if (ntohs(*ptype) < 1600) { +- trans &= TRANS_8023; ++ trans = TRANS_8023; + } else { +- trans &= TRANS_ETHER; ++ trans = TRANS_ETHER; + } +- return(trans); +- } +- if ((trans & (TRANS_FDDI_8021H + TRANS_FDDI_8022))) { +- if (*pkt >= MOP_K_FDDI_FC_MIN && *pkt <= MOP_K_FDDI_FC_MAX) { +- if (!bcmp((char *)(pkt+16), (char *)dl_802_proto, 3)) { +- trans &= TRANS_FDDI_8022; +- return(trans); + } +- if (!bcmp((char *)(pkt+16), +- (char *)dl_8021h_proto, 3)) { +- trans &= TRANS_FDDI_8021H; + return(trans); + } +- } +- return(0); +- } +- return(0); +-} + + void + mopGetHeader(pkt, index, dst, src, proto, len, trans) +@@ -127,35 +115,23 @@ + int *index, *len, trans; + u_short *proto; + { +- switch(trans) { +- case TRANS_ETHER: + *dst = pkt; + *src = pkt + 6; + *index = *index + 12; ++ ++ switch(trans) { ++ case TRANS_ETHER: + *proto = (u_short)(pkt[*index]*256 + pkt[*index+1]); + *index = *index + 2; + *len = (int)(pkt[*index+1]*256 + pkt[*index]); + *index = *index + 2; + break; + case TRANS_8023: +- *dst = pkt; +- *src = pkt + 6; +- *index = *index + 12; + *len = (int)(pkt[*index]*256 + pkt[*index+1]); + *index = *index + 8; + *proto = (u_short)(pkt[*index]*256 + pkt[*index+1]); + *index = *index + 2; + break; +- case TRANS_FDDI_8021H: +- case TRANS_FDDI_8022: +- *dst = pkt + 1; +- *src = pkt + 7; +- *index = *index + 19; +- *proto = (u_short)(pkt[*index]*256 + pkt[*index+1]); +- *index = *index + 2; +- *len = (int)(pkt[*index+1]*256 + pkt[*index]); +- *index = *index + 2; +- break; + } + } + +@@ -171,10 +147,6 @@ + case TRANS_8023: + return(pkt[12]*256 + pkt[13]); + break; +- case TRANS_FDDI_8021H: +- case TRANS_FDDI_8022: +- return(pkt[22]*256 + pkt[21]); +- break; + } + return(0); + } +diff -rwu mopd-2.5.3.patched/common/get.h mopd-2.5.4.orig/common/get.h +--- mopd-2.5.3.patched/common/get.h 2003-03-27 09:13:20.000000000 +0000 ++++ mopd-2.5.4.orig/common/get.h 2000-08-08 22:48:06.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: get.h,v 1.2 1997/03/25 03:07:16 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -26,33 +28,22 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: get.h,v 1.4 1995/10/05 20:21:31 moj Exp $ ++ * $NetBSD: get.h,v 1.2 1997/03/25 03:07:16 thorpej Exp $ + * + */ + + #ifndef _GET_H_ + #define _GET_H_ + +-#ifdef NO__P +-u_char mopGetChar (/* u_char *, int * */); +-u_short mopGetShort (/* u_char *, int * */); +-u_int mopGetLong (/* u_char *, int * */); +-void mopGetMulti (/* u_char *, int *,u_char *,int */); +-int mopGetTrans (/* u_char *, int */); +-void mopGetHeader (/* u_char *, int *, u_char **, u_char **, u_short *, +- int *, int */); +-u_short mopGetLength (/* u_char *, int */); +-#else + __BEGIN_DECLS + u_char mopGetChar __P((u_char *,int *)); + u_short mopGetShort __P((u_char *,int *)); +-u_int mopGetLong __P((u_char *,int *)); ++u_int32_t mopGetLong __P((u_char *, int *)); + void mopGetMulti __P((u_char *,int *,u_char *,int)); + int mopGetTrans __P((u_char *, int)); +-void mopGetHeader __P((u_char *, int *, u_char **, u_char **, u_short *, +- int *, int)); ++void mopGetHeader __P((u_char *, int *, u_char **, u_char **, ++ u_short *, int *, int)); + u_short mopGetLength __P((u_char *, int)); + __END_DECLS +-#endif + +-#endif _GET_H_ ++#endif /* _GET_H_ */ +Only in mopd-2.5.3.patched/common: get.o +Only in mopd-2.5.3.patched/common: libcommon.a +diff -rwu mopd-2.5.3.patched/common/loop-bsd.c mopd-2.5.4.orig/common/loop-bsd.c +--- mopd-2.5.3.patched/common/loop-bsd.c 2003-03-27 09:13:28.000000000 +0000 ++++ mopd-2.5.4.orig/common/loop-bsd.c 2000-08-08 22:48:06.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: loop-bsd.c,v 1.4 1998/02/03 04:51:29 perry Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -27,24 +29,24 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: loop-bsd.c,v 1.11 1996/08/16 22:41:28 moj Exp $"; ++#include ++#ifndef lint ++__RCSID("$NetBSD: loop-bsd.c,v 1.4 1998/02/03 04:51:29 perry Exp $"); + #endif + ++#include + #include + #include + #include + #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__NetBSD__) + #include + #endif +-#if !defined(__linux__) + #include +-#endif + #include +-#include + + #include "os.h" + #include "common.h" ++#include "device.h" + #include "mopdef.h" + + int +@@ -112,16 +114,12 @@ + syslog(LOG_ERR, "no interfaces"); + exit(0); + } +-#ifndef __linux__ + if (iflist->fd != -1) { + if (ioctl(iflist->fd, BIOCGBLEN, (caddr_t) & bufsize) < 0) { + syslog(LOG_ERR, "BIOCGBLEN: %m"); + exit(0); + } + } +-#else +- bufsize = 8192; +-#endif + buf = (u_char *) malloc((unsigned) bufsize); + if (buf == 0) { + syslog(LOG_ERR, "malloc: %m"); +@@ -141,8 +139,8 @@ + } + while (1) { + listeners = fds; +- if (select(maxfd + 1, &listeners, (fd_set *) 0, +- (fd_set *) 0, (struct timeval *) 0) < 0) { ++ if (select(maxfd + 1, &listeners, (struct fd_set *) 0, ++ (struct fd_set *) 0, (struct timeval *) 0) < 0) { + syslog(LOG_ERR, "select: %m"); + exit(0); + } +@@ -172,20 +170,14 @@ + #define bhp ((struct bpf_hdr *)bp) + bp = buf; + ep = bp + cc; +-#ifndef __linux__ + while (bp < ep) { +- register int caplen, hdrlen; ++ int caplen, hdrlen; + + caplen = bhp->bh_caplen; + hdrlen = bhp->bh_hdrlen; + mopProcess(ii, bp + hdrlen); + bp += BPF_WORDALIGN(hdrlen + caplen); + } +-#else +- if (bp < ep) { +- mopProcess(ii,buf); +- } +-#endif + } + } + } +Only in mopd-2.5.3.patched/common: loop-bsd.o +Only in mopd-2.5.4.orig/common: loop-linux2.c +diff -rwu mopd-2.5.3.patched/common/mopdef.c mopd-2.5.4.orig/common/mopdef.c +--- mopd-2.5.3.patched/common/mopdef.c 2003-03-27 09:14:41.000000000 +0000 ++++ mopd-2.5.4.orig/common/mopdef.c 2000-08-08 23:43:49.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: mopdef.c,v 1.2 1997/03/25 03:07:19 thorpej Exp $ */ ++ + /* + * Copyright (c) 1995 Mats O Jansson. All rights reserved. + * +@@ -27,8 +29,9 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: mopdef.c,v 1.2 1995/10/02 16:50:22 moj Exp $"; ++#include ++#ifndef lint ++static char rcsid[]="$NetBSD: mopdef.c,v 1.2 1997/03/25 03:07:19 thorpej Exp $"; + #endif + + #define MOPDEF_SURPESS_EXTERN +@@ -39,10 +42,8 @@ + char dl_802_proto[5] = MOP_K_PROTO_802_DL; /* MOP Dump/Load 802.2 */ + char rc_802_proto[5] = MOP_K_PROTO_802_RC; /* MOP Remote Console 802.2 */ + char lp_802_proto[5] = MOP_K_PROTO_802_LP; /* Loopback 802.2 */ +-char dl_8021h_proto[5] = MOP_K_PROTO_8021H_DL; /* MOP Dump/Load 802.1H */ +-char rc_8021h_proto[5] = MOP_K_PROTO_8021H_RC; /* MOP Remote Console 802.1H */ +-char lp_8021h_proto[5] = MOP_K_PROTO_8021H_LP; /* Loopback 802.1H */ + ++#if 0 + int + mopdef_dummy() + { +@@ -50,3 +51,4 @@ + return(dl_mcst[0]-rc_mcst[0]- + lp_802_proto[1]-rc_802_proto[1]-lp_802_proto[1]); + } ++#endif +diff -rwu mopd-2.5.3.patched/common/mopdef.h mopd-2.5.4.orig/common/mopdef.h +--- mopd-2.5.3.patched/common/mopdef.h 2003-03-27 09:14:41.000000000 +0000 ++++ mopd-2.5.4.orig/common/mopdef.h 2000-08-08 22:48:06.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD$ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -26,7 +28,7 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: mopdef.h,v 1.11 1995/10/12 20:22:21 moj Exp $ ++ * $NetBSD: mopdef.h,v 1.1.1.1 1997/03/16 22:23:36 cjs Exp $ + * + */ + +@@ -41,24 +43,13 @@ + #define MOP_K_PROTO_802_RC { 0x08, 0x00, 0x2b, 0x60, 0x02 } + #define MOP_K_PROTO_802_LP { 0x08, 0x00, 0x2b, 0x90, 0x00 } + +-#define MOP_K_PROTO_8021H_DL { 0x00, 0x00, 0x00, 0x60, 0x01 } +-#define MOP_K_PROTO_8021H_RC { 0x00, 0x00, 0x00, 0x60, 0x02 } +-#define MOP_K_PROTO_8021H_LP { 0x00, 0x00, 0x00, 0x90, 0x00 } +- + #define MOP_K_PROTO_802_DSAP 0xaa + #define MOP_K_PROTO_802_SSAP 0xaa + #define MOP_K_PROTO_802_CNTL 0x03 + +-#define MOP_K_FDDI_FC_MIN 0x50 /* Accepted frame types: async LLC */ +-#define MOP_K_FDDI_FC_MAX 0x57 +- +-#define MOP_K_FDDI_FC_DEF 0x54 /* Sent frame type: async4 LLC */ +- + #define TRANS_ETHER 1 /* Packet in Ethernet format */ + #define TRANS_8023 2 /* Packet in 802.3 format */ +-#define TRANS_FDDI_8021H 4 /* Packet in FDDI 802.1H format */ +-#define TRANS_FDDI_8022 8 /* Packet in FDDI 802.2 format */ +-#define TRANS_AND 0x1000 /* All formats specified */ ++#define TRANS_AND 0x1000 /* Both Ethernet and 802.3 */ + + /* The following constants are defined in module MOPDEF.SDL in MOM */ + +@@ -202,9 +193,6 @@ + extern char dl_802_proto[]; + extern char rc_802_proto[]; + extern char lp_802_proto[]; +-extern char dl_8021h_proto[]; +-extern char rc_8021h_proto[]; +-extern char lp_8021h_proto[]; + #endif MOPDEF_SUPRESS_EXTERN + + #endif _MOPDEF_H_ +Only in mopd-2.5.3.patched/common: mopdef.o +diff -rwu mopd-2.5.3.patched/common/nma.c mopd-2.5.4.orig/common/nma.c +--- mopd-2.5.3.patched/common/nma.c 2003-03-27 09:05:58.000000000 +0000 ++++ mopd-2.5.4.orig/common/nma.c 2000-08-08 23:44:09.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: nma.c,v 1.2 1997/03/25 03:07:22 thorpej Exp $ */ ++ + /* + * Copyright (c) 1995 Mats O Jansson. All rights reserved. + * +@@ -27,11 +29,13 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: nma.c,v 1.5 1995/09/28 13:37:10 moj Exp $"; ++#include ++#ifndef lint ++static char rcsid[]="$NetBSD: nma.c,v 1.2 1997/03/25 03:07:22 thorpej Exp $"; + #endif + +-#include ++#include "os.h" ++#include "nma.h" + #include "nmadef.h" + + struct commDev { +@@ -221,4 +225,3 @@ + + return(current->name); + } +- +diff -rwu mopd-2.5.3.patched/common/nma.h mopd-2.5.4.orig/common/nma.h +--- mopd-2.5.3.patched/common/nma.h 1995-09-28 14:38:42.000000000 +0100 ++++ mopd-2.5.4.orig/common/nma.h 2000-08-08 22:48:06.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: nma.h,v 1.2 1997/03/25 03:07:23 thorpej Exp $ */ ++ + /* + * Copyright (c) 1995 Mats O Jansson. All rights reserved. + * +@@ -26,21 +28,16 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: nma.h,v 1.3 1995/09/28 13:36:55 moj Exp $ ++ * $NetBSD: nma.h,v 1.2 1997/03/25 03:07:23 thorpej Exp $ + * + */ + + #ifndef _NMA_H_ + #define _NMA_H_ + +-#ifdef NO__P +-char *nmaGetShort (/* int */); +-char *nmaGetDevice (/* int */); +-#else + __BEGIN_DECLS + char *nmaGetShort __P((int)); + char *nmaGetDevice __P((int)); + __END_DECLS +-#endif + + #endif _NMA_H_ +Only in mopd-2.5.3.patched/common: nma.o +diff -rwu mopd-2.5.3.patched/common/nmadef.h mopd-2.5.4.orig/common/nmadef.h +--- mopd-2.5.3.patched/common/nmadef.h 1995-07-10 21:06:43.000000000 +0100 ++++ mopd-2.5.4.orig/common/nmadef.h 2000-08-08 22:48:06.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD$ */ ++ + /* + * Copyright (c) 1995 Mats O Jansson. All rights reserved. + * +@@ -26,7 +28,7 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: nmadef.h,v 1.1 1995/07/10 20:06:06 moj Exp $ ++ * $NetBSD: nmadef.h,v 1.1.1.1 1997/03/16 22:23:37 cjs Exp $ + * + */ + +diff -rwu mopd-2.5.3.patched/common/os.h mopd-2.5.4.orig/common/os.h +--- mopd-2.5.3.patched/common/os.h 2003-03-27 09:10:13.000000000 +0000 ++++ mopd-2.5.4.orig/common/os.h 2000-08-08 23:34:01.000000000 +0100 +@@ -1,5 +1,7 @@ ++/* $OpenBSD: os-linux2.h,v 1.1 1999/03/27 14:31:22 maja Exp $ */ ++ + /* +- * Copyright (c) 1994-95 Mats O Jansson. All rights reserved. ++ * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +@@ -26,27 +28,11 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: os.h,v 1.5 1995/08/05 18:53:37 moj Exp $ +- * ++ * @(#) $OpenBSD: os-linux2.h,v 1.1 1999/03/27 14:31:22 maja Exp $ + */ + +-#ifndef _OS_H_ +-#define _OS_H_ +- +-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +-#define DEV_NEW_CONF +-#endif +- +-#if defined(__linux__) +-#define SETPGRP_NOPARAM +-#endif +- + #include + +-#ifndef FILENAME_MAX +-#define FILENAME_MAX 255 /* SunOS 4 is missing it */ +-#endif +- + #include + #include + #include +@@ -54,27 +40,14 @@ + #include + #include + #include +-#ifdef DEV_NEW_CONF +-#include +-#include +-#endif + #include + #include + #include + #include + #include +-#if defined(sun) +-#include +-#else +-#include +-#endif + #include ++#include + +-#include +-#include +- +-#if defined(sun) +-typedef int ssize_t; +-#endif ++#define LINUX2_PF ++#define SETPGRP_NOPARAM + +-#endif _OS_H_ +Only in mopd-2.5.3.patched/common: pf-linux.c +Only in mopd-2.5.3.patched/common: pf-linux.o +Only in mopd-2.5.4.orig/common: pf-linux2.c +diff -rwu mopd-2.5.3.patched/common/pf.c mopd-2.5.4.orig/common/pf.c +--- mopd-2.5.3.patched/common/pf.c 2003-03-27 09:13:07.000000000 +0000 ++++ mopd-2.5.4.orig/common/pf.c 2000-08-08 22:48:07.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: pf.c,v 1.4 1997/10/16 23:24:55 lukem Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * Copyright (c) 1990 The Regents of the University of California. +@@ -31,43 +33,24 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef __linux__ +- +-#ifndef LINT +-static char rcsid[] = "$Id: pf.c,v 1.16 1996/08/06 14:19:48 moj Exp $"; ++#include ++#ifndef lint ++__RCSID("$NetBSD: pf.c,v 1.4 1997/10/16 23:24:55 lukem Exp $"); + #endif + +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include "os.h" + ++#include + #include +-#include +- +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include + + #include "mopdef.h" ++#include "pf.h" + + /* + * Variables + */ + +-extern int errno; +-extern int nomulti; ++extern int promisc; + + /* + * Return information to device.c how to open device. +@@ -121,7 +104,7 @@ + } while (fd < 0 && errno == EBUSY); + + if (fd < 0) { +- syslog(LOG_ERR,"pfInit: open bpf %m"); ++ syslog(LOG_ERR,"pfInit: open %s: %m", device); + return(-1); + } + +@@ -146,8 +129,7 @@ + syslog(LOG_ERR,"pfInit: %s is not ethernet", device); + return(-1); + } +- if (!nomulti) { +- syslog(LOG_WARNING,"pfInit: using promiscuous mode for multicast reception"); ++ if (promisc) { + /* Set promiscuous mode. */ + if (ioctl(fd, BIOCPROMISC, (caddr_t)0) < 0) { + syslog(LOG_ERR,"pfInit: BIOCPROMISC: %m"); +@@ -180,7 +162,7 @@ + strcpy(ifr.ifr_name, interface); + + ifr.ifr_addr.sa_family = AF_UNSPEC; +- bcopy(addr, ifr.ifr_addr.sa_data, 6); ++ memmove(ifr.ifr_addr.sa_data, addr, 6); + + /* + * open a socket, temporarily, to use for SIOC* ioctls +@@ -215,7 +197,7 @@ + strcpy(ifr.ifr_name, interface); + + ifr.ifr_addr.sa_family = AF_UNSPEC; +- bcopy(addr, ifr.ifr_addr.sa_data, 6); ++ memmove(ifr.ifr_addr.sa_data, addr, 6); + + /* + * open a socket, temporarily, to use for SIOC* ioctls +@@ -280,4 +262,3 @@ + return(-1); + } + +-#endif /* !__linux__ */ +diff -rwu mopd-2.5.3.patched/common/pf.h mopd-2.5.4.orig/common/pf.h +--- mopd-2.5.3.patched/common/pf.h 2003-03-27 09:13:20.000000000 +0000 ++++ mopd-2.5.4.orig/common/pf.h 2000-08-08 22:48:07.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: pf.h,v 1.2 1997/03/25 03:07:29 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -26,31 +28,21 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: pf.h,v 1.4 1995/10/13 19:30:46 moj Exp $ ++ * $NetBSD: pf.h,v 1.2 1997/03/25 03:07:29 thorpej Exp $ + * + */ + + #ifndef _PF_H_ + #define _PF_H_ + +-#ifdef NO__P +-int pfTrans (/* char * */); +-int pfInit (/* char *, int, u_short, int */); +-int pfEthAddr (/* int, char *, u_char * */); +-int pfAddMulti (/* int, char *, char * */); +-int pfDelMulti (/* int, char *, char * */); +-int pfRead (/* int, u_char *, int */); +-int pfWrite (/* int, u_char *, int, int */); +-#else + __BEGIN_DECLS + int pfTrans __P((char *)); + int pfInit __P((char *, int, u_short, int)); +-int pfEthAddr __P((int, char *, u_char *)); ++int pfEthAddr __P((int, u_char *)); + int pfAddMulti __P((int, char *, char *)); + int pfDelMulti __P((int, char *, char *)); + int pfRead __P((int, u_char *, int)); + int pfWrite __P((int, u_char *, int, int)); + __END_DECLS +-#endif + + #endif _PF_H_ +Only in mopd-2.5.3.patched/common: pf.o +diff -rwu mopd-2.5.3.patched/common/print.c mopd-2.5.4.orig/common/print.c +--- mopd-2.5.3.patched/common/print.c 2003-03-27 09:14:41.000000000 +0000 ++++ mopd-2.5.4.orig/common/print.c 2000-08-08 23:45:09.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: print.c,v 1.2 1997/03/25 03:07:30 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-96 Mats O Jansson. All rights reserved. + * +@@ -27,19 +29,21 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: print.c,v 1.18 1996/08/16 22:42:08 moj Exp $"; ++#include ++#ifndef lint ++static char rcsid[]="$NetBSD: print.c,v 1.2 1997/03/25 03:07:30 thorpej Exp $"; + #endif + + #include + #include + + #include "os.h" +-#include "mopdef.h" +-#include "nmadef.h" +-#include "nma.h" + #include "cmp.h" + #include "get.h" ++#include "mopdef.h" ++#include "nma.h" ++#include "nmadef.h" ++#include "print.h" + + #define SHORT_PRINT + +@@ -145,24 +149,18 @@ + } + } + +- switch (trans) { +- case TRANS_ETHER: +- (void)fprintf(fd, "EthII "); +- break; +- case TRANS_8023: ++ if (trans == TRANS_8023) { + (void)fprintf(fd, "802.3 "); +- break; +- case TRANS_FDDI_8021H: +- (void)fprintf(fd, "FDDI 802.1H "); +- break; +- case TRANS_FDDI_8022: +- (void)fprintf(fd, "FDDI 802.2 "); +- break; + } + + mopPrintHWA(fd, src); (void)fprintf(fd," > "); + mopPrintHWA(fd, dst); ++ if (len < 1600) { + (void)fprintf(fd, " len %4d code %02x ", len, code); ++ } else { ++ (void)fprintf(fd, " len %4d code %02x ", ++ (len % 256)*256 + (len /256), code); ++ } + + switch (proto) { + case MOP_K_PROTO_DL: +@@ -285,30 +283,37 @@ + (void)fprintf(fd,"Proto : %04x ",proto); + switch (proto) { + case MOP_K_PROTO_DL: +- (void)fprintf(fd, "MOP Dump/Load "); ++ switch (trans) { ++ case TRANS_8023: ++ (void)fprintf(fd, "MOP Dump/Load (802.3)\n"); + break; +- case MOP_K_PROTO_RC: +- (void)fprintf(fd, "MOP Remote Console "); ++ default: ++ (void)fprintf(fd, "MOP Dump/Load\n"); ++ } + break; +- case MOP_K_PROTO_LP: +- (void)fprintf(fd, "MOP Loopback "); ++ case MOP_K_PROTO_RC: ++ switch (trans) { ++ case TRANS_8023: ++ (void)fprintf(fd, "MOP Remote Console (802.3)\n"); + break; ++ default: ++ (void)fprintf(fd, "MOP Remote Console\n"); + } +- switch (trans) { +- case TRANS_ETHER: +- (void)fprintf(fd, "(EthII)"); + break; ++ case MOP_K_PROTO_LP: ++ switch (trans) { + case TRANS_8023: +- (void)fprintf(fd, "(802.3)"); ++ (void)fprintf(fd, "MOP Loopback (802.3)\n"); + break; +- case TRANS_FDDI_8021H: +- (void)fprintf(fd, "(FDDI 802.1H)"); ++ default: ++ (void)fprintf(fd, "MOP Loopback\n"); ++ } + break; +- case TRANS_FDDI_8022: +- (void)fprintf(fd, "(FDDI 802.2)"); ++ default: ++ (void)fprintf(fd, "\n"); + break; + } +- (void)fprintf(fd, "\n"); ++ + + (void)fprintf(fd,"Length : %04x (%d)\n",len,len); + } +@@ -470,10 +475,6 @@ + case TRANS_8023: + moplen = moplen + 14; + break; +- case TRANS_FDDI_8021H: +- case TRANS_FDDI_8022: +- moplen = moplen + 23; +- break; + } + + itype = mopGetShort(pkt,index); +diff -rwu mopd-2.5.3.patched/common/print.h mopd-2.5.4.orig/common/print.h +--- mopd-2.5.3.patched/common/print.h 1995-10-13 20:32:16.000000000 +0100 ++++ mopd-2.5.4.orig/common/print.h 2000-08-08 22:48:07.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: print.h,v 1.2 1997/03/25 03:07:31 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -26,25 +28,13 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: print.h,v 1.8 1995/10/13 19:31:58 moj Exp $ ++ * $NetBSD: print.h,v 1.2 1997/03/25 03:07:31 thorpej Exp $ + * + */ + + #ifndef _PRINT_H_ + #define _PRINT_H_ + +-#ifdef NO__P +-void mopPrintHWA (/* FILE *, u_char * */); +-void mopPrintBPTY (/* FILE *, u_char */); +-void mopPrintPGTY (/* FILE *, u_char */); +-void mopPrintOneline (/* FILE *, u_char *, int */); +-void mopPrintHeader (/* FILE *, u_char *, int */); +-void mopPrintMopHeader (/* FILE *, u_char *, int */); +-void mopPrintDevice (/* FILE *, u_char */); +-void mopPrintTime (/* FILE *, u_char * */); +-void mopPrintInfo (/* FILE *, u_char *, int *, u_short, +- u_char, int */); +-#else + __BEGIN_DECLS + void mopPrintHWA __P((FILE *, u_char *)); + void mopPrintBPTY __P((FILE *, u_char)); +@@ -57,6 +47,5 @@ + void mopPrintInfo __P((FILE *, u_char *, int *, u_short, + u_char, int)); + __END_DECLS +-#endif + + #endif _PRINT_H_ +Only in mopd-2.5.3.patched/common: print.o +diff -rwu mopd-2.5.3.patched/common/put.c mopd-2.5.4.orig/common/put.c +--- mopd-2.5.3.patched/common/put.c 2003-03-27 09:15:02.000000000 +0000 ++++ mopd-2.5.4.orig/common/put.c 2000-08-08 23:45:22.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: put.c,v 1.2 1997/03/25 03:07:33 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -27,22 +29,19 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: put.c,v 1.5 1996/08/16 22:42:56 moj Exp $"; ++#include ++#ifndef lint ++static char rcsid[]="$NetBSD: put.c,v 1.2 1997/03/25 03:07:33 thorpej Exp $"; + #endif + +-#include +-#include +-#include +-#ifdef __FreeBSD__ +-#include +-#endif ++#include "os.h" + #include "mopdef.h" ++#include "put.h" + + void + mopPutChar(pkt, index, value) +- register u_char *pkt; +- register int *index; ++ u_char *pkt; ++ int *index; + u_char value; + { + pkt[*index] = value; +@@ -51,8 +50,8 @@ + + void + mopPutShort(pkt, index, value) +- register u_char *pkt; +- register int *index; ++ u_char *pkt; ++ int *index; + u_short value; + { + int i; +@@ -65,9 +64,9 @@ + + void + mopPutLong(pkt, index, value) +- register u_char *pkt; +- register int *index; +- u_long value; ++ u_char *pkt; ++ int *index; ++ u_int32_t value; + { + int i; + for (i = 0; i < 4; i++) { +@@ -79,8 +78,8 @@ + + void + mopPutMulti(pkt, index, value, size) +- register u_char *pkt,*value; +- register int *index,size; ++ u_char *pkt,*value; ++ int *index,size; + { + int i; + +@@ -92,8 +91,8 @@ + + void + mopPutTime(pkt, index, value) +- register u_char *pkt; +- register int *index; ++ u_char *pkt; ++ int *index; + time_t value; + { + time_t tnow; +@@ -122,54 +121,44 @@ + + void + mopPutHeader(pkt, index, dst, src, proto, trans) +- register u_char *pkt; +- register int *index; +- char dst[], src[]; ++ u_char *pkt; ++ int *index; ++ u_char dst[], src[]; + u_short proto; + int trans; + { + +- if (trans == TRANS_FDDI_8021H || trans == TRANS_FDDI_8022) +- mopPutChar (pkt, index, MOP_K_FDDI_FC_DEF); + mopPutMulti(pkt, index, dst, 6); + mopPutMulti(pkt, index, src, 6); +- if (trans == TRANS_8023) ++ if (trans == TRANS_8023) { + mopPutShort(pkt, index, 0); +- if (trans != TRANS_ETHER) { + mopPutChar (pkt, index, MOP_K_PROTO_802_DSAP); + mopPutChar (pkt, index, MOP_K_PROTO_802_SSAP); + mopPutChar (pkt, index, MOP_K_PROTO_802_CNTL); +- } +- if (trans == TRANS_FDDI_8021H) { +- mopPutChar (pkt, index, 0x00); +- mopPutChar (pkt, index, 0x00); +- mopPutChar (pkt, index, 0x00); +- } +- if (trans == TRANS_8023 || trans == TRANS_FDDI_8022) { + mopPutChar (pkt, index, 0x08); + mopPutChar (pkt, index, 0x00); + mopPutChar (pkt, index, 0x2b); + } +-#if defined(__FreeBSD__) && __FreeBSD_version < 220000 +- if (trans == TRANS_ETHER) { +- mopPutChar(pkt, index, (proto % 256)); +- mopPutChar(pkt, index, (proto / 256)); +- } else { ++#if !defined(__FreeBSD__) + mopPutChar(pkt, index, (proto / 256)); + mopPutChar(pkt, index, (proto % 256)); +- } + #else ++ if (trans == TRANS_8023) { + mopPutChar(pkt, index, (proto / 256)); + mopPutChar(pkt, index, (proto % 256)); ++ } else { ++ mopPutChar(pkt, index, (proto % 256)); ++ mopPutChar(pkt, index, (proto / 256)); ++ } + #endif +- if (trans != TRANS_8023) ++ if (trans == TRANS_ETHER) + mopPutShort(pkt, index, 0); + + } + + void + mopPutLength(pkt, trans, len) +- register u_char *pkt; ++ u_char *pkt; + int trans; + u_short len; + { +@@ -183,23 +172,14 @@ + break; + case TRANS_8023: + index = 12; +-#if defined(__FreeBSD__) && __FreeBSD_version < 220000 +- mopPutChar(pkt, &index, ((len - 14) % 256)); ++#if !defined(__FreeBSD__) + mopPutChar(pkt, &index, ((len - 14) / 256)); ++ mopPutChar(pkt, &index, ((len - 14) % 256)); + #else +- mopPutChar(pkt, &index, ((len - 14) / 256)); + mopPutChar(pkt, &index, ((len - 14) % 256)); ++ mopPutChar(pkt, &index, ((len - 14) / 256)); + #endif + break; +- case TRANS_FDDI_8021H: +- case TRANS_FDDI_8022: +- index = 21; +- mopPutChar(pkt, &index, ((len - 23) % 256)); +- mopPutChar(pkt, &index, ((len - 23) / 256)); +- break; + } + + } +- +- +- +diff -rwu mopd-2.5.3.patched/common/put.h mopd-2.5.4.orig/common/put.h +--- mopd-2.5.3.patched/common/put.h 1995-10-05 13:27:29.000000000 +0100 ++++ mopd-2.5.4.orig/common/put.h 2000-08-08 22:48:07.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: put.h,v 1.2 1997/03/25 03:07:34 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -26,31 +28,21 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: put.h,v 1.3 1995/10/05 12:26:59 moj Exp $ ++ * $NetBSD: put.h,v 1.2 1997/03/25 03:07:34 thorpej Exp $ + * + */ + + #ifndef _PUT_H_ + #define _PUT_H_ + +-#ifdef NO__P +-void mopPutChar (/* u_char *, int *, u_char */); +-void mopPutShort (/* u_char *, int *, u_short */); +-void mopPutLong (/* u_char *, int *, u_long */); +-void mopPutMulti (/* u_char *, int *, u_char *, int */); +-void mopPutTime (/* u_char *, int *, time_t */); +-void mopPutHeader (/* u_char *, int *, u_char *, u_char *, u_short, int */); +-void mopPutLength (/* u_char *, int, u_short */); +-#else + __BEGIN_DECLS + void mopPutChar __P((u_char *, int *, u_char)); + void mopPutShort __P((u_char *, int *, u_short)); +-void mopPutLong __P((u_char *, int *, u_long)); ++void mopPutLong __P((u_char *, int *, u_int32_t)); + void mopPutMulti __P((u_char *, int *, u_char *, int)); + void mopPutTime __P((u_char *, int *, time_t)); + void mopPutHeader __P((u_char *, int *, u_char *, u_char *, u_short, int)); + void mopPutLength __P((u_char *, int, u_short)); + __END_DECLS +-#endif + +-#endif _PUT_H_ ++#endif /* _PUT_H_ */ +Only in mopd-2.5.3.patched/common: put.o +diff -rwu mopd-2.5.3.patched/common/rc.c mopd-2.5.4.orig/common/rc.c +--- mopd-2.5.3.patched/common/rc.c 2003-03-27 09:14:41.000000000 +0000 ++++ mopd-2.5.4.orig/common/rc.c 2000-08-09 19:36:26.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: rc.c,v 1.2 1997/03/25 03:07:35 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -27,14 +29,16 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: rc.c,v 1.8 1995/10/13 19:25:34 moj Exp $"; ++#include ++#ifndef lint ++static char rcsid[]="$NetBSD: rc.c,v 1.2 1997/03/25 03:07:35 thorpej Exp $"; + #endif + + #include "os.h" + #include "get.h" +-#include "print.h" + #include "mopdef.h" ++#include "print.h" ++#include "rc.h" + + void + mopDumpRC(fd, pkt, trans) +@@ -43,32 +47,24 @@ + int trans; + { + int i,index = 0; +- u_int tmpl; ++ int32_t tmpl; + u_char tmpc,code,control; +- int len,tmps,moplen; ++ u_short len,tmps,moplen; + + len = mopGetLength(pkt, trans); + + switch (trans) { +- case TRANS_ETHER: +- index = 16; +- moplen = len; +- break; + case TRANS_8023: + index = 22; + moplen = len - 8; + break; +- case TRANS_FDDI_8021H: +- case TRANS_FDDI_8022: +- index = 23; +- moplen = len; +- break; + default: +- moplen = 0; ++ index = 16; ++ moplen = len; + } +- if (moplen < 1) /* broken packet */ +- return; + code = mopGetChar(pkt,&index); ++ /* see above, if (len < 8) then moplen ends up around 65535 */ ++ if (moplen > len) moplen = len; + + switch (code) { + case MOP_K_CODE_RID: +diff -rwu mopd-2.5.3.patched/common/rc.h mopd-2.5.4.orig/common/rc.h +--- mopd-2.5.3.patched/common/rc.h 1995-10-13 20:26:27.000000000 +0100 ++++ mopd-2.5.4.orig/common/rc.h 2000-08-08 22:48:07.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: rc.h,v 1.2 1997/03/25 03:07:36 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -26,19 +28,15 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: rc.h,v 1.4 1995/10/13 19:26:03 moj Exp $ ++ * $NetBSD: rc.h,v 1.2 1997/03/25 03:07:36 thorpej Exp $ + * + */ + + #ifndef _RC_H_ + #define _RC_H_ + +-#ifdef NO__P +-void mopDumpRC (/* FILE *, u_char *, int */); +-#else + __BEGIN_DECLS + void mopDumpRC __P((FILE *, u_char *, int)); + __END_DECLS +-#endif + + #endif _RC_H_ +Only in mopd-2.5.3.patched/common: rc.o +Only in mopd-2.5.3.patched/common: version.c +Only in mopd-2.5.3.patched/common: version.o +diff -rwu mopd-2.5.3.patched/mopa.out/Makefile mopd-2.5.4.orig/mopa.out/Makefile +--- mopd-2.5.3.patched/mopa.out/Makefile 2003-03-27 09:05:58.000000000 +0000 ++++ mopd-2.5.4.orig/mopa.out/Makefile 2000-08-08 22:48:28.000000000 +0100 +@@ -1,19 +1,5 @@ +-PROGS = mopa.out +-OBJS = mopa.out.o +-LIBS = ../common/libcommon.a ++# $NetBSD: Makefile,v 1.4 1997/04/17 21:09:02 christos Exp $ + +-CPPFLAGS = -I.. ++PROG= mopa.out + +-all: $(PROGS) +- +-mopa.out: $(OBJS) $(LIBS) +- $(CC) $(CFLAGS) $(LDFLAGS) -o mopa.out $(OBJS) $(LIBS) +- +-../common/libcommon.a: +- cd ../common && $(MAKE) libcommon.a +- +-.c.o: +- $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< +- +-clean: +- rm -f core $(PROGS) *.o ++.include +diff -rwu mopd-2.5.3.patched/mopa.out/mopa.out.1 mopd-2.5.4.orig/mopa.out/mopa.out.1 +--- mopd-2.5.3.patched/mopa.out/mopa.out.1 1996-08-13 19:30:58.000000000 +0100 ++++ mopd-2.5.4.orig/mopa.out/mopa.out.1 2000-08-08 22:48:29.000000000 +0100 +@@ -1,3 +1,4 @@ ++.\" $NetBSD: mopa.out.1,v 1.2 1997/03/25 03:07:39 thorpej Exp $ + .\" + .\" Copyright (c) 1996 Mats O Jansson. All rights reserved. + .\" +@@ -26,19 +27,17 @@ + .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + .\" +-.\" @(#) $Id: mopa.out.1,v 1.2 1996/08/13 18:30:12 moj Exp $ +-.\" + .Dd August 11, 1996 + .Dt MOPA.OUT 1 + .Sh NAME + .Nm mopa.out + .Nd Create MOP image from a a.out file + .Sh SYNOPSIS +-.Nm mopa.out ++.Nm + .Ar infile + .Ar outfile + .Sh DESCRIPTION +-.Nm mopa.out ++.Nm + is used to convert an a.out file to a MOP-image. + .Pp + This program will check if +@@ -47,7 +46,7 @@ + .Xr a.out 5 + header, and try again. + .Sh BUGS +-This program just supports the VAX machine-id for now. ++This program only supports the VAX machine-id for now. + .Sh SEE ALSO + .Xr a.out 5 , + .Xr mopchk 1 , +diff -rwu mopd-2.5.3.patched/mopa.out/mopa.out.c mopd-2.5.4.orig/mopa.out/mopa.out.c +--- mopd-2.5.3.patched/mopa.out/mopa.out.c 2003-03-27 09:05:58.000000000 +0000 ++++ mopd-2.5.4.orig/mopa.out/mopa.out.c 2000-08-08 23:25:41.000000000 +0100 +@@ -1,3 +1,4 @@ ++/* $NetBSD: mopa.out.c,v 1.5 1997/10/16 23:25:09 lukem Exp $ */ + + /* mopa.out - Convert a Unix format kernel into something that + * can be transfered via MOP. +@@ -46,17 +47,22 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: mopa.out.c,v 1.5 1996/08/16 22:44:58 moj Exp $"; ++#include ++#ifndef lint ++__RCSID("$NetBSD: mopa.out.c,v 1.5 1997/10/16 23:25:09 lukem Exp $"); + #endif + ++#include "os.h" ++#include "common/common.h" ++#include "common/mopdef.h" ++#include "common/file.h" + #if defined(__NetBSD__) || defined(__OpenBSD__) + #include + #endif + #if defined(__FreeBSD__) + #include + #endif +-#if defined(__bsdi__) ++#if defined(__bsdi__) || defined(__Linux__) + #include + #define NOAOUT + #endif +@@ -64,35 +70,30 @@ + #define MID_VAX 140 + #endif + +-#include +-#include +-#include +-#include +- + u_char header[512]; /* The VAX header we generate is 1 block. */ + struct exec ex, ex_swap; + + int + main (int argc, char **argv) + { +-#ifdef NOAOUT +- fprintf(stderr, "%s: has no function in OS/BSD\n", argv[0]); +- return(1); +-#else + FILE *out; /* A FILE because that is easier. */ + int i; + struct dllist dl; + ++ extern char *__progname; /* from crt0.o */ ++ ++#ifdef NOAOUT ++ errx(1, "has no function in NetBSD"); ++#endif ++ + if (argc != 3) { +- fprintf (stderr, "usage: %s kernel-in sys-out\n", argv[0]); ++ fprintf (stderr, "usage: %s kernel-in sys-out\n", __progname); + return (1); + } + + dl.ldfd = open (argv[1], O_RDONLY); +- if (dl.ldfd == -1) { +- perror (argv[1]); +- return (2); +- } ++ if (dl.ldfd == -1) ++ err(2, "open `%s'", argv[1]); + + GetFileInfo(dl.ldfd, + &dl.loadaddr, +@@ -102,16 +103,12 @@ + &dl.a_data,&dl.a_data_fill, + &dl.a_bss ,&dl.a_bss_fill ); + +- if (dl.aout == -1) { +- fprintf(stderr,"s%: not an a.out file\n",argv[1]); +- return (3); +- } ++ if (dl.aout == -1) ++ errx(3, "`%s' is not an a.out file", argv[1]); + +- if (dl.aout != MID_VAX) { +- fprintf(stderr,"%s: file is not a VAX image (mid=%d)\n", ++ if (dl.aout != MID_VAX) ++ printf("WARNING: `%s' is not a VAX image (mid=%d)\n", + argv[1],dl.aout); +- return (4); +- } + + i = dl.a_text + dl.a_text_fill + dl.a_data + dl.a_data_fill + + dl.a_bss + dl.a_bss_fill; +@@ -131,27 +128,20 @@ + mopFilePutLX(header,0xd4+ISD_W_PAGCNT,i,2);/* Imagesize in blks.*/ + + out = fopen (argv[2], "w"); +- if (!out) { +- perror (argv[2]); +- return (2); +- } ++ if (!out) ++ err(2, "writing `%s'", argv[2]); + + /* Now we do the actual work. Write VAX MOP-image header */ + + fwrite (header, sizeof (header), 1, out); + +- fprintf (stderr, "copying %lu", dl.a_text); +- fprintf (stderr, "+%lu", dl.a_data); +- fprintf (stderr, "+%lu", dl.a_bss); +- fprintf (stderr, "->%lu", dl.xferaddr); +- fprintf (stderr, "\n"); ++ fprintf(stderr, "copying %u+%u+%u->%u\n", dl.a_text, ++ dl.a_data, dl.a_bss, dl.xferaddr); + + while ((i = mopFileRead(&dl,header)) > 0) { + (void)fwrite(header, i, 1, out); + } + + fclose (out); +- + return (0); +-#endif + } +diff -rwu mopd-2.5.3/mopchk/mopchk.c mopd-2.5.4/mopchk/mopchk.c +--- mopd-2.5.3/mopchk/mopchk.c 2003-05-09 16:00:00.000000000 +0100 ++++ mopd-2.5.4/mopchk/mopchk.c 2003-05-09 16:00:03.000000000 +0100 +@@ -154,10 +154,12 @@ + + } + ++extern char *__progname; ++ + void + Usage() + { +- fprintf(stderr, "usage: %s [-a] [-v] [filename...]\n", Program); ++ fprintf(stderr, "usage: %s [-a] [-v] [filename...]\n", __progname); + exit(1); + } + +diff -rwu mopd-2.5.3.patched/mopchk/Makefile mopd-2.5.4.orig/mopchk/Makefile +--- mopd-2.5.3.patched/mopchk/Makefile 2003-03-27 09:12:15.000000000 +0000 ++++ mopd-2.5.4.orig/mopchk/Makefile 2000-08-09 19:31:53.000000000 +0100 +@@ -1,20 +1,23 @@ +-PROGS = mopchk + OBJS = mopchk.o ++INCL=-I../ -I../common + LIBS = ../common/libcommon.a +-LIBELF = -lelf + +-CPPFLAGS = -I.. ++all: mopchk + +-all: $(PROGS) ++mopchk: ${OBJS} version.o $(LIBS) ++ cc -o mopchk version.o ${OBJS} ${LIBS} -lelf + +-mopchk: $(OBJS) $(LIBS) +- $(CC) $(CFLAGS) $(LDFLAGS) -o mopchk $(OBJS) $(LIBS) $(LIBELF) ++.c.o: .c ++ cc -c $(CFLAGS) ${INCL} $< + +-../common/libcommon.a: +- cd ../common && $(MAKE) libcommon.a ++clean: ++ rm -f *.o *~ mopchk VERSION version.* + +-.c.o: +- $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< ++version.o: version.c ++version.c version.h: ++ ln -sf ../common/VERSION VERSION ++ rm -f version.c ; sed 's/.*/char version[] = "&";/' VERSION > version.c ++ set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' VERSION` ; \ ++ { echo '#define VERSION_MAJOR' $$1 ; \ ++ echo '#define VERSION_MINOR' $$2 ; } > version.h + +-clean: +- rm -f core $(PROGS) *.o +Only in mopd-2.5.3.patched/mopchk: mopchk +diff -rwu mopd-2.5.3.patched/mopchk/mopchk.1 mopd-2.5.4.orig/mopchk/mopchk.1 +--- mopd-2.5.3.patched/mopchk/mopchk.1 1996-08-11 23:50:49.000000000 +0100 ++++ mopd-2.5.4.orig/mopchk/mopchk.1 2000-08-08 22:48:45.000000000 +0100 +@@ -1,3 +1,4 @@ ++.\" $NetBSD: mopchk.1,v 1.4 1998/09/30 15:05:01 briggs Exp $ + .\" + .\" Copyright (c) 1996 Mats O Jansson. All rights reserved. + .\" +@@ -26,20 +27,18 @@ + .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + .\" +-.\" @(#) $Id: mopchk.1,v 1.1 1996/08/11 22:47:11 moj Exp $ +-.\" + .Dd October 2, 1995 + .Dt MOPCHK 1 + .Sh NAME + .Nm mopchk + .Nd MOP Check Utility + .Sh SYNOPSIS +-.Nm mopchk ++.Nm + .Op Fl a + .Op Fl v + .Op Ar filename + .Sh DESCRIPTION +-.Nm Mopchk ++.Nm + shows information about which devices are known, version of mopd suite or + information about a MOP-image. + .Pp +@@ -52,10 +51,10 @@ + .It Fl a + Show all the Ethernets attached to the system. + .It Fl v +-Show version of mopprobe. ++Show version of the mopd suite. + .El + .Sh BUGS +-In some implementation the same interface can occure more than once. ++In some implementations the same interface can occur more than once. + .Sh SEE ALSO + .Xr mopa.out 1 , + .Xr mopprobe 1 , +diff -rwu mopd-2.5.3.patched/mopchk/mopchk.c mopd-2.5.4.orig/mopchk/mopchk.c +--- mopd-2.5.3.patched/mopchk/mopchk.c 2003-03-27 09:13:20.000000000 +0000 ++++ mopd-2.5.4.orig/mopchk/mopchk.c 2000-08-08 23:27:10.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: mopchk.c,v 1.5 1997/10/16 07:36:50 lukem Exp $ */ ++ + /* + * Copyright (c) 1995-96 Mats O Jansson. All rights reserved. + * +@@ -27,8 +29,9 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: mopchk.c,v 1.5 1996/08/16 22:46:55 moj Exp $"; ++#include ++#ifndef lint ++/*__RCSID("$NetBSD: mopchk.c,v 1.5 1997/10/16 07:36:50 lukem Exp $");*/ + #endif + + /* +@@ -37,12 +40,12 @@ + * Usage: mopchk [-a] [-v] [filename...] + */ + +-#include +-#include +-#include +-#include +-#include +-#include ++#include "os.h" ++#include "common/common.h" ++#include "common/device.h" ++#include "common/file.h" ++#include "common/mopdef.h" ++#include "common/pf.h" + + /* + * The list of all interfaces that are being listened to. rarp_loop() +@@ -50,22 +53,18 @@ + */ + struct if_info *iflist; + +-#ifdef NO__P +-void Usage (/* void */); +-void mopProcess (/* struct if_info *, u_char * */); +-#else + void Usage __P((void)); ++int main __P((int, char **)); + void mopProcess __P((struct if_info *, u_char *)); +-#endif + + int AllFlag = 0; /* listen on "all" interfaces */ + int VersionFlag = 0; /* Show version */ +-int nomulti = 1; /* multicast mode not needed */ +-char *Program; ++int promisc = 0; /* promisc mode not needed */ + ++extern char *__progname; /* from crt0.o */ + extern char version[]; + +-void ++int + main(argc, argv) + int argc; + char **argv; +@@ -73,22 +72,13 @@ + int op, i, fd; + char *filename; + struct if_info *ii; +- int err; +- +- extern int optind, opterr; +- +- if ((Program = strrchr(argv[0], '/'))) +- Program++; +- else +- Program = argv[0]; +- if (*Program == '-') +- Program++; ++ int err, aout; + + /* All error reporting is done through syslogs. */ +- openlog(Program, LOG_PID | LOG_CONS, LOG_DAEMON); ++ openlog(__progname, LOG_PID | LOG_CONS, LOG_DAEMON); + + opterr = 0; +- while ((op = getopt(argc, argv, "av")) != EOF) { ++ while ((op = getopt(argc, argv, "av")) != -1) { + switch (op) { + case 'a': + AllFlag++; +@@ -102,26 +92,23 @@ + } + } + +- fileinfo = 1; +- + if (VersionFlag) +- printf("%s: Version %s\n",Program,version); ++ printf("%s: Version %s\n", __progname, version); + + if (AllFlag) { + if (VersionFlag) + printf("\n"); + iflist = NULL; + deviceInitAll(); +- if (iflist == NULL) { ++ if (iflist == NULL) + printf("No interface\n"); +- } else { ++ else { + printf("Interface Address\n"); +- for (ii = iflist; ii; ii = ii->next) { ++ for (ii = iflist; ii; ii = ii->next) + printf("%-9s %x:%x:%x:%x:%x:%x\n", +- ii->if_name, +- ii->eaddr[0],ii->eaddr[1],ii->eaddr[2], +- ii->eaddr[3],ii->eaddr[4],ii->eaddr[5]); +- } ++ ii->if_name, ii->eaddr[0], ii->eaddr[1], ++ ii->eaddr[2], ii->eaddr[3], ii->eaddr[4], ++ ii->eaddr[5]); + } + } + +diff -rwu mopd-2.5.3.patched/mopd/Makefile mopd-2.5.4.orig/mopd/Makefile +--- mopd-2.5.3.patched/mopd/Makefile 2003-03-27 09:12:15.000000000 +0000 ++++ mopd-2.5.4.orig/mopd/Makefile 2000-08-09 19:31:36.000000000 +0100 +@@ -1,20 +1,23 @@ +-PROGS = mopd + OBJS = mopd.o process.o ++INCL=-I../ -I../common + LIBS = ../common/libcommon.a +-LIBELF = -lelf + +-CPPFLAGS = -I.. ++all: mopd + +-all: $(PROGS) ++mopd: ${OBJS} version.o $(LIBS) ++ cc -o mopd version.o ${OBJS} ${LIBS} -lelf + +-mopd: $(OBJS) $(LIBS) +- $(CC) $(CFLAGS) $(LDFLAGS) -o mopd $(OBJS) $(LIBS) $(LIBELF) ++.c.o: .c ++ cc -c $(CFLAGS) ${INCL} $< + +-../common/libcommon.a: +- cd ../common && $(MAKE) libcommon.a ++clean: ++ rm -f *.o *~ mopd VERSION version.* + +-.c.o: +- $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< ++version.o: version.c ++version.c version.h: ++ ln -sf ../common/VERSION VERSION ++ rm -f version.c ; sed 's/.*/char version[] = "&";/' VERSION > version.c ++ set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' VERSION` ; \ ++ { echo '#define VERSION_MAJOR' $$1 ; \ ++ echo '#define VERSION_MINOR' $$2 ; } > version.h + +-clean: +- rm -f core $(PROGS) *.o +Only in mopd-2.5.3.patched/mopd: mopd +diff -rwu mopd-2.5.3.patched/mopd/mopd.8 mopd-2.5.4.orig/mopd/mopd.8 +--- mopd-2.5.3.patched/mopd/mopd.8 1996-08-14 12:56:42.000000000 +0100 ++++ mopd-2.5.4.orig/mopd/mopd.8 2000-08-08 22:47:20.000000000 +0100 +@@ -1,3 +1,4 @@ ++.\" $NetBSD: mopd.8,v 1.2 1997/03/25 03:07:48 thorpej Exp $ + .\" + .\" Copyright (c) 1993-96 Mats O Jansson. All rights reserved. + .\" +@@ -26,33 +27,31 @@ + .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + .\" +-.\" @(#) $Id: mopd.8,v 1.3 1996/08/14 11:55:33 moj Exp $ +-.\" + .Dd September 24, 1995 + .Dt MOPD 8 + .Sh NAME + .Nm mopd + .Nd MOP Loader Daemon + .Sh SYNOPSIS +-.Nm mopd ++.Nm + .Op Fl adf + .Op Ar interface + .Sh DESCRIPTION +-.Nm Mopd ++.Nm + services MOP Load requests on the Ethernet connected to + .Ar interface + or all interfaces if + .Sq Fl a + is given. + In a load request received by +-.Nm mopd ++.Nm + a filename can be given. This is the normal case for e.g. terminal servers. + If a filename isn't given +-.Nm mopd ++.Nm + must know what image to load. + .Pp + Upon receiving a request, +-.Nm mopd ++.Nm + checks if the requested file exists in + .Pa /tftpboot/mop , + the filename is normaly uppercase and with an extension of +@@ -62,14 +61,14 @@ + .Pa 08002b09f4de.SYS + and it might be a soft link to another file. + .Pp +-.Nm Mopd ++.Nm + supports two kinds of files. The first type that is check is if the file is + in + .Xr a.out 5 + format. If not, a couple of Digital's formats are checked. + .Pp + In normal operation, +-.Nm mopd ++.Nm + forks a copy of itself and runs in + the background. Anomalies and errors are reported via + .Xr syslog 3 . +@@ -86,9 +85,6 @@ + .It Fl f + Run in the foreground. + .El +-.Sh BUGS +-.Xr a.out 5 +-isn't supported yet non bsd implementations (otherOS). + .Sh FILES + .Bl -tag -width Pa -compact + .It Pa /tftpboot/mop +diff -rwu mopd-2.5.3.patched/mopd/mopd.c mopd-2.5.4.orig/mopd/mopd.c +--- mopd-2.5.3.patched/mopd/mopd.c 2003-03-27 09:14:41.000000000 +0000 ++++ mopd-2.5.4.orig/mopd/mopd.c 2000-08-09 00:13:32.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: mopd.c,v 1.5 1997/10/16 23:25:17 lukem Exp $ */ ++ + /* + * Copyright (c) 1993-96 Mats O Jansson. All rights reserved. + * +@@ -27,8 +29,9 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: mopd.c,v 1.14 1996/03/31 19:20:42 moj Exp $"; ++#include ++#ifndef lint ++/*__RCSID("$NetBSD: mopd.c,v 1.5 1997/10/16 23:25:17 lukem Exp $");*/ + #endif + + /* +@@ -38,17 +41,23 @@ + * mopd [ -d -f -v ] [ -3 | -4 ] interface + */ + +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include "common/os.h" ++#include "common/cmp.h" ++#include "common/common.h" ++#include "common/device.h" ++#include "common/dl.h" ++#include "common/get.h" ++#include "common/mopdef.h" ++#include "common/pf.h" ++#include "common/print.h" + #include "process.h" ++#include "common/rc.h" ++ ++#ifndef __linux__ ++#include ++#else ++#define pidfile(x) x; ++#endif + + /* + * The list of all interfaces that are being listened to. +@@ -56,15 +65,9 @@ + */ + struct if_info *iflist; + +-#ifdef NO__P +-void Loop (/* void */); +-void Usage (/* void */); +-void mopProcess (/* struct if_info *, u_char * */); +-#else +-void Loop __P((void)); + void Usage __P((void)); ++int main __P((int, char **)); + void mopProcess __P((struct if_info *, u_char *)); +-#endif + + int AllFlag = 0; /* listen on "all" interfaces */ + int DebugFlag = 0; /* print debugging messages */ +@@ -72,29 +75,21 @@ + int VersionFlag = 0; /* print version */ + int Not3Flag = 0; /* Not MOP V3 messages. */ + int Not4Flag = 0; /* Not MOP V4 messages. */ +-int nomulti = 0; /* Need multicast mode */ +-char *Program; ++int promisc = 1; /* Need promisc mode */ + +-void ++extern char *__progname; /* from crt0.o */ ++ ++int + main(argc, argv) + int argc; + char **argv; + { +- int c, pid, devnull, f; ++ int c, pid; + char *interface; + +- extern int optind; + extern char version[]; + +- if ((Program = strrchr(argv[0], '/'))) +- Program++; +- else +- Program = argv[0]; +- +- if (*Program == '-') +- Program++; +- +- while ((c = getopt(argc, argv, "34adfmv")) != EOF) ++ while ((c = getopt(argc, argv, "34adfv")) != -1) + switch (c) { + case '3': + Not3Flag++; +@@ -111,9 +106,6 @@ + case 'f': + ForegroundFlag++; + break; +- case 'm': +- nomulti++; +- break; + case 'v': + VersionFlag++; + break; +@@ -123,7 +115,7 @@ + } + + if (VersionFlag) { +- fprintf(stdout,"%s: version %s\n", Program, version); ++ fprintf(stdout,"%s: version %s\n", __progname, version); + exit(0); + } + +@@ -136,16 +128,13 @@ + Usage(); + + /* All error reporting is done through syslogs. */ +- openlog(Program, LOG_PID | LOG_CONS, LOG_DAEMON); ++ openlog(__progname, LOG_PID | LOG_CONS, LOG_DAEMON); + +- if ((!ForegroundFlag) && DebugFlag) { ++ if ((!ForegroundFlag) && DebugFlag) + fprintf(stdout, +- "%s: not running as daemon, -d given.\n", +- Program); +- } ++ "%s: not running as daemon, -d given.\n", __progname); + + if ((!ForegroundFlag) && (!DebugFlag)) { +- + pid = fork(); + if (pid > 0) + /* Parent exits, leaving child in background. */ +@@ -157,32 +146,11 @@ + } + + /* Fade into the background */ +- f = open("/dev/tty", O_RDWR); +- if (f >= 0) { +- if (ioctl(f, TIOCNOTTY, 0) < 0) { +- syslog(LOG_ERR, "TIOCNOTTY: %m"); +- exit(0); +- } +- (void) close(f); +- } +- +- (void) chdir("/"); +-#ifdef SETPGRP_NOPARAM +- (void) setpgrp(); +-#else +- (void) setpgrp(0, getpid()); +-#endif +- devnull = open("/dev/null", O_RDWR); +- if (devnull >= 0) { +- (void) dup2(devnull, 0); +- (void) dup2(devnull, 1); +- (void) dup2(devnull, 2); +- if (devnull > 2) +- (void) close(devnull); +- } ++ daemon(0, 0); ++ pidfile(NULL); + } + +- syslog(LOG_INFO, "%s %s started.", Program, version); ++ syslog(LOG_INFO, "%s %s started.", __progname, version); + + if (AllFlag) + deviceInitAll(); +@@ -190,13 +158,17 @@ + deviceInitOne(interface); + + Loop(); ++ /* NOTREACHED */ ++ return (0); + } + + void + Usage() + { +- (void) fprintf(stderr, "usage: %s -a [ -d -f -m -v ] [ -3 | -4 ]\n",Program); +- (void) fprintf(stderr, " %s [ -d -f -m -v ] [ -3 | -4 ] interface\n",Program); ++ (void) fprintf(stderr, "usage: %s -a [ -d -f -v ] [ -3 | -4 ]\n", ++ __progname); ++ (void) fprintf(stderr, " %s [ -d -f -v ] [ -3 | -4 ] interface\n", ++ __progname); + exit(1); + } + +@@ -214,14 +186,12 @@ + + /* We don't known with transport, Guess! */ + +- trans = mopGetTrans(pkt, ii->trans); ++ trans = mopGetTrans(pkt, 0); + + /* Ok, return if we don't wan't this message */ + +- if ((trans == TRANS_ETHER || trans == TRANS_FDDI_8021H) && Not3Flag) +- return; +- if ((trans == TRANS_8023 || trans == TRANS_FDDI_8022) && Not4Flag) +- return; ++ if ((trans == TRANS_ETHER) && Not3Flag) return; ++ if ((trans == TRANS_8023) && Not4Flag) return; + + index = 0; + mopGetHeader(pkt, &index, &dst, &src, &ptype, &len, trans); +Only in mopd-2.5.3.patched/mopd: mopd.o +diff -rwu mopd-2.5.3.patched/mopd/process.c mopd-2.5.4.orig/mopd/process.c +--- mopd-2.5.3.patched/mopd/process.c 2003-03-27 09:14:41.000000000 +0000 ++++ mopd-2.5.4.orig/mopd/process.c 2000-08-09 00:04:16.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: process.c,v 1.7 2000/06/27 18:57:41 ragge Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -27,27 +29,23 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: process.c,v 1.21 1996/08/22 17:04:07 moj Exp $"; ++#include ++#ifndef lint ++static char rcsid[]="$NetBSD: process.c,v 1.7 2000/06/27 18:57:41 ragge Exp $"; + #endif + +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include "process.h" +- +-#define SEND_REAL_HOSTNAME +- +-#define MAX_ETH_PAYLOAD 1500 ++#include "os.h" ++#include "cmp.h" ++#include "common.h" ++#include "dl.h" ++#include "file.h" ++#include "get.h" ++#include "mopdef.h" ++#include "nmadef.h" ++#include "pf.h" ++#include "print.h" ++#include "put.h" ++#include "rc.h" + + extern u_char buf[]; + extern int DebugFlag; +@@ -56,18 +54,22 @@ + extern char dl_mcst[]; /* Dump/Load Multicast */ + extern char rc_mcst[]; /* Remote Console Multicast */ + +-#ifdef NO__P +-ssize_t mopFileRead (/* struct dllist *, u_char * */); +-#else +-ssize_t mopFileRead __P((struct dllist *, u_char *)); +-#endif ++void mopNextLoad __P((u_char *, u_char *, u_char, int)); ++void mopProcessDL __P((FILE *, struct if_info *, u_char *, int *, ++ u_char *, u_char *, int, u_short)); ++void mopProcessRC __P((FILE *, struct if_info *, u_char *, int *, ++ u_char *, u_char *, int, u_short)); ++void mopProcessInfo __P((u_char *, int *, u_short, struct dllist *, int)); ++void mopSendASV __P((u_char *, u_char *, struct if_info *, int)); ++void mopStartLoad __P((u_char *, u_char *, struct dllist *, int)); + + void + mopProcessInfo(pkt,index,moplen,dl_rpr,trans) + u_char *pkt; +- int *index, trans; ++ int *index; + u_short moplen; + struct dllist *dl_rpr; ++ int trans; + { + u_short itype,tmps; + u_char ilen ,tmpc,device; +@@ -82,10 +84,6 @@ + case TRANS_8023: + moplen = moplen + 14; + break; +- case TRANS_FDDI_8021H: +- case TRANS_FDDI_8022: +- moplen = moplen + 23; +- break; + } + + itype = mopGetShort(pkt,index); +@@ -216,6 +214,8 @@ + } + } + ++#define MAX_ETH_PAYLOAD 1492 ++ + void + mopStartLoad(dst, src, dl_rpr, trans) + u_char *dst,*src; +@@ -248,8 +248,8 @@ + if (dllist[i].status == DL_STATUS_FREE) { + if (slot == -1) { + slot = i; +- bcopy((char *)dst, +- (char *)dllist[i].eaddr, 6); ++ memmove((char *)dllist[i].eaddr, ++ (char *)dst, 6); + } + } + } +@@ -284,7 +284,7 @@ + dllist[slot].dl_bsz = 1010; + if (dllist[slot].dl_bsz == 0) /* Needed by "big" VAXen */ + dllist[slot].dl_bsz = MOP_K_DLBSZ_DEFAULT; +- if (trans == TRANS_8023 || trans == TRANS_FDDI_8022) ++ if (trans == TRANS_8023) + if (dllist[slot].dl_bsz > MAX_ETH_PAYLOAD - 8) + dllist[slot].dl_bsz = MAX_ETH_PAYLOAD - 8; + if (trans != TRANS_8023) +@@ -341,13 +340,6 @@ + u_short newlen = 0,ptype = MOP_K_PROTO_DL; + u_char mopcode; + +-#ifdef SEND_REAL_HOSTNAME +- struct utsname uts_name; +- char hostname[MAXHOSTNAMELEN]; +-#else +- char hostname[MAXHOSTNAMELEN] = DEFAULT_HOSTNAME; +-#endif +- + slot = -1; + + for (i = 0; i < MAXDL; i++) { +@@ -404,22 +398,13 @@ + + } else { + if (len == 0) { +-#ifdef SEND_REAL_HOSTNAME +- if (uname(&uts_name) < 0) { +- syslog(LOG_ERR, +- "uname: %m, sending `%s' as hostname", +- DEFAULT_HOSTNAME); +- sprintf(hostname, "%s", DEFAULT_HOSTNAME); +- } else +- sprintf(hostname, "%s", uts_name.nodename); +-#endif + index = pindex; + mopcode = MOP_K_CODE_PLT; + mopPutChar (pkt,&index,mopcode); + mopPutChar (pkt,&index,dllist[slot].count); + mopPutChar (pkt,&index,MOP_K_PLTP_HSN); +- mopPutChar (pkt,&index,strlen(hostname)); +- mopPutMulti(pkt,&index,hostname,strlen(hostname)); ++ mopPutChar (pkt,&index,3); ++ mopPutMulti(pkt,&index,"ipc",3); + mopPutChar (pkt,&index,MOP_K_PLTP_HSA); + mopPutChar (pkt,&index,6); + mopPutMulti(pkt,&index,src,6); +@@ -462,13 +447,15 @@ + mopProcessDL(fd, ii, pkt, index, dst, src, trans, len) + FILE *fd; + struct if_info *ii; +- u_char *pkt, *dst, *src; +- int *index, trans; ++ u_char *pkt; ++ int *index; ++ u_char *dst, *src; ++ int trans; + u_short len; + { + u_char tmpc; + u_short moplen; +- u_char pfile[257], mopcode; ++ u_char pfile[129], mopcode; + char filename[FILENAME_MAX]; + char line[100]; + int i,nfd,iindex; +@@ -517,6 +504,8 @@ + rpr_pgty = mopGetChar(pkt,index); /* Program Type */ + + tmpc = mopGetChar(pkt,index); /* Software ID Len */ ++ if (tmpc > sizeof(pfile) - 1) ++ return; + for (i = 0; i < tmpc; i++) { + pfile[i] = mopGetChar(pkt,index); + pfile[i+1] = '\0'; +@@ -538,9 +527,9 @@ + + iindex = *index; + dl_rpr = &dl; +- bzero(dl_rpr,sizeof(*dl_rpr)); ++ memset(dl_rpr, 0, sizeof(*dl_rpr)); + dl_rpr->ii = ii; +- bcopy((char *)src, (char *)(dl_rpr->eaddr), 6); ++ memmove((char *)(dl_rpr->eaddr), (char *)src, 6); + mopProcessInfo(pkt,index,moplen,dl_rpr,trans); + + sprintf(filename,"%s/%s.SYS", MOP_FILE_PATH, pfile); +@@ -600,8 +589,10 @@ + mopProcessRC(fd, ii, pkt, index, dst, src, trans, len) + FILE *fd; + struct if_info *ii; +- u_char *pkt, *dst, *src; +- int *index, trans; ++ u_char *pkt; ++ int *index; ++ u_char *dst, *src; ++ int trans; + u_short len; + { + u_char tmpc; +@@ -644,9 +635,9 @@ + } + + dl_rpr = &dl; +- bzero(dl_rpr,sizeof(*dl_rpr)); ++ memset(dl_rpr, 0, sizeof(*dl_rpr)); + dl_rpr->ii = ii; +- bcopy((char *)src, (char *)(dl_rpr->eaddr), 6); ++ memmove((char *)(dl_rpr->eaddr), (char *)src, 6); + mopProcessInfo(pkt,index,moplen,dl_rpr,trans); + + break; +diff -rwu mopd-2.5.3.patched/mopd/process.h mopd-2.5.4.orig/mopd/process.h +--- mopd-2.5.3.patched/mopd/process.h 1995-10-03 13:15:28.000000000 +0100 ++++ mopd-2.5.4.orig/mopd/process.h 2000-08-08 22:47:20.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: process.h,v 1.2 1997/03/25 03:07:52 thorpej Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -26,25 +28,18 @@ + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +- * $Id: process.h,v 1.5 1995/10/03 12:13:51 moj Exp $ ++ * $NetBSD: process.h,v 1.2 1997/03/25 03:07:52 thorpej Exp $ + * + */ + + #ifndef _PROCESS_H_ + #define _PROCESS_H_ + +-#ifdef NO__P +-void mopProcessDL (/* FILE *, struct if_info *, u_char *, int *, +- u_char *, u_char *, int, u_short */); +-void mopProcessRC (/* FILE *, struct if_info *, u_char *, int *, +- u_char *, u_char *, int, u_short */); +-#else + __BEGIN_DECLS + void mopProcessDL __P((FILE *, struct if_info *, u_char *, int *, + u_char *, u_char *, int, u_short)); + void mopProcessRC __P((FILE *, struct if_info *, u_char *, int *, + u_char *, u_char *, int, u_short)); + __END_DECLS +-#endif + + #endif _PROCESS_H_ +Only in mopd-2.5.3.patched/mopd: process.o +diff -rwu mopd-2.5.3.patched/mopprobe/Makefile mopd-2.5.4.orig/mopprobe/Makefile +--- mopd-2.5.3.patched/mopprobe/Makefile 2003-03-27 09:05:58.000000000 +0000 ++++ mopd-2.5.4.orig/mopprobe/Makefile 2000-08-09 19:32:06.000000000 +0100 +@@ -1,19 +1,23 @@ +-PROGS = mopprobe + OBJS = mopprobe.o ++INCL=-I../ -I../common + LIBS = ../common/libcommon.a + +-CPPFLAGS = -I.. ++all: mopprobe + +-all: $(PROGS) ++mopprobe: ${OBJS} version.o $(LIBS) ++ cc -o mopprobe version.o ${OBJS} ${LIBS} + +-mopprobe: $(OBJS) $(LIBS) +- $(CC) $(CFLAGS) $(LDFLAGS) -o mopprobe $(OBJS) $(LIBS) ++.c.o: .c ++ cc -c $(CFLAGS) ${INCL} $< + +-../common/libcommon.a: +- cd ../common && $(MAKE) libcommon.a ++clean: ++ rm -f *.o *~ mopprobe VERSION version.* + +-.c.o: +- $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< ++version.o: version.c ++version.c version.h: ++ ln -sf ../common/VERSION VERSION ++ rm -f version.c ; sed 's/.*/char version[] = "&";/' VERSION > version.c ++ set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' VERSION` ; \ ++ { echo '#define VERSION_MAJOR' $$1 ; \ ++ echo '#define VERSION_MINOR' $$2 ; } > version.h + +-clean: +- rm -f core $(PROGS) *.o +Only in mopd-2.5.3.patched/mopprobe: mopprobe +diff -rwu mopd-2.5.3.patched/mopprobe/mopprobe.1 mopd-2.5.4.orig/mopprobe/mopprobe.1 +--- mopd-2.5.3.patched/mopprobe/mopprobe.1 1996-08-12 00:05:00.000000000 +0100 ++++ mopd-2.5.4.orig/mopprobe/mopprobe.1 2000-08-08 22:49:08.000000000 +0100 +@@ -1,3 +1,4 @@ ++.\" $NetBSD: mopprobe.1,v 1.2 1997/03/25 03:07:56 thorpej Exp $ + .\" + .\" Copyright (c) 1996 Mats O Jansson. All rights reserved. + .\" +@@ -26,23 +27,20 @@ + .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + .\" +-.\" @(#) $Id: mopprobe.1,v 1.1 1996/08/11 23:01:09 moj Exp $ +-.\" + .Dd October 2, 1995 + .Dt MOPPROBE 1 + .Sh NAME + .Nm mopprobe + .Nd MOP Probe Utility + .Sh SYNOPSIS +-.Nm mopprobe ++.Nm + .Fl a + .Op Fl 3 | 4 +-.Pp +-.Nm mopprobe ++.Nm "" + .Op Fl 3 | 4 + .Ar interface + .Sh DESCRIPTION +-.Nm Mopprobe ++.Nm + prints the ethernet address and nodename of MOP SID message on the Ethernet + connected to + .Ar interface +diff -rwu mopd-2.5.3.patched/mopprobe/mopprobe.c mopd-2.5.4.orig/mopprobe/mopprobe.c +--- mopd-2.5.3.patched/mopprobe/mopprobe.c 2003-03-27 09:14:41.000000000 +0000 ++++ mopd-2.5.4.orig/mopprobe/mopprobe.c 2000-08-08 23:27:36.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: mopprobe.c,v 1.4 1997/04/17 21:09:27 christos Exp $ */ ++ + /* + * Copyright (c) 1993-96 Mats O Jansson. All rights reserved. + * +@@ -27,8 +29,9 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: mopprobe.c,v 1.11 1996/08/11 22:16:10 moj Exp $"; ++#include ++#ifndef lint ++/*__RCSID("$NetBSD: mopprobe.c,v 1.4 1997/04/17 21:09:27 christos Exp $");*/ + #endif + + /* +@@ -38,15 +41,15 @@ + * mopprobe [ -3 | -4 ] interface + */ + +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include "os.h" ++#include "common/cmp.h" ++#include "common/common.h" ++#include "common/device.h" ++#include "common/get.h" ++#include "common/mopdef.h" ++#include "common/nmadef.h" ++#include "common/pf.h" ++#include "common/print.h" + + /* + * The list of all interfaces that are being listened to. rarp_loop() +@@ -54,25 +57,20 @@ + */ + struct if_info *iflist; + +-#ifdef NO__P +-void Loop (/* void */); +-void Usage (/* void */); +-void mopProcess (/* struct if_info *, u_char * */); +-#else +-void Loop __P((void)); + void Usage __P((void)); ++int main __P((int, char **)); + void mopProcess __P((struct if_info *, u_char *)); +-#endif + + int AllFlag = 0; /* listen on "all" interfaces */ + int DebugFlag = 0; /* print debugging messages */ + int Not3Flag = 0; /* Not MOP V3 messages */ + int Not4Flag = 0; /* Not MOP V4 messages */ + int oflag = 0; /* print only once */ +-int nomulti = 0; /* Need multicast mode */ +-char *Program; ++int promisc = 1; /* Need promisc mode */ + +-void ++extern char *__progname; /* from crt0.o */ ++ ++int + main(argc, argv) + int argc; + char **argv; +@@ -80,20 +78,11 @@ + int op; + char *interface; + +- extern int optind, opterr; +- +- if ((Program = strrchr(argv[0], '/'))) +- Program++; +- else +- Program = argv[0]; +- if (*Program == '-') +- Program++; +- + /* All error reporting is done through syslogs. */ +- openlog(Program, LOG_PID | LOG_CONS, LOG_DAEMON); ++ openlog(__progname, LOG_PID | LOG_CONS, LOG_DAEMON); + + opterr = 0; +- while ((op = getopt(argc, argv, "admo")) != EOF) { ++ while ((op = getopt(argc, argv, "ado")) != -1) { + switch (op) { + case '3': + Not3Flag++; +@@ -107,9 +96,6 @@ + case 'd': + DebugFlag++; + break; +- case 'm': +- nomulti++; +- break; + case 'o': + oflag++; + break; +@@ -132,13 +118,15 @@ + deviceInitOne(interface); + + Loop(); ++ /* NOTREACHED */ ++ return (0); + } + + void + Usage() + { +- (void) fprintf(stderr, "usage: %s -a [ -m ] [ -3 | -4 ]\n",Program); +- (void) fprintf(stderr, " %s [ -m ] [ -3 | -4 ] interface\n",Program); ++ (void) fprintf(stderr, "usage: %s -a [ -3 | -4 ]\n", __progname); ++ (void) fprintf(stderr, " %s [ -3 | -4 ] interface\n", __progname); + exit(1); + } + +@@ -151,53 +139,25 @@ + u_char *pkt; + { + u_char *dst, *src, *p, mopcode, tmpc, ilen; +- u_short *ptype, moplen, tmps, itype; ++ u_short *ptype, moplen, tmps, itype, len; + int index, i, device, trans; + +- trans = ii->trans; +- if ((trans & (TRANS_ETHER + TRANS_8023))) { +- ptype = (u_short *)(pkt+12); +- if (ntohs(*ptype) < 1600) { +- trans &= TRANS_8023; +- if (Not4Flag) +- return; +- } else { +- trans &= TRANS_ETHER; +- if (Not3Flag) +- return; +- } +- } else if ((trans & (TRANS_FDDI_8021H + TRANS_FDDI_8022))) { +- if (*pkt >= MOP_K_FDDI_FC_MIN && *pkt <= MOP_K_FDDI_FC_MAX) { +- if (!bcmp((char *)(pkt+16), +- (char *)dl_802_proto, 3)) { +- trans &= TRANS_FDDI_8022; +- if (Not4Flag) +- return; +- } else if (!bcmp((char *)(pkt+16), +- (char *)dl_8021h_proto, 3)) { +- trans &= TRANS_FDDI_8021H; +- if (Not3Flag) +- return; +- } else +- return; +- } else +- return; +- } else +- return; +- +- switch (trans) { +- case TRANS_8023: +- case TRANS_ETHER: + dst = pkt; + src = pkt + 6; +- break; +- case TRANS_FDDI_8022: +- case TRANS_FDDI_8021H: +- dst = pkt + 1; +- src = pkt + 7; +- break; +- default: +- return; ++ ptype = (u_short *)(pkt+12); ++ index = 0; ++ ++ if (*ptype < 1600) { ++ len = *ptype; ++ trans = TRANS_8023; ++ ptype = (u_short *)(pkt+20); ++ p = pkt+22; ++ if (Not4Flag) return; ++ } else { ++ len = 0; ++ trans = TRANS_ETHER; ++ p = pkt+14; ++ if (Not3Flag) return; + } + + /* Ignore our own messages */ +@@ -214,21 +174,11 @@ + + switch (trans) { + case TRANS_8023: +- index = 22; +- moplen = ntohs(*ptype); +- break; +- case TRANS_ETHER: +- index = 14; +- moplen = mopGetShort(pkt,&index); ++ moplen = len; + break; +- case TRANS_FDDI_8022: +- case TRANS_FDDI_8021H: +- index = 21; ++ default: + moplen = mopGetShort(pkt,&index); +- break; + } +- p = pkt + index; +- index = 0; + mopcode = mopGetChar(p,&index); + + /* Just process System Information */ +@@ -244,7 +194,7 @@ + + itype = mopGetShort(pkt,&index); + +- while (index < (int)(moplen)) { ++ while (index < (int)(moplen + 2)) { + ilen = mopGetChar(pkt,&index); + switch (itype) { + case 0: +Only in mopd-2.5.3.patched/mopprobe: mopprobe.o +diff -rwu mopd-2.5.3.patched/moptrace/Makefile mopd-2.5.4.orig/moptrace/Makefile +--- mopd-2.5.3.patched/moptrace/Makefile 2003-03-27 09:05:58.000000000 +0000 ++++ mopd-2.5.4.orig/moptrace/Makefile 2000-08-09 19:32:20.000000000 +0100 +@@ -1,19 +1,23 @@ +-PROGS = moptrace + OBJS = moptrace.o ++INCL=-I../ -I../common + LIBS = ../common/libcommon.a + +-CPPFLAGS = -I.. ++all: moptrace + +-all: $(PROGS) ++moptrace: ${OBJS} version.o $(LIBS) ++ cc -o moptrace version.o ${OBJS} ${LIBS} + +-moptrace: $(OBJS) $(LIBS) +- $(CC) $(CFLAGS) $(LDFLAGS) -o moptrace $(OBJS) $(LIBS) ++.c.o: .c ++ cc -c $(CFLAGS) ${INCL} $< + +-../common/libcommon.a: +- cd ../common && $(MAKE) libcommon.a ++clean: ++ rm -f *.o *~ moptrace VERSION version.* + +-.c.o: +- $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< ++version.o: version.c ++version.c version.h: ++ ln -sf ../common/VERSION VERSION ++ rm -f version.c ; sed 's/.*/char version[] = "&";/' VERSION > version.c ++ set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' VERSION` ; \ ++ { echo '#define VERSION_MAJOR' $$1 ; \ ++ echo '#define VERSION_MINOR' $$2 ; } > version.h + +-clean: +- rm -f core $(PROGS) *.o +Only in mopd-2.5.3.patched/moptrace: moptrace +diff -rwu mopd-2.5.3.patched/moptrace/moptrace.1 mopd-2.5.4.orig/moptrace/moptrace.1 +--- mopd-2.5.3.patched/moptrace/moptrace.1 1996-08-12 00:07:20.000000000 +0100 ++++ mopd-2.5.4.orig/moptrace/moptrace.1 2000-08-08 22:49:23.000000000 +0100 +@@ -1,3 +1,4 @@ ++.\" $NetBSD: moptrace.1,v 1.4 1997/10/18 04:37:37 lukem Exp $ + .\" + .\" Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + .\" +@@ -26,7 +27,7 @@ + .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + .\" +-.\" @(#) $Id: moptrace.1,v 1.2 1996/08/11 23:03:33 moj Exp $ ++.\" @(#) $NetBSD: moptrace.1,v 1.4 1997/10/18 04:37:37 lukem Exp $ + .\" + .Dd October 2, 1995 + .Dt MOPTRACE 1 +@@ -34,18 +35,17 @@ + .Nm moptrace + .Nd MOP Trace Utility + .Sh SYNOPSIS +-.Nm moptrace ++.Nm + .Op Fl a + .Op Fl d + .Op Fl 3 | 4 +-.Pp +-.Nm moptrace ++.Nm "" + .Op Fl d + .Op Fl 3 | 4 + .Op Ar interface + .Sh DESCRIPTION +-.Nm Moptrace +-prints the contence of MOP packages on the Ethernet connected to ++.Nm ++prints the contents of MOP packages on the Ethernet connected to + .Ar interface + or all known interfaces if + .Sq Fl a +diff -rwu mopd-2.5.3.patched/moptrace/moptrace.c mopd-2.5.4.orig/moptrace/moptrace.c +--- mopd-2.5.3.patched/moptrace/moptrace.c 2003-03-27 09:14:41.000000000 +0000 ++++ mopd-2.5.4.orig/moptrace/moptrace.c 2000-08-08 23:27:51.000000000 +0100 +@@ -1,3 +1,5 @@ ++/* $NetBSD: moptrace.c,v 1.4 1997/04/17 21:09:33 christos Exp $ */ ++ + /* + * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. + * +@@ -27,8 +29,9 @@ + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#ifndef LINT +-static char rcsid[] = "$Id: moptrace.c,v 1.10 1996/08/05 07:49:14 moj Exp $"; ++#include ++#ifndef lint ++/*__RCSID("$NetBSD: moptrace.c,v 1.4 1997/04/17 21:09:33 christos Exp $");*/ + #endif + + /* +@@ -38,15 +41,15 @@ + * moptrace [ -d ] [ -3 | -4 ] interface + */ + +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include "os.h" ++#include "common/common.h" ++#include "common/device.h" ++#include "common/dl.h" ++#include "common/get.h" ++#include "common/mopdef.h" ++#include "common/pf.h" ++#include "common/print.h" ++#include "common/rc.h" + + /* + * The list of all interfaces that are being listened to. +@@ -54,24 +57,19 @@ + */ + struct if_info *iflist; + +-#ifdef NO__P +-void Loop (/* void */); +-void Usage (/* void */); +-void mopProcess (/* struct if_info *, u_char * */); +-#else +-void Loop __P((void)); + void Usage __P((void)); ++int main __P((int, char **)); + void mopProcess __P((struct if_info *, u_char *)); +-#endif + + int AllFlag = 0; /* listen on "all" interfaces */ + int DebugFlag = 0; /* print debugging messages */ + int Not3Flag = 0; /* Ignore MOP V3 messages */ + int Not4Flag = 0; /* Ignore MOP V4 messages */ +-int nomulti = 0; /* Need multicast mode */ +-char *Program; ++int promisc = 1; /* Need promisc mode */ + +-void ++extern char *__progname; /* from crt0.o */ ++ ++int + main(argc, argv) + int argc; + char **argv; +@@ -79,21 +77,11 @@ + int op; + char *interface; + +- extern int optind, opterr; +- +- if ((Program = strrchr(argv[0], '/'))) +- Program++; +- else +- Program = argv[0]; +- +- if (*Program == '-') +- Program++; +- + /* All error reporting is done through syslogs. */ +- openlog(Program, LOG_PID | LOG_CONS, LOG_DAEMON); ++ openlog(__progname, LOG_PID | LOG_CONS, LOG_DAEMON); + + opterr = 0; +- while ((op = getopt(argc, argv, "34adm")) != EOF) { ++ while ((op = getopt(argc, argv, "34ad")) != -1) { + switch (op) { + case '3': + Not3Flag++; +@@ -107,9 +95,6 @@ + case 'd': + DebugFlag++; + break; +- case 'm': +- nomulti++; +- break; + default: + Usage(); + /* NOTREACHED */ +@@ -129,14 +114,16 @@ + deviceInitOne(interface); + + Loop(); ++ /* NOTREACHED */ ++ return (0); + } + + void + Usage() + { +- (void) fprintf(stderr, "usage: %s -a [ -d -m ] [ -3 | -4 ]\n",Program); +- (void) fprintf(stderr, " %s [ -d -m ] [ -3 | -4 ] interface\n", +- Program); ++ (void) fprintf(stderr, "usage: %s -a [ -d ] [ -3 | -4 ]\n", __progname); ++ (void) fprintf(stderr, " %s [ -d ] [ -3 | -4 ] interface\n", ++ __progname); + exit(1); + } + +@@ -152,14 +139,12 @@ + + /* We don't known which transport, Guess! */ + +- trans = mopGetTrans(pkt, ii->trans); ++ trans = mopGetTrans(pkt, 0); + + /* Ok, return if we don't want this message */ + +- if ((trans == TRANS_ETHER || trans == TRANS_FDDI_8021H) && Not3Flag) +- return; +- if ((trans == TRANS_8023 || trans == TRANS_FDDI_8022) && Not4Flag) +- return; ++ if ((trans == TRANS_ETHER) && Not3Flag) return; ++ if ((trans == TRANS_8023) && Not4Flag) return; + + mopPrintHeader(stdout, pkt, trans); + mopPrintMopHeader(stdout, pkt, trans); +@@ -170,5 +155,3 @@ + fprintf(stdout, "\n"); + fflush(stdout); + } +- +- +diff -rwu mopd-2.5.3.patched/common/loop-linux2.c mopd-2.5.4.orig/common/loop-linux2.c +--- mopd-2.5.3.patched/common/loop-linux2.c 2003-01-09 09:38:26.000000000 +0000 ++++ mopd-2.5.4.orig/common/loop-linux2.c 2003-05-09 10:27:37.000000000 +0100 +@@ -0,0 +1,162 @@ ++/* ++ * Copyright (c) 1993-95 Mats O Jansson. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. All advertising materials mentioning features or use of this software ++ * must display the following acknowledgement: ++ * This product includes software developed by Mats O Jansson. ++ * 4. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef LINT ++static char rcsid[] = "$Id: loop-linux2.c,v 1.1 1999/03/27 14:31:22 maja Exp $"; ++#endif ++ ++#include ++#include ++#include ++#if defined(__bsdi__) || defined(__FreeBSD__) ++#include ++#endif ++#include ++#include ++ ++#include "os.h" ++#include "common.h" ++#include "mopdef.h" ++ ++int ++mopOpenRC(p, trans) ++ struct if_info *p; ++ int trans; ++{ ++#ifndef NORC ++ return (*(p->iopen))(p->if_name, ++ O_RDWR, ++ MOP_K_PROTO_RC, ++ trans); ++#else ++ return -1; ++#endif ++} ++ ++int ++mopOpenDL(p, trans) ++ struct if_info *p; ++ int trans; ++{ ++#ifndef NODL ++ return (*(p->iopen))(p->if_name, ++ O_RDWR, ++ MOP_K_PROTO_DL, ++ trans); ++#else ++ return -1; ++#endif ++} ++ ++void ++mopReadRC() ++{ ++} ++ ++void ++mopReadDL() ++{ ++} ++ ++/* ++ * The list of all interfaces that are being listened to. loop() ++ * "selects" on the descriptors in this list. ++ */ ++struct if_info *iflist; ++ ++void mopProcess __P((struct if_info *, u_char *)); ++ ++/* ++ * Loop indefinitely listening for MOP requests on the ++ * interfaces in 'iflist'. ++ */ ++void ++Loop() ++{ ++ u_char *buf, *bp, *ep; ++ int cc; ++ fd_set fds, listeners; ++ int bufsize = 1100, maxfd =0; ++ struct if_info *ii; ++ ++ ++ if (iflist == 0) { ++ syslog(LOG_ERR, "no interfaces"); ++ exit(0); ++ } ++ ++ buf = (u_char *) malloc((unsigned) bufsize); ++ ++ if (buf == 0) { ++ syslog(LOG_ERR, "malloc: %m"); ++ exit(0); ++ } ++ /* ++ * Find the highest numbered file descriptor for select(). ++ * Initialize the set of descriptors to listen to. ++ */ ++ FD_ZERO(&fds); ++ for (ii = iflist; ii; ii = ii->next) { ++ if (ii->fd != -1) { ++ FD_SET(ii->fd, &fds); ++ if (ii->fd > maxfd) ++ maxfd = ii->fd; ++ } ++ } ++ while (1) { ++ listeners = fds; ++ if (select(maxfd + 1, &listeners, (fd_set *) 0, ++ (fd_set *) 0, (struct timeval *) 0) < 0) { ++ syslog(LOG_ERR, "select: %m"); ++ exit(0); ++ } ++ for (ii = iflist; ii; ii = ii->next) { ++ if (ii->fd != -1) { ++ if (!FD_ISSET(ii->fd, &listeners)) ++ continue; ++ } ++ again: ++ cc = read(ii->fd, (char *) buf, bufsize); ++ /* Don't choke when we get ptraced */ ++ if (cc < 0 && errno == EINTR) ++ goto again; ++ ++ bp = buf; ++ ep = bp + cc; ++ ++if(bp < ep) ++ { ++ mopProcess(ii,buf); ++ } ++ ++} ++ ++} ++} ++ +diff -rwu mopd-2.5.3.patched/common/pf-linux2.c mopd-2.5.4.orig/common/pf-linux2.c +--- mopd-2.5.3.patched/common/pf-linux2.c 2003-01-09 09:38:26.000000000 +0000 ++++ mopd-2.5.4.orig/common/pf-linux2.c 2003-05-09 10:29:57.000000000 +0100 +@@ -0,0 +1,321 @@ ++/* ++ * General Purpose AppleTalk Packet Filter Interface ++ * ++ * Copyright (c) 1992-1995, The University of Melbourne. ++ * All Rights Reserved. Permission to redistribute or ++ * use any part of this software for any purpose must ++ * be obtained in writing from the copyright owner. ++ * ++ * This software is supplied "as is" without express ++ * or implied warranty. ++ * ++ * djh@munnari.OZ.AU ++ * ++ * Supports: ++ * Linux SOCK_PACKET ++ * ++ * $Author: bitblt $ ++ * $Revision: 1.2 $ ++ * ++ * ++ * Modified for use with the linux-mopd port by Karl Maftoum ++ * u963870@student.canberra.edu.au ++ * ++ */ ++ ++/* ++ * include header files ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define MOPDEF_SUPRESS_EXTERN ++#include "mopdef.h" ++ ++/* ++ * definitions ++ * ++ */ ++ ++#define READBUFSIZ 4096 ++#define NUMRDS 32 ++ ++struct RDS { ++ u_short dataLen; ++ u_char *dataPtr; ++}; ++ ++/* ++ * variables ++ * ++ */ ++ ++struct socklist { ++ int iflen; ++ struct sockaddr sa; ++} socklist[32]; ++ ++struct ifreq ifr; ++extern int errno; ++extern int promisc; ++ ++struct RDS RDS[NUMRDS]; ++ ++/* ++ * Open and initialize packet filter ++ * for a particular protocol type. ++ * ++ */ ++ ++ ++int ++pfInit(interface, mode, protocol, typ) ++char *interface; ++u_short protocol; ++int typ, mode; ++{ ++ int s; ++ int ioarg; ++ char device[64]; ++ unsigned long if_flags; ++ ++ ++ { u_short prot; ++ ++ prot = ((typ == TRANS_8023) ? htons(ETH_P_802_2) : htons(protocol)); ++ if ((s = socket(AF_INET, SOCK_PACKET, prot)) < 0) { ++ perror(interface); ++ return(-1); ++ } ++ if (s >= 32) { ++ close(s); ++ return(-1); ++ } ++ } ++ ++ /* ++ * set filter for protocol and type (IPTalk, Phase 1/2) ++ * ++ */ ++ ++ if (setup_pf(s, protocol, typ) < 0) ++ return(-1); ++ ++ /* ++ * set options, bind to underlying interface ++ * ++ */ ++ ++ strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name)); ++ ++ /* record socket interface name and length */ ++ strncpy(socklist[s].sa.sa_data, interface, sizeof(socklist[s].sa.sa_data)); ++ socklist[s].iflen = strlen(interface); ++ ++ return(s); ++} ++ ++/* ++ * establish protocol filter ++ * ++ */ ++ ++int ++setup_pf(s, prot, typ) ++int s, typ; ++u_short prot; ++{ ++ int ioarg; ++ u_short offset; ++ return(0); ++} ++ ++/* ++ * get the interface ethernet address ++ * ++ */ ++ ++int ++pfEthAddr(s, interface, addr) ++int s; ++char *interface; ++u_char *addr; ++{ ++ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) -1); ++ ifr.ifr_name[sizeof(ifr.ifr_name)] = 0; ++ ifr.ifr_addr.sa_family = AF_INET; ++ if (ioctl(s, SIOCGIFHWADDR, &ifr) < 0) { ++ perror("SIOCGIFHWADDR"); ++ return(-1); ++ } ++ memcpy((char *)addr, ifr.ifr_hwaddr.sa_data, 6); ++ return(0); ++} ++ ++/* ++ * add a multicast address to the interface ++ * ++ */ ++ ++int ++pfAddMulti(s, interface, addr) ++int s; ++char *interface; ++u_char *addr; ++{ ++ int sock; ++ ++ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) - 1); ++ ifr.ifr_name[sizeof(ifr.ifr_name)] = 0; ++ ++ ifr.ifr_addr.sa_family = AF_UNSPEC; ++ bcopy((char *)addr, ifr.ifr_addr.sa_data, 6); ++ ++ /* ++ * open a socket, temporarily, to use for SIOC* ioctls ++ * ++ */ ++ if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { ++ perror("socket()"); ++ return(-1); ++ } ++ if (ioctl(sock, SIOCADDMULTI, (caddr_t)&ifr) < 0) { ++ perror("SIOCADDMULTI"); ++ close(sock); ++ return(-1); ++ } ++ close(sock); ++ ++ return(0); ++} ++ ++/* ++ * delete a multicast address from the interface ++ * ++ */ ++ ++int ++pfDelMulti(s, interface, addr) ++int s; ++char *interface; ++u_char *addr; ++{ ++ int sock; ++ ++ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) - 1); ++ ifr.ifr_name[sizeof(ifr.ifr_name)] = 0; ++ ++ ifr.ifr_addr.sa_family = AF_UNSPEC; ++ bcopy((char *)addr, ifr.ifr_addr.sa_data, 6); ++ ++ /* ++ * open a socket, temporarily, to use for SIOC* ioctls ++ * ++ */ ++ if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { ++ perror("socket()"); ++ return(-1); ++ } ++ if (ioctl(sock, SIOCDELMULTI, (caddr_t)&ifr) < 0) { ++ perror("SIOCDELMULTI"); ++ close(sock); ++ return(-1); ++ } ++ close(sock); ++ ++ return(0); ++} ++ ++/* ++ * return 1 if ethernet interface capable of multiple opens ++ * ++ */ ++ ++int ++eth_mopen(phase) ++int phase; ++{ ++ if (phase == 2) ++ return(0); ++ return(1); ++} ++ ++/* ++ * read a packet ++ * Read Data Structure describes packet(s) received ++ * ++ */ ++ ++ ++ ++ ++int ++pfRead(fd, buf, len) ++int fd, len; ++u_char *buf; ++{ ++ int i, cc; ++ ++ int fromlen; ++ struct sockaddr sa; ++ ++ RDS[0].dataLen = 0; ++ fromlen = sizeof(struct sockaddr); ++ ++ if ((cc = recvfrom(fd, (char *)buf, len, 0, &sa, &fromlen)) <= 0) ++ return(cc); ++ ++ /* check if from right interface */ ++ for (i = socklist[fd].iflen-1; i >= 0; i--) ++ if (sa.sa_data[i] != socklist[fd].sa.sa_data[i]) ++ return(0); ++ ++ RDS[0].dataLen = cc; ++ RDS[0].dataPtr = buf; ++ RDS[1].dataLen = 0; ++ ++ return(cc); ++} ++ ++/* ++ * write a packet ++ * ++ */ ++ ++int ++pfWrite(fd, buf, len) ++int fd, len; ++u_char *buf; ++{ ++ ++ if (sendto(fd, buf, len, 0, &socklist[fd].sa, sizeof(struct sockaddr)) == len) ++ return(len); ++ ++ return(-1); ++} ++ ++/* ++ * Return information to device.c how to open device. ++ * In this case the driver can handle both Ethernet type II and ++ * IEEE 802.3 frames (SNAP) in a single pfOpen. ++ */ ++ ++int ++pfTrans(interface) ++ char *interface; ++{ ++ return TRANS_ETHER+TRANS_8023; ++} ++ --- mopd-2.5.3.orig/patches/mopd-2.5.3-proto.patch +++ mopd-2.5.3/patches/mopd-2.5.3-proto.patch @@ -0,0 +1,134 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/common/device.c mopd-2.5.3/common/device.c +--- mopd-2.5.3.macro/common/device.c Sat Oct 27 19:14:58 2001 ++++ mopd-2.5.3/common/device.c Sat Oct 27 19:28:41 2001 +@@ -34,6 +34,7 @@ static char rcsid[] = "$Id: device.c,v 1 + #include "os.h" + #include "common.h" + #include "mopdef.h" ++#include "pf.h" + + struct if_info *iflist; /* Interface List */ + +@@ -319,7 +320,7 @@ deviceInitAll() + ifc.ifc_len = sizeof ibuf; + ifc.ifc_buf = (caddr_t)ibuf; + if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) < 0 || +- ifc.ifc_len < sizeof(struct ifreq)) { ++ ifc.ifc_len < (int)sizeof(struct ifreq)) { + syslog(LOG_ERR, "deviceInitAll: old SIOCGIFCONF: %m"); + exit(1); + } +diff -up --recursive --new-file mopd-2.5.3.macro/common/dl.c mopd-2.5.3/common/dl.c +--- mopd-2.5.3.macro/common/dl.c Sat Oct 27 19:14:58 2001 ++++ mopd-2.5.3/common/dl.c Sat Oct 27 19:28:41 2001 +@@ -43,7 +43,7 @@ mopDumpDL(fd, pkt, trans) + int trans; + { + int i,index = 0; +- long tmpl; ++ u_int tmpl; + u_char tmpc,c,program[257],code,*ucp; + int len,tmps,moplen; + +diff -up --recursive --new-file mopd-2.5.3.macro/common/get.c mopd-2.5.3/common/get.c +--- mopd-2.5.3.macro/common/get.c Sat Oct 27 18:27:16 2001 ++++ mopd-2.5.3/common/get.c Sat Oct 27 19:28:41 2001 +@@ -32,6 +32,7 @@ static char rcsid[] = "$Id: get.c,v 1.5 + #endif + + #include ++#include + #include "mopdef.h" + + u_char +@@ -58,7 +59,7 @@ mopGetShort(pkt, index) + return(ret); + } + +-u_long ++u_int + mopGetLong(pkt, index) + register u_char *pkt; + register int *index; +diff -up --recursive --new-file mopd-2.5.3.macro/common/get.h mopd-2.5.3/common/get.h +--- mopd-2.5.3.macro/common/get.h Thu Oct 5 20:21:59 1995 ++++ mopd-2.5.3/common/get.h Thu Oct 25 23:53:41 2001 +@@ -36,7 +36,7 @@ + #ifdef NO__P + u_char mopGetChar (/* u_char *, int * */); + u_short mopGetShort (/* u_char *, int * */); +-u_long mopGetLong (/* u_char *, int * */); ++u_int mopGetLong (/* u_char *, int * */); + void mopGetMulti (/* u_char *, int *,u_char *,int */); + int mopGetTrans (/* u_char *, int */); + void mopGetHeader (/* u_char *, int *, u_char **, u_char **, u_short *, +@@ -46,7 +46,7 @@ u_short mopGetLength (/* u_char *, int * + __BEGIN_DECLS + u_char mopGetChar __P((u_char *,int *)); + u_short mopGetShort __P((u_char *,int *)); +-u_long mopGetLong __P((u_char *,int *)); ++u_int mopGetLong __P((u_char *,int *)); + void mopGetMulti __P((u_char *,int *,u_char *,int)); + int mopGetTrans __P((u_char *, int)); + void mopGetHeader __P((u_char *, int *, u_char **, u_char **, u_short *, +diff -up --recursive --new-file mopd-2.5.3.macro/common/pf.h mopd-2.5.3/common/pf.h +--- mopd-2.5.3.macro/common/pf.h Fri Oct 13 19:31:29 1995 ++++ mopd-2.5.3/common/pf.h Thu Oct 25 23:53:56 2001 +@@ -36,7 +36,7 @@ + #ifdef NO__P + int pfTrans (/* char * */); + int pfInit (/* char *, int, u_short, int */); +-int pfEthAddr (/* int, u_char * */); ++int pfEthAddr (/* int, char *, u_char * */); + int pfAddMulti (/* int, char *, char * */); + int pfDelMulti (/* int, char *, char * */); + int pfRead (/* int, u_char *, int */); +@@ -45,7 +45,7 @@ int pfWrite (/* int, u_char *, int, i + __BEGIN_DECLS + int pfTrans __P((char *)); + int pfInit __P((char *, int, u_short, int)); +-int pfEthAddr __P((int, u_char *)); ++int pfEthAddr __P((int, char *, u_char *)); + int pfAddMulti __P((int, char *, char *)); + int pfDelMulti __P((int, char *, char *)); + int pfRead __P((int, u_char *, int)); +diff -up --recursive --new-file mopd-2.5.3.macro/common/rc.c mopd-2.5.3/common/rc.c +--- mopd-2.5.3.macro/common/rc.c Sat Oct 27 19:14:58 2001 ++++ mopd-2.5.3/common/rc.c Sat Oct 27 19:28:41 2001 +@@ -43,7 +43,7 @@ mopDumpRC(fd, pkt, trans) + int trans; + { + int i,index = 0; +- long tmpl; ++ u_int tmpl; + u_char tmpc,code,control; + int len,tmps,moplen; + +diff -up --recursive --new-file mopd-2.5.3.macro/mopchk/mopchk.c mopd-2.5.3/mopchk/mopchk.c +--- mopd-2.5.3.macro/mopchk/mopchk.c Sat Oct 27 18:56:23 2001 ++++ mopd-2.5.3/mopchk/mopchk.c Sat Oct 27 19:28:41 2001 +@@ -162,7 +162,7 @@ main(argc, argv) + void + Usage() + { +- (void) fprintf(stderr, "usage: %d [-a] [-v] [filename...]\n",Program); ++ fprintf(stderr, "usage: %s [-a] [-v] [filename...]\n", Program); + exit(1); + } + +diff -up --recursive --new-file mopd-2.5.3.macro/mopd/process.c mopd-2.5.3/mopd/process.c +--- mopd-2.5.3.macro/mopd/process.c Sat Oct 27 19:14:58 2001 ++++ mopd-2.5.3/mopd/process.c Sat Oct 27 19:28:41 2001 +@@ -56,6 +56,12 @@ struct dllist dllist[MAXDL]; /* dump/lo + extern char dl_mcst[]; /* Dump/Load Multicast */ + extern char rc_mcst[]; /* Remote Console Multicast */ + ++#ifdef NO__P ++ssize_t mopFileRead (/* struct dllist *, u_char * */); ++#else ++ssize_t mopFileRead __P((struct dllist *, u_char *)); ++#endif ++ + void + mopProcessInfo(pkt,index,moplen,dl_rpr,trans) + u_char *pkt; --- mopd-2.5.3.orig/patches/mopd-2.5.3-vax-linux.patch +++ mopd-2.5.3/patches/mopd-2.5.3-vax-linux.patch @@ -0,0 +1,328 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/README mopd-2.5.3/README +--- mopd-2.5.3.macro/README Thu Jan 1 00:00:00 1970 ++++ mopd-2.5.3/README Sun Jun 24 19:33:44 2001 +@@ -0,0 +1,20 @@ ++mopd-linux-20000808 ++ ++ This is the Linux version of Mats Jansens' Mopd. ++ ++ The sources here are taken from the NetBSD version of mopd 2.5.3/4 ++ in CVS, plus some bits from the OpenBSD port, and the security ++ fixes reported on BUGTRAQ on 08 Aug 2000. ++ ++ I had to rewrite the Makefiles, and hack things about a bit to compile ++ under Linux, So if this version doesnt work for you, send email to the ++ Linux/VAX list detailing the problem. ++ ++ The mopa.out program does not work. The a.out structures have different ++ names under NetBSD and Linux (see /usr/include/a.out.h), and so the ++ code needs re-writing. ++ ++ atp@pergamentum.com 8/Aug/2000 ++ ++ Patches from John Nall added for Alpha/Linux ++ +diff -up --recursive --new-file mopd-2.5.3.macro/common/common.h mopd-2.5.3/common/common.h +--- mopd-2.5.3.macro/common/common.h Tue Aug 13 12:22:45 1996 ++++ mopd-2.5.3/common/common.h Fri Oct 26 01:33:20 2001 +@@ -38,6 +38,10 @@ + #define BUFSIZE 1600 /* main receive buffer size */ + #define HDRSIZ 22 /* room for 803.2 header */ + ++#ifndef DEFAULT_HOSTNAME ++#define DEFAULT_HOSTNAME "ipc" ++#endif ++ + #ifndef MOP_FILE_PATH + #define MOP_FILE_PATH "/tftpboot/mop" + #endif +diff -up --recursive --new-file mopd-2.5.3.macro/common/device.c mopd-2.5.3/common/device.c +--- mopd-2.5.3.macro/common/device.c Sat Oct 27 18:49:32 2001 ++++ mopd-2.5.3/common/device.c Sat Oct 27 19:14:58 2001 +@@ -82,6 +82,7 @@ deviceEthAddr(ifname, eaddr) + if (ioctl(fd, SIOCGIFCONF, (caddr_t)&ifc) < 0 || + ifc.ifc_len < sizeof(struct ifreq)) { + syslog(LOG_ERR, "deviceEthAddr: SIOGIFCONF: %m"); ++ (void) close(fd); + exit(1); + } + ifr = ifc.ifc_req; +@@ -94,11 +95,13 @@ deviceEthAddr(ifname, eaddr) + continue; + if (!strncmp(ifr->ifr_name, ifname, sizeof(ifr->ifr_name))) { + bcopy((caddr_t)LLADDR(sdl), (caddr_t)eaddr, 6); ++ (void) close(fd); + return; + } + } + + syslog(LOG_ERR, "deviceEthAddr: Never saw interface `%s'!", ifname); ++ (void) close(fd); + exit(1); + } + #endif /* DEV_NEW_CONF */ +@@ -213,11 +216,7 @@ deviceInitOne(ifname) + + /* Ok, get transport information */ + +-#ifdef __linux__ +- trans = TRANS_ETHER+TRANS_8023+TRANS_AND; +-#else + trans = pfTrans(interface); +-#endif + + #ifndef NORC + /* Start with MOP Remote Console */ +diff -up --recursive --new-file mopd-2.5.3.macro/common/dl.c mopd-2.5.3/common/dl.c +--- mopd-2.5.3.macro/common/dl.c Sat Oct 27 18:49:32 2001 ++++ mopd-2.5.3/common/dl.c Sat Oct 27 19:14:58 2001 +@@ -44,8 +44,8 @@ mopDumpDL(fd, pkt, trans) + { + int i,index = 0; + long tmpl; +- u_char tmpc,c,program[17],code,*ucp; +- u_short len,tmps,moplen; ++ u_char tmpc,c,program[257],code,*ucp; ++ int len,tmps,moplen; + + len = mopGetLength(pkt, trans); + +@@ -58,6 +58,8 @@ mopDumpDL(fd, pkt, trans) + index = 16; + moplen = len; + } ++ if (moplen < 1) /* broken packet */ ++ return; + code = mopGetChar(pkt,&index); + + switch (code) { +diff -up --recursive --new-file mopd-2.5.3.macro/common/loop-bsd.c mopd-2.5.3/common/loop-bsd.c +--- mopd-2.5.3.macro/common/loop-bsd.c Sat Oct 27 18:49:32 2001 ++++ mopd-2.5.3/common/loop-bsd.c Sat Oct 27 19:14:58 2001 +@@ -34,7 +34,7 @@ static char rcsid[] = "$Id: loop-bsd.c,v + #include + #include + #include +-#if defined(__bsdi__) || defined(__FreeBSD__) ++#if defined(__bsdi__) || defined(__FreeBSD__) || defined(__NetBSD__) + #include + #endif + #if !defined(__linux__) +diff -up --recursive --new-file mopd-2.5.3.macro/common/os.h mopd-2.5.3/common/os.h +--- mopd-2.5.3.macro/common/os.h Thu Oct 25 22:19:18 2001 ++++ mopd-2.5.3/common/os.h Sat Oct 27 19:14:58 2001 +@@ -70,6 +70,9 @@ + #endif + #include + ++#include ++#include ++ + #if defined(sun) + typedef int ssize_t; + #endif +diff -up --recursive --new-file mopd-2.5.3.macro/common/pf-linux.c mopd-2.5.3/common/pf-linux.c +--- mopd-2.5.3.macro/common/pf-linux.c Sat Oct 27 18:49:32 2001 ++++ mopd-2.5.3/common/pf-linux.c Sat Oct 27 19:14:58 2001 +@@ -45,6 +45,8 @@ + #include + #include + ++#include "mopdef.h" ++ + /* + * map compatible functions + * +@@ -131,7 +133,7 @@ int typ, mode; + + { u_short prot; + +- prot = ((typ == 2) ? htons(ETH_P_802_2) : htons(protocol)); ++ prot = ((typ == TRANS_8023) ? htons(ETH_P_802_2) : htons(protocol)); + if ((s = socket(AF_INET, SOCK_PACKET, prot)) < 0) { + perror(interface); + return(-1); +@@ -175,7 +177,8 @@ int s; + char *interface; + u_char *addr; + { +- strcpy(ifr.ifr_name, interface); ++ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) - 1); ++ ifr.ifr_name[sizeof(ifr.ifr_name)] = 0; + ifr.ifr_addr.sa_family = AF_INET; + if (ioctl(s, SIOCGIFHWADDR, &ifr) < 0) { + perror("SIOCGIFHWADDR"); +@@ -200,7 +203,8 @@ u_char *addr; + + #ifdef USE_SADDMULTI + +- strcpy(ifr.ifr_name, interface); ++ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) - 1); ++ ifr.ifr_name[sizeof(ifr.ifr_name)] = 0; + + #ifdef UPFILT + /* get the real interface name */ +@@ -248,7 +252,8 @@ u_char *addr; + + #ifdef USE_SADDMULTI + +- strcpy(ifr.ifr_name, interface); ++ strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) - 1); ++ ifr.ifr_name[sizeof(ifr.ifr_name)] = 0; + + ifr.ifr_addr.sa_family = AF_UNSPEC; + bcopy((char *)addr, ifr.ifr_addr.sa_data, 6); +@@ -352,6 +357,19 @@ u_char *buf; + return(len); + + return(-1); ++} ++ ++/* ++ * Return information to device.c how to open device. ++ * In this case the driver can handle both Ethernet type II and ++ * IEEE 802.3 frames (SNAP) in a single pfOpen. ++ */ ++ ++int ++pfTrans(interface) ++ char *interface; ++{ ++ return TRANS_ETHER+TRANS_8023; + } + + #endif /* __linux__ */ +diff -up --recursive --new-file mopd-2.5.3.macro/common/rc.c mopd-2.5.3/common/rc.c +--- mopd-2.5.3.macro/common/rc.c Sat Oct 27 18:49:32 2001 ++++ mopd-2.5.3/common/rc.c Sat Oct 27 19:14:58 2001 +@@ -45,7 +45,7 @@ mopDumpRC(fd, pkt, trans) + int i,index = 0; + long tmpl; + u_char tmpc,code,control; +- u_short len,tmps,moplen; ++ int len,tmps,moplen; + + len = mopGetLength(pkt, trans); + +@@ -58,6 +58,8 @@ mopDumpRC(fd, pkt, trans) + index = 16; + moplen = len; + } ++ if (moplen < 1) /* broken packet */ ++ return; + code = mopGetChar(pkt,&index); + + switch (code) { +diff -up --recursive --new-file mopd-2.5.3.macro/mopd/process.c mopd-2.5.3/mopd/process.c +--- mopd-2.5.3.macro/mopd/process.c Sat Oct 27 18:49:32 2001 ++++ mopd-2.5.3/mopd/process.c Sat Oct 27 19:14:58 2001 +@@ -45,6 +45,10 @@ static char rcsid[] = "$Id: process.c,v + #include + #include "process.h" + ++#define SEND_REAL_HOSTNAME ++ ++#define MAX_ETH_PAYLOAD 1492 ++ + extern u_char buf[]; + extern int DebugFlag; + +@@ -266,10 +270,12 @@ mopStartLoad(dst, src, dl_rpr, trans) + dllist[slot].a_lseek = 0; + + dllist[slot].count = 0; +- if (dllist[slot].dl_bsz >= 1492) +- dllist[slot].dl_bsz = 1492; ++ if (dllist[slot].dl_bsz >= MAX_ETH_PAYLOAD) ++ dllist[slot].dl_bsz = MAX_ETH_PAYLOAD; + if (dllist[slot].dl_bsz == 1030) /* VS/uVAX 2000 needs this */ + dllist[slot].dl_bsz = 1000; ++ if (dllist[slot].dl_bsz == 0) /* Needed by "big" VAXen */ ++ dllist[slot].dl_bsz = MAX_ETH_PAYLOAD; + if (trans == TRANS_8023) + dllist[slot].dl_bsz = dllist[slot].dl_bsz - 8; + +@@ -324,6 +330,13 @@ mopNextLoad(dst, src, new_count, trans) + u_short newlen = 0,ptype = MOP_K_PROTO_DL; + u_char mopcode; + ++#ifdef SEND_REAL_HOSTNAME ++ struct utsname uts_name; ++ char hostname[MAXHOSTNAMELEN]; ++#else ++ char hostname[MAXHOSTNAMELEN] = DEFAULT_HOSTNAME; ++#endif ++ + slot = -1; + + for (i = 0; i < MAXDL; i++) { +@@ -352,14 +365,14 @@ mopNextLoad(dst, src, new_count, trans) + sprintf(line, + "%x:%x:%x:%x:%x:%x Load completed", + dst[0],dst[1],dst[2],dst[3],dst[4],dst[5]); +- syslog(LOG_INFO, line); ++ syslog(LOG_INFO, "%s", line); + return; + } + + dllist[slot].lseek = lseek(dllist[slot].ldfd,0L,SEEK_CUR); + +- if (dllist[slot].dl_bsz >= 1492) +- dllist[slot].dl_bsz = 1492; ++ if (dllist[slot].dl_bsz >= MAX_ETH_PAYLOAD) ++ dllist[slot].dl_bsz = MAX_ETH_PAYLOAD; + + index = 0; + mopPutHeader(pkt, &index, dst, src, ptype, trans); +@@ -382,13 +395,22 @@ mopNextLoad(dst, src, new_count, trans) + + } else { + if (len == 0) { ++#ifdef SEND_REAL_HOSTNAME ++ if (uname(&uts_name) < 0) { ++ syslog(LOG_ERR, ++ "uname: %m, sending `%s' as hostname", ++ DEFAULT_HOSTNAME); ++ sprintf(hostname, "%s", DEFAULT_HOSTNAME); ++ } else ++ sprintf(hostname, "%s", uts_name.nodename); ++#endif + index = pindex; + mopcode = MOP_K_CODE_PLT; + mopPutChar (pkt,&index,mopcode); + mopPutChar (pkt,&index,dllist[slot].count); + mopPutChar (pkt,&index,MOP_K_PLTP_HSN); +- mopPutChar (pkt,&index,3); +- mopPutMulti(pkt,&index,"ipc",3); ++ mopPutChar (pkt,&index,strlen(hostname)); ++ mopPutMulti(pkt,&index,hostname,strlen(hostname)); + mopPutChar (pkt,&index,MOP_K_PLTP_HSA); + mopPutChar (pkt,&index,6); + mopPutMulti(pkt,&index,src,6); +@@ -437,7 +459,7 @@ mopProcessDL(fd, ii, pkt, index, dst, sr + { + u_char tmpc; + u_short moplen; +- u_char pfile[17], mopcode; ++ u_char pfile[257], mopcode; + char filename[FILENAME_MAX]; + char line[100]; + int i,nfd,iindex; +@@ -527,7 +549,7 @@ mopProcessDL(fd, ii, pkt, index, dst, sr + src[0],src[1],src[2], + src[3],src[4],src[5],trans,pfile); + } +- syslog(LOG_INFO, line); ++ syslog(LOG_INFO, "%s", line); + } else { + if ((mopCmpEAddr(dst,ii->eaddr) == 0)) { + dl_rpr->ldfd = open(filename, O_RDONLY, 0); +@@ -536,7 +558,7 @@ mopProcessDL(fd, ii, pkt, index, dst, sr + "%x:%x:%x:%x:%x:%x Send me %s", + src[0],src[1],src[2], + src[3],src[4],src[5],pfile); +- syslog(LOG_INFO, line); ++ syslog(LOG_INFO, "%s", line); + } + } + --- mopd-2.5.3.orig/patches/fhs-fileloc.patch +++ mopd-2.5.3/patches/fhs-fileloc.patch @@ -0,0 +1,56 @@ +diff -rup oldbuildtree/common/common.h /buildtree/common/common.h +--- oldbuildtree/common/common.h 2009-07-19 10:29:13.000000000 +0100 ++++ buildtree/common/common.h 2009-07-26 12:47:31.000000000 +0100 +@@ -42,8 +42,9 @@ + #define DEFAULT_HOSTNAME "ipc" + #endif + ++#define COMPAT_MOP_FILE_PATH "/tftpboot/mop" + #ifndef MOP_FILE_PATH +-#define MOP_FILE_PATH "/tftpboot/mop" ++#define MOP_FILE_PATH "/srv/tftp/mop" + #endif + + #define DEBUG_ONELINE 1 +diff -rup oldbuildtree/mopd/mopd.8 oldbuildtree/mopd/mopd.8 +--- oldbuildtree/mopd/mopd.8 2009-07-19 10:29:13.000000000 +0100 ++++ buildtree/mopd/mopd.8 2009-07-26 12:43:55.000000000 +0100 +@@ -53,7 +53,7 @@ must know what image to load. + Upon receiving a request, + .Nm + checks if the requested file exists in +-.Pa /tftpboot/mop , ++.Pa /srv/tftp/mop , + the filename is normally uppercase and with an extension of + .Pa .SYS . + If the filename isn't given, the ethernet address (in lower case, apart from +@@ -87,7 +87,7 @@ Run in the foreground. + .El + .Sh FILES + .Bl -tag -width Pa -compact +-.It Pa /tftpboot/mop ++.It Pa /srv/tftp/mop + .El + .Sh SEE ALSO + .Xr bpf 4 , +diff -rup oldbuildtree/mopd/process.c buildtree/mopd/process.c +--- oldbuildtree/mopd/process.c 2009-07-19 10:29:13.000000000 +0100 ++++ buildtree/mopd/process.c 2009-07-26 12:43:55.000000000 +0100 +@@ -535,10 +535,17 @@ mopProcessDL(fd, ii, pkt, index, dst, sr + + ptr = pfile + strlen (pfile) - strlen(".sys"); + if ( ! strstr(ptr, ".SYS") && ! strstr(ptr, ".sys") ) { ++ struct stat st; + sprintf(filename,"%s/%s.SYS", MOP_FILE_PATH, pfile); ++ if (stat(filename, &st) != 0) ++ sprintf(filename,"%s/%s.SYS", COMPAT_MOP_FILE_PATH, pfile); ++ + } + else { + sprintf(filename,"%s/%s", MOP_FILE_PATH, pfile); ++ struct stat st; ++ if (stat(filename, &st) != 0) ++ sprintf(filename,"%s/%s", COMPAT_MOP_FILE_PATH, pfile); + } + + if ((mopCmpEAddr(dst,dl_mcst) == 0)) { --- mopd-2.5.3.orig/patches/mopd-2.5.3-elf.patch +++ mopd-2.5.3/patches/mopd-2.5.3-elf.patch @@ -0,0 +1,846 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/Makefile mopd-2.5.3/Makefile +--- mopd-2.5.3.macro/Makefile 2001-10-27 19:51:19.000000000 +0000 ++++ mopd-2.5.3/Makefile 2002-11-17 15:08:21.000000000 +0000 +@@ -4,6 +4,7 @@ RANLIB = ranlib + + CFLAGS = -O2 -g + LDFLAGS = ++LIBELF = -lelf + + SUBDIRS = common mopd mopchk mopprobe moptrace + +@@ -11,6 +12,7 @@ all clean: + @for dir in $(SUBDIRS); do \ + (cd $$dir && \ + $(MAKE) "AR=$(AR)" "CC=$(CC)" "RANLIB=$(RANLIB)" \ +- "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" $@) || \ ++ "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" \ ++ "LIBELF=$(LIBELF)" $@) || \ + exit 1; \ + done +diff -up --recursive --new-file mopd-2.5.3.macro/common/common.h mopd-2.5.3/common/common.h +--- mopd-2.5.3.macro/common/common.h 2001-10-26 01:33:20.000000000 +0000 ++++ mopd-2.5.3/common/common.h 2001-10-27 20:19:50.000000000 +0000 +@@ -71,6 +71,28 @@ struct if_info { + #define DL_STATUS_SENT_MLD 2 + #define DL_STATUS_SENT_PLT 3 + ++#define FTYPE_NONE 0 /* unindentified image */ ++#define FTYPE_MOP 1 /* DEC MOP image */ ++#define FTYPE_AOUT 2 /* a.out executable */ ++#define FTYPE_COFF 3 /* COFF executable */ ++#define FTYPE_ELF 4 /* ELF executable */ ++ ++#define SEG_TEXT 0 /* Segment table entry numbers */ ++#define SEG_DATA 1 /* for file types that use */ ++#define SEG_BSS 2 /* fixed segments */ ++ ++#define MAXSEG 16 /* Max. number of program segments */ ++ ++struct seg { ++ off_t seek; /* File offset of segment */ ++ u_long data; /* Size of segment data */ ++ u_long fill; /* Size of segment fill */ ++}; ++ ++struct segs { ++ struct seg s[MAXSEG]; /* File segments */ ++}; ++ + struct dllist { + u_char status; /* Status byte */ + struct if_info *ii; /* interface pointer */ +@@ -82,15 +104,9 @@ struct dllist { + u_long loadaddr; /* Load Address */ + u_long xferaddr; /* Transfer Address */ + u_long nloadaddr; /* Next Load Address */ +- long lseek; /* Seek before last read */ +- int aout; /* Is it an a.out file */ +- u_long a_text; /* Size of text segment */ +- u_long a_text_fill; /* Size of text segment fill */ +- u_long a_data; /* Size of data segment */ +- u_long a_data_fill; /* Size of data segment fill */ +- u_long a_bss; /* Size of bss segment */ +- u_long a_bss_fill; /* Size of bss segment fill */ +- long a_lseek; /* Keep track of pos in newfile */ ++ int ftype; /* File type */ ++ struct segs seg; /* File segments */ ++ u_long addr; /* Current relative address */ + }; + + #endif _COMMON_H_ +diff -up --recursive --new-file mopd-2.5.3.macro/common/file.c mopd-2.5.3/common/file.c +--- mopd-2.5.3.macro/common/file.c 2001-10-27 21:45:14.000000000 +0000 ++++ mopd-2.5.3/common/file.c 2001-11-11 15:50:51.000000000 +0000 +@@ -50,6 +50,22 @@ static char rcsid[] = "$Id: file.c,v 1.4 + #endif + #endif + ++#ifndef NOELF ++#include ++#endif ++ ++struct mopphdr { ++ off_t offset; ++ u_long paddr; ++ u_long filesz; ++ u_long memsz; ++ u_long fill; ++}; ++ ++struct mopphdrs { ++ struct mopphdr p[MAXSEG]; ++}; ++ + int fileinfo; + + void +@@ -156,13 +172,15 @@ CheckMopFile(fd) + } + + int +-GetMopFileInfo(fd, load, xfr) +- int fd; ++GetMopFileInfo(fd, load, xfr, ftype, seg) ++ int fd, *ftype; + u_long *load, *xfr; ++ struct segs *seg; + { + u_char header[512]; + short image_type; +- u_long load_addr, xfr_addr, isd, iha, hbcnt, isize; ++ u_long load_addr, xfr_addr, isd, iha; ++ off_t hbcnt, isize; + + (void)lseek(fd, (off_t) 0, SEEK_SET); + +@@ -287,6 +305,26 @@ GetMopFileInfo(fd, load, xfr) + *xfr = xfr_addr; + } + ++ if (seg != NULL) { ++ off_t hsize; ++ ++ hsize = hbcnt * 512; ++ if (!hsize || !isize) { ++ hsize = 512; ++ isize = lseek(fd, (off_t) 0, SEEK_END); ++ if (isize < 0) ++ return(-1); ++ isize -= hsize; ++ } ++ ++ seg->s[SEG_TEXT].seek = hsize; ++ seg->s[SEG_TEXT].data = isize; ++ } ++ ++ if (ftype != NULL) { ++ *ftype = FTYPE_MOP; ++ } ++ + return(0); + } + +@@ -441,11 +479,10 @@ CheckAOutFile(fd) + + /*###440 [cc] syntax error before `int'%%%*/ + int +-GetAOutFileInfo(fd, load, xfr, a_text, a_text_fill, +- a_data, a_data_fill, a_bss, a_bss_fill, aout) +- int fd, *aout; +- u_long *load, *xfr, *a_text, *a_text_fill; +- u_long *a_data, *a_data_fill, *a_bss, *a_bss_fill; ++GetAOutFileInfo(fd, load, xfr, ftype, seg) ++ int fd, *ftype; ++ u_long *load, *xfr; ++ struct segs *seg; + { + #ifdef NOAOUT + return(-1); +@@ -609,7 +646,7 @@ GetAOutFileInfo(fd, load, xfr, a_text, a + + /*###608 [cc] `load' undeclared (first use this function)%%%*/ + if (load != NULL) { +- *load = 0; ++ *load = N_TXTADDR(ex); + } + + /*###612 [cc] `xfr' undeclared (first use this function)%%%*/ +@@ -617,106 +654,321 @@ GetAOutFileInfo(fd, load, xfr, a_text, a + *xfr = ex.a_entry; + } + +-/*###616 [cc] `a_text' undeclared (first use this function)%%%*/ +- if (a_text != NULL) { +- *a_text = ex.a_text; +- } ++/*###616 [cc] `seg' undeclared (first use this function)%%%*/ ++ if (seg != NULL) { ++ u_long fill; + +-/*###620 [cc] `a_text_fill' undeclared (first use this function)%%%*/ +- if (a_text_fill != NULL) { ++ seg->s[SEG_TEXT].seek = N_TXTOFF(ex); ++ seg->s[SEG_TEXT].data = ex.a_text; + if (magic == ZMAGIC || magic == NMAGIC) { +- *a_text_fill = clbytes - (ex.a_text & clofset); +- if (*a_text_fill == clbytes) { +- *a_text_fill = 0; ++ fill = clbytes - (ex.a_text & clofset); ++ if (fill == clbytes) { ++ fill = 0; + } +- } else { +- *a_text_fill = 0; ++ seg->s[SEG_TEXT].fill = fill; + } +- } +- +-/*###631 [cc] `a_data' undeclared (first use this function)%%%*/ +- if (a_data != NULL) { +- *a_data = ex.a_data; +- } + +-/*###635 [cc] `a_data_fill' undeclared (first use this function)%%%*/ +- if (a_data_fill != NULL) { ++ seg->s[SEG_DATA].seek = N_DATOFF(ex); ++ seg->s[SEG_DATA].data = ex.a_data; + if (magic == ZMAGIC || magic == NMAGIC) { +- *a_data_fill = clbytes - (ex.a_data & clofset); +- if (*a_data_fill == clbytes) { +- *a_data_fill = 0; ++ fill = clbytes - (ex.a_data & clofset); ++ if (fill == clbytes) { ++ fill = 0; + } +- } else { +- *a_data_fill = 0; ++ seg->s[SEG_DATA].fill = fill; + } ++ ++ if (magic == ZMAGIC || magic == NMAGIC) { ++ fill = clbytes - (ex.a_bss & clofset); ++ } else { ++ fill = clbytes - ++ ((ex.a_text + ex.a_data + ex.a_bss) & clofset); ++ } ++ if (fill == clbytes) { ++ fill = 0; ++ } ++ seg->s[SEG_BSS].fill = ex.a_bss + fill; + } + +-/*###646 [cc] `a_bss' undeclared (first use this function)%%%*/ +- if (a_bss != NULL) { +- *a_bss = ex.a_bss; ++/*###665 [cc] `ftype' undeclared (first use this function)%%%*/ ++ if (ftype != NULL) { ++ *ftype = FTYPE_AOUT; + } + +-/*###650 [cc] `a_bss_fill' undeclared (first use this function)%%%*/ +- if (a_bss_fill != NULL) { +- if (magic == ZMAGIC || magic == NMAGIC) { +- *a_bss_fill = clbytes - (ex.a_bss & clofset); +- if (*a_bss_fill == clbytes) { +- *a_bss_fill = 0; +- } +- } else { +- *a_bss_fill = clbytes - +- ((ex.a_text+ex.a_data+ex.a_bss) & clofset); +- if (*a_text_fill == clbytes) { +- *a_text_fill = 0; ++ return(0); ++#endif NOAOUT ++} ++ ++#ifndef NOELF ++void ++sortELFphdrs(p, l, r) ++ struct mopphdrs *p; ++ int l, r; ++{ ++ struct mopphdr tmp; ++ int lp = l, rp = r, mp = (l + r) / 2; ++ ++ do { ++ while (p->p[lp].paddr < p->p[mp].paddr) ++ lp++; ++ while (p->p[mp].paddr < p->p[rp].paddr) ++ rp--; ++ if (lp <= rp) { ++ tmp = p->p[lp]; ++ p->p[lp] = p->p[rp]; ++ p->p[rp] = tmp; ++ lp++; ++ rp--; ++ } ++ } while (lp <= rp); ++ if (l < rp) ++ sortELFphdrs(p, l, rp); ++ if (lp < r) ++ sortELFphdrs(p, lp, r); ++} ++#endif /* NOELF */ ++ ++int ++CheckELFFile(fd) ++ int fd; ++{ ++#ifdef NOELF ++ return(-1); ++#else ++ Elf *elf; ++ ++ if (elf_version(EV_CURRENT) == EV_NONE) ++ return(-1); ++ ++ elf = elf_begin(fd, ELF_C_READ, NULL); ++ if (!elf) ++ return(-1); ++ ++ if (elf_kind(elf) != ELF_K_ELF) { ++ elf_end(elf); ++ return(-1); ++ } ++ ++ elf_end(elf); ++ return(0); ++#endif /* NOELF */ ++} ++ ++int ++GetELFFileInfo(fd, load, xfr, ftype, seg) ++ int fd, *ftype; ++ u_long *load, *xfr; ++ struct segs *seg; ++{ ++#ifdef NOELF ++ return(-1); ++#else ++ struct mopphdrs p; ++ Elf *elf; ++ Elf32_Ehdr *ehdr; ++ Elf32_Phdr *phdr; ++ Elf64_Ehdr *e64hdr; ++ Elf64_Phdr *p64hdr; ++ char ei_class; ++ char ei_data; ++ int e_type; ++ u_long e_entry; ++ int e_phnum; ++ long p_type; ++ int i, j; ++ ++ elf = elf_begin(fd, ELF_C_READ, NULL); ++ if (!elf) ++ return(-1); ++ ++ ehdr = elf32_getehdr(elf); ++ phdr = elf32_getphdr(elf); ++ e64hdr = elf64_getehdr(elf); ++ p64hdr = elf64_getphdr(elf); ++ ++ if ((!ehdr || !phdr) && (!e64hdr || !p64hdr)) { ++ elf_end(elf); ++ return(-1); ++ } ++ ++ e_type = ehdr ? ehdr->e_type : e64hdr->e_type; ++ if (e_type != ET_EXEC) { ++ if (fileinfo) ++ printf("ELF non-executable, not supported\n"); ++ elf_end(elf); ++ return(-1); ++ } ++ ++ e_entry = ehdr ? ehdr->e_entry : e64hdr->e_entry; ++ ++ bzero(&p, sizeof(p)); ++ ++ i = 0; ++ j = 0; ++ e_phnum = ehdr ? ehdr->e_phnum : e64hdr->e_phnum; ++ while (i < e_phnum) { ++ ++ p_type = phdr ? phdr->p_type : p64hdr->p_type; ++ if (p_type == PT_DYNAMIC) { ++ if (fileinfo) ++ printf("ELF dynamic executable, " ++ "not supported\n"); ++ elf_end(elf); ++ return(-1); ++ } ++ ++ if (p_type == PT_LOAD) { ++ ++ if (j >= MAXSEG) { ++ if (fileinfo) ++ printf("ELF executable, " ++ "over %u segments, " ++ "not supported\n", MAXSEG); ++ elf_end(elf); ++ return(-1); + } +- } ++ ++ if (phdr) { ++ p.p[j].offset = phdr->p_offset; ++ p.p[j].paddr = phdr->p_paddr; ++ p.p[j].filesz = phdr->p_filesz; ++ p.p[j].memsz = phdr->p_memsz; ++ } else { ++ p.p[j].offset = p64hdr->p_offset; ++ p.p[j].paddr = p64hdr->p_paddr; ++ p.p[j].filesz = p64hdr->p_filesz; ++ p.p[j].memsz = p64hdr->p_memsz; ++ } ++ ++ j++; ++ } ++ ++ if (phdr) ++ phdr++; ++ else ++ p64hdr++; ++ i++; ++ }; ++ if (!j) { ++ if (fileinfo) ++ printf("ELF executable, no segments to load\n"); ++ elf_end(elf); ++ return(-1); + } + +-/*###665 [cc] `aout' undeclared (first use this function)%%%*/ +- if (aout != NULL) { +- *aout = mid; ++ sortELFphdrs(&p, 0, j - 1); ++ ++ for (i = 0; i < j; i++) { ++ p.p[i].fill = p.p[i].memsz - p.p[i].filesz; ++ if (i > 0) ++ p.p[i - 1].fill += p.p[i].paddr - ++ (p.p[i - 1].paddr + ++ p.p[i - 1].memsz); ++ if (seg != NULL) { ++ seg->s[i].seek = p.p[i].offset; ++ seg->s[i].data = p.p[i].filesz; ++ seg->s[i].fill = p.p[i].fill; ++ if (i > 0) ++ seg->s[i - 1].fill = p.p[i - 1].fill; ++ } ++ }; ++ ++ if (load != NULL) { ++ *load = p.p[0].paddr; ++ } ++ if (xfr != NULL) { ++ *xfr = e_entry; + } + ++ if (fileinfo) { ++ char *clstr = ""; ++ char *dtstr = ""; ++ ++ ei_class = ehdr ? ehdr->e_ident[EI_CLASS] : ++ e64hdr->e_ident[EI_CLASS]; ++ ei_data = ehdr ? ehdr->e_ident[EI_DATA] : ++ e64hdr->e_ident[EI_DATA]; ++ switch (ei_class) { ++ case ELFCLASS32: ++ clstr = " 32-bit"; ++ break; ++ case ELFCLASS64: ++ clstr = " 64-bit"; ++ break; ++ default: ++ ; ++ } ++ switch (ei_data) { ++ case ELFDATA2LSB: ++ dtstr = " LSB"; ++ break; ++ case ELFDATA2MSB: ++ dtstr = " MSB"; ++ break; ++ default: ++ ; ++ } ++ printf("ELF%s%s executable\n", clstr, dtstr); ++ for (i = 0; i < j; i++) ++ printf("Size of seg #%02d: %08x (+ %08x fill)\n", ++ i, p.p[i].filesz, p.p[i].fill); ++ printf("Load Address: %08x\n", p.p[0].paddr); ++ printf("Transfer Address: %08x\n", e_entry); ++ } ++ ++ if (ftype != NULL) { ++ *ftype = FTYPE_ELF; ++ } ++ ++ elf_end(elf); ++ + return(0); +-#endif NOAOUT ++#endif /* NOELF */ + } + + /*###673 [cc] syntax error before `int'%%%*/ + int +-GetFileInfo(fd, load, xfr, aout, +- a_text, a_text_fill, a_data, a_data_fill, a_bss, a_bss_fill) +- int fd, *aout; +- u_long *load, *xfr, *a_text, *a_text_fill; +- u_long *a_data, *a_data_fill, *a_bss, *a_bss_fill; ++GetFileInfo(fd, load, xfr, ftype, seg) ++ int fd, *ftype; ++ u_long *load, *xfr; ++ struct segs *seg; + { + int err; + ++ *ftype = FTYPE_NONE; ++ bzero(seg, sizeof(*seg)); ++ ++ err = CheckELFFile(fd); ++ ++ if (err == 0) { ++ err = GetELFFileInfo(fd, load, xfr, ftype, seg); ++ if (err != 0) { ++ return(-1); ++ } ++ return(0); ++ } ++ + err = CheckAOutFile(fd); + + if (err == 0) { +- err = GetAOutFileInfo(fd, load, xfr, +- a_text, a_text_fill, +- a_data, a_data_fill, +- a_bss, a_bss_fill, +- aout); ++ err = GetAOutFileInfo(fd, load, xfr, ftype, seg); + if (err != 0) { + return(-1); + } +- } else { +- err = CheckMopFile(fd); +- +- if (err == 0) { +- err = GetMopFileInfo(fd, load, xfr); +- if (err != 0) { +- return(-1); +- } +- *aout = -1; +- } else { ++ return(0); ++ } ++ ++ err = CheckMopFile(fd); ++ ++ if (err == 0) { ++ err = GetMopFileInfo(fd, load, xfr, ftype, seg); ++ if (err != 0) { + return(-1); + } ++ return(0); + } + +- return(0); ++ return(-1); + } + + ssize_t +@@ -726,20 +978,20 @@ mopFileRead(dlslot, buf) + u_char *buf; + { + ssize_t len, outlen; +- int bsz; ++ int bsz, i; + long pos, notdone, total; + +-/*###719 [cc] `dlslot' undeclared (first use this function)%%%*/ +- if (dlslot->aout == -1) { +-/*###720 [cc] `buf' undeclared (first use this function)%%%*/ +- len = read(dlslot->ldfd,buf,dlslot->dl_bsz); +- } else { +- bsz = dlslot->dl_bsz; +- pos = dlslot->a_lseek; +- len = 0; ++ bsz = dlslot->dl_bsz; ++ pos = dlslot->addr; ++ total = 0; ++ len = 0; ++ ++ i = 0; ++ while (i < MAXSEG) { ++ if (pos == total) ++ lseek(dlslot->ldfd, dlslot->seg.s[i].seek, SEEK_SET); + +- total = dlslot->a_text; +- ++ total += dlslot->seg.s[i].data; + if (pos < total) { + notdone = total - pos; + if (notdone <= bsz) { +@@ -754,8 +1006,11 @@ mopFileRead(dlslot, buf) + bsz = bsz - outlen; + } + +- total = total + dlslot->a_text_fill; ++ dlslot->addr = pos; ++ if (!bsz) ++ break; + ++ total += dlslot->seg.s[i].fill; + if ((bsz > 0) && (pos < total)) { + notdone = total - pos; + if (notdone <= bsz) { +@@ -770,72 +1025,11 @@ mopFileRead(dlslot, buf) + bsz = bsz - outlen; + } + +- total = total + dlslot->a_data; +- +- if ((bsz > 0) && (pos < total)) { +- notdone = total - pos; +- if (notdone <= bsz) { +-/*###760 [cc] subscripted value is neither array nor pointer%%%*/ +- outlen = read(dlslot->ldfd,&buf[len],notdone); +- } else { +-/*###762 [cc] subscripted value is neither array nor pointer%%%*/ +- outlen = read(dlslot->ldfd,&buf[len],bsz); +- } +- len = len + outlen; +- pos = pos + outlen; +- bsz = bsz - outlen; +- } +- +- total = total + dlslot->a_data_fill; +- +- if ((bsz > 0) && (pos < total)) { +- notdone = total - pos; +- if (notdone <= bsz) { +- outlen = notdone; +- } else { +- outlen = bsz; +- } +-/*###778 [cc] subscripted value is neither array nor pointer%%%*/ +- bzero(&buf[len],outlen); +- len = len + outlen; +- pos = pos + outlen; +- bsz = bsz - outlen; +- } +- +- total = total + dlslot->a_bss; +- +- if ((bsz > 0) && (pos < total)) { +- notdone = total - pos; +- if (notdone <= bsz) { +- outlen = notdone; +- } else { +- outlen = bsz; +- } +-/*###793 [cc] subscripted value is neither array nor pointer%%%*/ +- bzero(&buf[len],outlen); +- len = len + outlen; +- pos = pos + outlen; +- bsz = bsz - outlen; +- } +- +- total = total + dlslot->a_bss_fill; +- +- if ((bsz > 0) && (pos < total)) { +- notdone = total - pos; +- if (notdone <= bsz) { +- outlen = notdone; +- } else { +- outlen = bsz; +- } +-/*###808 [cc] subscripted value is neither array nor pointer%%%*/ +- bzero(&buf[len],outlen); +- len = len + outlen; +- pos = pos + outlen; +- bsz = bsz - outlen; +- } +- +- dlslot->a_lseek = pos; ++ dlslot->addr = pos; ++ if (!bsz) ++ break; + ++ i++; + } + + return(len); +diff -up --recursive --new-file mopd-2.5.3.macro/common/file.h mopd-2.5.3/common/file.h +--- mopd-2.5.3.macro/common/file.h 2001-10-27 20:49:08.000000000 +0000 ++++ mopd-2.5.3/common/file.h 2001-10-27 21:46:53.000000000 +0000 +@@ -42,12 +42,12 @@ u_long mopFileGetLX (/* u_char *, int, + u_long mopFileGetBX (/* u_char *, int, int */); + void mopFileSwapX (/* u_char *, int, int */); + int CheckMopFile (/* int */); +-int GetMopFileInfo (/* int, u_long *, u_long * */); ++int GetMopFileInfo (/* int, u_long *, u_long *, int *, struct segs * */); + int CheckAOutFile (/* int */); +-int GetAOutFileInfo(/* int, u_long *, u_long *, u_long *, u_long *, +- u_long *, u_long *, u_long *, u_long * */); +-int GetFileInfo (/* int, u_long *, u_long *, int *, u_long *, u_long *, +- u_long *, u_long *, u_long *, u_long * */); ++int GetAOutFileInfo(/* int, u_long *, u_long *, int *, struct segs * */); ++int CheckELFFile (/* int */); ++int GetELFFileInfo (/* int, u_long *, u_long *, int *, struct segs * */); ++int GetFileInfo (/* int, u_long *, u_long *, int *, struct segs * */); + #else + __BEGIN_DECLS + void mopFilePutLX __P((u_char *, int, u_long, int)); +@@ -56,13 +56,12 @@ u_long mopFileGetLX __P((u_char *, in + u_long mopFileGetBX __P((u_char *, int, int)); + void mopFileSwapX __P((u_char *, int, int)); + int CheckMopFile __P((int)); +-int GetMopFileInfo __P((int, u_long *, u_long *)); ++int GetMopFileInfo __P((int, u_long *, u_long *, int *, struct segs *)); + int CheckAOutFile __P((int)); +-int GetAOutFileInfo __P((int, u_long *, u_long *, u_long *, u_long *, +- u_long *, u_long *, u_long *, u_long *, int *)); +-int GetFileInfo __P((int, u_long *, u_long *, int *, +- u_long *, u_long *, u_long *, u_long *, +- u_long *, u_long *)); ++int GetAOutFileInfo __P((int, u_long *, u_long *, int *, struct segs *)); ++int CheckELFFile __P((int)); ++int GetELFFileInfo __P((int, u_long *, u_long *, int *, struct segs *)); ++int GetFileInfo __P((int, u_long *, u_long *, int *, struct segs *)); + __END_DECLS + #endif + +diff -up --recursive --new-file mopd-2.5.3.macro/mopchk/Makefile mopd-2.5.3/mopchk/Makefile +--- mopd-2.5.3.macro/mopchk/Makefile 2002-11-17 14:55:42.000000000 +0000 ++++ mopd-2.5.3/mopchk/Makefile 2002-11-17 15:09:29.000000000 +0000 +@@ -1,13 +1,14 @@ + PROGS = mopchk + OBJS = mopchk.o + LIBS = ../common/libcommon.a ++LIBELF = -lelf + + CPPFLAGS = -I.. + + all: $(PROGS) + + mopchk: $(OBJS) $(LIBS) +- $(CC) $(CFLAGS) $(LDFLAGS) -o mopchk $(OBJS) $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o mopchk $(OBJS) $(LIBS) $(LIBELF) + + ../common/libcommon.a: + cd ../common && $(MAKE) libcommon.a +diff -up --recursive --new-file mopd-2.5.3.macro/mopchk/mopchk.c mopd-2.5.3/mopchk/mopchk.c +--- mopd-2.5.3.macro/mopchk/mopchk.c 2001-10-27 21:08:11.000000000 +0000 ++++ mopd-2.5.3/mopchk/mopchk.c 2001-10-27 21:46:53.000000000 +0000 +@@ -73,7 +73,7 @@ main(argc, argv) + int op, i, fd; + char *filename; + struct if_info *ii; +- int err, aout; ++ int err; + + extern int optind, opterr; + +@@ -138,25 +138,31 @@ main(argc, argv) + fd = open(filename, O_RDONLY, 0); + if (fd == -1) { + printf("Unknown file.\n"); +- } else { +- err = CheckAOutFile(fd); +- if (err == 0) { +- if (GetAOutFileInfo(fd, 0, 0, 0, 0, +- 0, 0, 0, 0, &aout) < 0) { +- printf("Some failure in GetAOutFileInfo\n"); +- aout = -1; +- } +- } else { +- aout = -1; ++ continue; ++ } ++ ++ err = CheckELFFile(fd); ++ if (err == 0) { ++ if (GetELFFileInfo(fd, 0, 0, 0, 0) < 0) { ++ printf("Some failure in GetELFFileInfo\n"); ++ } ++ continue; ++ } ++ ++ err = CheckAOutFile(fd); ++ if (err == 0) { ++ if (GetAOutFileInfo(fd, 0, 0, 0, 0) < 0) { ++ printf("Some failure in GetAOutFileInfo\n"); + } +- if (aout == -1) +- err = CheckMopFile(fd); +- if (aout == -1 && err == 0) { +- if (GetMopFileInfo(fd, 0, 0) < 0) { +- printf("Some failure in GetMopFileInfo\n"); +- } +- }; ++ continue; + } ++ ++ err = CheckMopFile(fd); ++ if (err == 0) { ++ if (GetMopFileInfo(fd, 0, 0, 0, 0) < 0) { ++ printf("Some failure in GetMopFileInfo\n"); ++ } ++ }; + } + + } +diff -up --recursive --new-file mopd-2.5.3.macro/mopd/Makefile mopd-2.5.3/mopd/Makefile +--- mopd-2.5.3.macro/mopd/Makefile 2002-11-17 14:56:16.000000000 +0000 ++++ mopd-2.5.3/mopd/Makefile 2002-11-17 15:10:10.000000000 +0000 +@@ -1,13 +1,14 @@ + PROGS = mopd + OBJS = mopd.o process.o + LIBS = ../common/libcommon.a ++LIBELF = -lelf + + CPPFLAGS = -I.. + + all: $(PROGS) + + mopd: $(OBJS) $(LIBS) +- $(CC) $(CFLAGS) $(LDFLAGS) -o mopd $(OBJS) $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o mopd $(OBJS) $(LIBS) $(LIBELF) + + ../common/libcommon.a: + cd ../common && $(MAKE) libcommon.a +diff -up --recursive --new-file mopd-2.5.3.macro/mopd/process.c mopd-2.5.3/mopd/process.c +--- mopd-2.5.3.macro/mopd/process.c 2001-10-27 19:14:58.000000000 +0000 ++++ mopd-2.5.3/mopd/process.c 2001-10-27 19:36:40.000000000 +0000 +@@ -260,14 +260,11 @@ mopStartLoad(dst, src, dl_rpr, trans) + GetFileInfo(dllist[slot].ldfd, + &dllist[slot].loadaddr, + &dllist[slot].xferaddr, +- &dllist[slot].aout, +- &dllist[slot].a_text, &dllist[slot].a_text_fill, +- &dllist[slot].a_data, &dllist[slot].a_data_fill, +- &dllist[slot].a_bss, &dllist[slot].a_bss_fill); ++ &dllist[slot].ftype, ++ &dllist[slot].seg); + + dllist[slot].nloadaddr = dllist[slot].loadaddr; +- dllist[slot].lseek = lseek(dllist[slot].ldfd,0L,SEEK_CUR); +- dllist[slot].a_lseek = 0; ++ dllist[slot].addr = 0; + + dllist[slot].count = 0; + if (dllist[slot].dl_bsz >= MAX_ETH_PAYLOAD) +@@ -369,8 +366,6 @@ mopNextLoad(dst, src, new_count, trans) + return; + } + +- dllist[slot].lseek = lseek(dllist[slot].ldfd,0L,SEEK_CUR); +- + if (dllist[slot].dl_bsz >= MAX_ETH_PAYLOAD) + dllist[slot].dl_bsz = MAX_ETH_PAYLOAD; + --- mopd-2.5.3.orig/patches/mopd-2.5.3-eaddr.patch +++ mopd-2.5.3/patches/mopd-2.5.3-eaddr.patch @@ -0,0 +1,40 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/common/device.c mopd-2.5.3/common/device.c +--- mopd-2.5.3.macro/common/device.c 2001-10-27 19:14:58.000000000 +0000 ++++ mopd-2.5.3/common/device.c 2002-11-17 12:50:33.000000000 +0000 +@@ -151,12 +151,7 @@ deviceOpen(ifname, proto, trans) + #ifdef DEV_NEW_CONF + deviceEthAddr(p->if_name,&p->eaddr[0]); + #elif defined(__linux__) +- { +- int s; +- s = socket(AF_INET,SOCK_DGRAM,0); +- pfEthAddr(s,p->if_name,&p->eaddr[0]); +- (void) close(s); +- } ++ pfEthAddr(0, p->if_name,&p->eaddr[0]); + #else + p->eaddr[0]= tmp.eaddr[0]; + p->eaddr[1]= tmp.eaddr[1]; +diff -up --recursive --new-file mopd-2.5.3.macro/common/pf-linux.c mopd-2.5.3/common/pf-linux.c +--- mopd-2.5.3.macro/common/pf-linux.c 2002-11-17 12:38:31.000000000 +0000 ++++ mopd-2.5.3/common/pf-linux.c 2002-11-17 12:50:38.000000000 +0000 +@@ -178,12 +178,17 @@ int s; + char *interface; + u_char *addr; + { ++ int err; ++ + strncpy(ifr.ifr_name, interface, sizeof (ifr.ifr_name) - 1); + ifr.ifr_name[sizeof(ifr.ifr_name)] = 0; + ifr.ifr_addr.sa_family = AF_INET; +- if (ioctl(s, SIOCGIFHWADDR, &ifr) < 0) { ++ s = socket(AF_INET,SOCK_DGRAM,0); ++ err = ioctl(s, SIOCGIFHWADDR, &ifr); ++ (void) close(s); ++ if (err < 0) { + syslog(LOG_ERR, "pfEthAddr: %s: SIOCGIFHWADDR: %m", interface); +- return(-1); ++ exit(-1); + } + memcpy((char *)addr, ifr.ifr_hwaddr.sa_data, 6); + return(0); --- mopd-2.5.3.orig/patches/mopd-2.5.3-pmax.patch +++ mopd-2.5.3/patches/mopd-2.5.3-pmax.patch @@ -0,0 +1,12 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/common/file.c mopd-2.5.3/common/file.c +--- mopd-2.5.3.macro/common/file.c Fri Aug 16 22:39:41 1996 ++++ mopd-2.5.3/common/file.c Sat Oct 27 22:15:11 2001 +@@ -232,7 +232,7 @@ GetMopFileInfo(fd, load, xfr) + isize = (header[isd+ISD_W_PAGCNT+1]*256 + + header[isd+ISD_W_PAGCNT]) * 512; + load_addr = (header[isd+ISD_V_VPN+1]*256 + +- header[isd+ISD_V_VPN]) * 512; ++ header[isd+ISD_V_VPN]) * 512 | 0x80000000; + xfr_addr = (header[iha+IHA_L_TFRADR1+3]*0x1000000 + + header[iha+IHA_L_TFRADR1+2]*0x10000 + + header[iha+IHA_L_TFRADR1+1]*0x100 + --- mopd-2.5.3.orig/patches/mopd-2.5.3-mcast.patch +++ mopd-2.5.3/patches/mopd-2.5.3-mcast.patch @@ -0,0 +1,430 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/common/device.c mopd-2.5.3/common/device.c +--- mopd-2.5.3.macro/common/device.c Thu Oct 25 22:38:36 2001 ++++ mopd-2.5.3/common/device.c Fri Oct 26 00:37:58 2001 +@@ -162,7 +162,17 @@ deviceOpen(ifname, proto, trans) + p->eaddr[4]= tmp.eaddr[4]; + p->eaddr[5]= tmp.eaddr[5]; + #endif /* DEV_NEW_CONF */ +- ++ ++ switch (proto) { ++ case MOP_K_PROTO_RC: ++ pfAddMulti(-1,p->if_name,&rc_mcst[0]); ++ break; ++ case MOP_K_PROTO_DL: ++ pfAddMulti(-1,p->if_name,&dl_mcst[0]); ++ break; ++ default: ++ break; ++ } + } + } + +diff -up --recursive --new-file mopd-2.5.3.macro/common/pf-linux.c mopd-2.5.3/common/pf-linux.c +--- mopd-2.5.3.macro/common/pf-linux.c Fri Oct 26 00:25:14 2001 ++++ mopd-2.5.3/common/pf-linux.c Fri Oct 26 00:38:29 2001 +@@ -30,8 +30,10 @@ + * + */ + ++#include + #include + #include ++#include + #include + #include + #include +@@ -92,10 +94,29 @@ struct socklist { + + struct ifreq ifr; + extern int errno; +-extern int promisc; ++extern int nomulti; + + struct RDS RDS[NUMRDS]; + ++struct mcastent { ++ char *interface; ++ u_char addr[6]; ++ struct mcastent *next; ++}; ++ ++struct mcastent *mcastlist = NULL; ++int mcastreg = 0; ++ ++void reg_cleanup(); ++void sig_cleanup(); ++ ++volatile sig_atomic_t sig_in_progress = 0; ++void (*hnd_hup)(); ++void (*hnd_int)(); ++void (*hnd_quit)(); ++void (*hnd_segv)(); ++void (*hnd_term)(); ++ + /* + * establish protocol filter + * +@@ -187,6 +208,33 @@ u_char *addr; + } + + /* ++ * add an interface, multicast address pair ++ * to the prune-on-exit list ++ * ++ */ ++ ++void ++pfRegMulti(interface, addr) ++char *interface; ++u_char *addr; ++{ ++ struct mcastent **ml = &mcastlist; ++ ++ while (*ml != NULL) ++ ml = &((*ml)->next); ++ if ((*ml = malloc(sizeof(struct mcastent))) == NULL) { ++ syslog(LOG_ERR, "pfRegMulti: %s: malloc: %m", interface); ++ exit(1); ++ } ++ (*ml)->next = NULL; ++ if (((*ml)->interface = strdup(interface)) == NULL) { ++ syslog(LOG_ERR, "pfRegMulti: %s: strdup: %m", interface); ++ exit(1); ++ } ++ memcpy(&((*ml)->addr), addr, 6); ++} ++ ++/* + * add a multicast address to the interface + * + */ +@@ -200,6 +248,8 @@ u_char *addr; + int sock; + + #ifdef USE_SADDMULTI ++ if (nomulti) ++ return(0); + + strcpy(ifr.ifr_name, interface); + +@@ -211,11 +261,6 @@ u_char *addr; + } + #endif UPFILT + +- +- +- ifr.ifr_addr.sa_family = AF_UNSPEC; +- bcopy((char *)addr, ifr.ifr_addr.sa_data, 6); +- + /* + * open a socket, temporarily, to use for SIOC* ioctls + * +@@ -224,11 +269,24 @@ u_char *addr; + syslog(LOG_ERR, "pfAddMulti: %s: socket: %m", interface); + return(-1); + } +- if (ioctl(sock, SIOCADDMULTI, (caddr_t)&ifr) < 0) { +- syslog(LOG_ERR, "pfAddMulti: %s: SIOCADDMULTI: %m", interface); +- close(sock); ++ if (ioctl(sock, SIOCGIFFLAGS, &ifr) < 0) { ++ syslog(LOG_ERR, "pfAddMulti: %s: SIOCGIFFLAGS: %m", interface); + return(-1); + } ++ if (ifr.ifr_flags & IFF_MULTICAST) { ++ if (!mcastreg) { ++ reg_cleanup(); ++ mcastreg = 1; ++ } ++ ifr.ifr_addr.sa_family = AF_UNSPEC; ++ bcopy((char *)addr, ifr.ifr_addr.sa_data, 6); ++ if (ioctl(sock, SIOCADDMULTI, (caddr_t)&ifr) < 0) { ++ syslog(LOG_ERR, "pfAddMulti: %s: SIOCADDMULTI: %m", interface); ++ close(sock); ++ return(-1); ++ } else ++ pfRegMulti(interface, addr); ++ } + close(sock); + #endif USE_SADDMULTI + return(0); +@@ -251,9 +309,6 @@ u_char *addr; + + strcpy(ifr.ifr_name, interface); + +- ifr.ifr_addr.sa_family = AF_UNSPEC; +- bcopy((char *)addr, ifr.ifr_addr.sa_data, 6); +- + /* + * open a socket, temporarily, to use for SIOC* ioctls + * +@@ -262,11 +317,19 @@ u_char *addr; + syslog(LOG_ERR, "pfDelMulti: %s: socket: %m", interface); + return(-1); + } +- if (ioctl(sock, SIOCDELMULTI, (caddr_t)&ifr) < 0) { +- syslog(LOG_ERR, "pfDelMulti: %s: SIOCDELMULTI: %m", interface); +- close(sock); ++ if (ioctl(sock, SIOCGIFFLAGS, &ifr) < 0) { ++ syslog(LOG_ERR, "pfDelMulti: %s: SIOCGIFFLAGS: %m", interface); + return(-1); + } ++ if (ifr.ifr_flags & IFF_MULTICAST) { ++ ifr.ifr_addr.sa_family = AF_UNSPEC; ++ bcopy((char *)addr, ifr.ifr_addr.sa_data, 6); ++ if (ioctl(sock, SIOCDELMULTI, (caddr_t)&ifr) < 0) { ++ syslog(LOG_ERR, "pfDelMulti: %s: SIOCDELMULTI: %m", interface); ++ close(sock); ++ return(-1); ++ } ++ } + close(sock); + #endif USE_SADDMULTI + +@@ -275,6 +338,26 @@ u_char *addr; + } + + /* ++ * remove all registered multicast memeberships ++ * ++ */ ++ ++void ++pfPruneMulti() ++{ ++ struct mcastent **ml = &mcastlist; ++ ++ if (!mcastreg) ++ return; ++ mcastreg = 0; ++ ++ while (*ml != NULL) { ++ pfDelMulti(-1, (*ml)->interface, (*ml)->addr); ++ ml = &((*ml)->next); ++ } ++} ++ ++/* + * return 1 if ethernet interface capable of multiple opens + * + */ +@@ -353,6 +436,81 @@ u_char *buf; + return(len); + + return(-1); ++} ++ ++/* ++ * remove all registered multicast memeberships ++ * when killed ++ * ++ */ ++ ++void ++sig_cleanup(sig) ++int sig; ++{ ++ void (*hnd)(); ++ if (sig_in_progress) ++ raise(sig); ++ sig_in_progress = 1; ++ ++ pfPruneMulti(); ++ ++ switch(sig) { ++ case SIGHUP: ++ hnd = hnd_hup; ++ break; ++ case SIGINT: ++ hnd = hnd_int; ++ break; ++ case SIGQUIT: ++ hnd = hnd_quit; ++ break; ++ case SIGSEGV: ++ hnd = hnd_segv; ++ break; ++ case SIGTERM: ++ hnd = hnd_term; ++ break; ++ default: ++ hnd = SIG_DFL; ++ break; ++ } ++ signal(sig, hnd); ++ raise(sig); ++} ++ ++/* ++ * register multicast clean-up functions ++ * ++ */ ++ ++void ++reg_cleanup() ++{ ++ if (atexit(pfPruneMulti) < 0) { ++ syslog(LOG_ERR, "pfAddMulti: atexit: %m"); ++ exit(1); ++ } ++ if ((hnd_hup = signal(SIGHUP, sig_cleanup)) == SIG_IGN) { ++ signal(SIGHUP, SIG_IGN); ++ hnd_hup = SIG_DFL; ++ } ++ if ((hnd_int = signal(SIGINT, sig_cleanup)) == SIG_IGN) { ++ signal(SIGINT, SIG_IGN); ++ hnd_int = SIG_DFL; ++ } ++ if ((hnd_quit = signal(SIGQUIT, sig_cleanup)) == SIG_IGN) { ++ signal(SIGQUIT, SIG_IGN); ++ hnd_quit = SIG_DFL; ++ } ++ if ((hnd_segv = signal(SIGSEGV, sig_cleanup)) == SIG_IGN) { ++ signal(SIGSEGV, SIG_IGN); ++ hnd_segv = SIG_DFL; ++ } ++ if ((hnd_term = signal(SIGTERM, sig_cleanup)) == SIG_IGN) { ++ signal(SIGTERM, SIG_IGN); ++ hnd_term = SIG_DFL; ++ } + } + + #endif /* __linux__ */ +diff -up --recursive --new-file mopd-2.5.3.macro/mopchk/mopchk.c mopd-2.5.3/mopchk/mopchk.c +--- mopd-2.5.3.macro/mopchk/mopchk.c Fri Aug 16 22:47:15 1996 ++++ mopd-2.5.3/mopchk/mopchk.c Fri Oct 26 00:37:58 2001 +@@ -60,7 +60,7 @@ void mopProcess __P((struct if_info + + int AllFlag = 0; /* listen on "all" interfaces */ + int VersionFlag = 0; /* Show version */ +-int promisc = 0; /* promisc mode not needed */ ++int nomulti = 1; /* multicast mode not needed */ + char *Program; + char version[]; + +diff -up --recursive --new-file mopd-2.5.3.macro/mopd/mopd.c mopd-2.5.3/mopd/mopd.c +--- mopd-2.5.3.macro/mopd/mopd.c Sun Mar 31 19:21:00 1996 ++++ mopd-2.5.3/mopd/mopd.c Fri Oct 26 00:38:13 2001 +@@ -72,7 +72,7 @@ int ForegroundFlag = 0; /* run in foregr + int VersionFlag = 0; /* print version */ + int Not3Flag = 0; /* Not MOP V3 messages. */ + int Not4Flag = 0; /* Not MOP V4 messages. */ +-int promisc = 1; /* Need promisc mode */ ++int nomulti = 0; /* Need multicast mode */ + char *Program; + + void +@@ -94,7 +94,7 @@ main(argc, argv) + if (*Program == '-') + Program++; + +- while ((c = getopt(argc, argv, "34adfv")) != EOF) ++ while ((c = getopt(argc, argv, "34adfmv")) != EOF) + switch (c) { + case '3': + Not3Flag++; +@@ -111,6 +111,9 @@ main(argc, argv) + case 'f': + ForegroundFlag++; + break; ++ case 'm': ++ nomulti++; ++ break; + case 'v': + VersionFlag++; + break; +@@ -192,8 +195,8 @@ main(argc, argv) + void + Usage() + { +- (void) fprintf(stderr, "usage: %s -a [ -d -f -v ] [ -3 | -4 ]\n",Program); +- (void) fprintf(stderr, " %s [ -d -f -v ] [ -3 | -4 ] interface\n",Program); ++ (void) fprintf(stderr, "usage: %s -a [ -d -f -m -v ] [ -3 | -4 ]\n",Program); ++ (void) fprintf(stderr, " %s [ -d -f -m -v ] [ -3 | -4 ] interface\n",Program); + exit(1); + } + +diff -up --recursive --new-file mopd-2.5.3.macro/mopprobe/mopprobe.c mopd-2.5.3/mopprobe/mopprobe.c +--- mopd-2.5.3.macro/mopprobe/mopprobe.c Sun Aug 11 22:31:43 1996 ++++ mopd-2.5.3/mopprobe/mopprobe.c Fri Oct 26 00:38:14 2001 +@@ -69,7 +69,7 @@ int DebugFlag = 0; /* print debuggi + int Not3Flag = 0; /* Not MOP V3 messages */ + int Not4Flag = 0; /* Not MOP V4 messages */ + int oflag = 0; /* print only once */ +-int promisc = 1; /* Need promisc mode */ ++int nomulti = 0; /* Need multicast mode */ + char *Program; + + void +@@ -93,7 +93,7 @@ main(argc, argv) + openlog(Program, LOG_PID | LOG_CONS, LOG_DAEMON); + + opterr = 0; +- while ((op = getopt(argc, argv, "ado")) != EOF) { ++ while ((op = getopt(argc, argv, "admo")) != EOF) { + switch (op) { + case '3': + Not3Flag++; +@@ -107,6 +107,9 @@ main(argc, argv) + case 'd': + DebugFlag++; + break; ++ case 'm': ++ nomulti++; ++ break; + case 'o': + oflag++; + break; +@@ -134,8 +137,8 @@ main(argc, argv) + void + Usage() + { +- (void) fprintf(stderr, "usage: %s -a [ -3 | -4 ]\n",Program); +- (void) fprintf(stderr, " %s [ -3 | -4 ] interface\n",Program); ++ (void) fprintf(stderr, "usage: %s -a [ -m ] [ -3 | -4 ]\n",Program); ++ (void) fprintf(stderr, " %s [ -m ] [ -3 | -4 ] interface\n",Program); + exit(1); + } + +diff -up --recursive --new-file mopd-2.5.3.macro/moptrace/moptrace.c mopd-2.5.3/moptrace/moptrace.c +--- mopd-2.5.3.macro/moptrace/moptrace.c Wed Aug 7 22:48:04 1996 ++++ mopd-2.5.3/moptrace/moptrace.c Fri Oct 26 00:38:16 2001 +@@ -68,7 +68,7 @@ int AllFlag = 0; /* listen on "all" + int DebugFlag = 0; /* print debugging messages */ + int Not3Flag = 0; /* Ignore MOP V3 messages */ + int Not4Flag = 0; /* Ignore MOP V4 messages */ +-int promisc = 1; /* Need promisc mode */ ++int nomulti = 0; /* Need multicast mode */ + char *Program; + + void +@@ -93,7 +93,7 @@ main(argc, argv) + openlog(Program, LOG_PID | LOG_CONS, LOG_DAEMON); + + opterr = 0; +- while ((op = getopt(argc, argv, "34ad")) != EOF) { ++ while ((op = getopt(argc, argv, "34adm")) != EOF) { + switch (op) { + case '3': + Not3Flag++; +@@ -107,6 +107,9 @@ main(argc, argv) + case 'd': + DebugFlag++; + break; ++ case 'm': ++ nomulti++; ++ break; + default: + Usage(); + /* NOTREACHED */ +@@ -131,8 +134,8 @@ main(argc, argv) + void + Usage() + { +- (void) fprintf(stderr, "usage: %s -a [ -d ] [ -3 | -4 ]\n",Program); +- (void) fprintf(stderr, " %s [ -d ] [ -3 | -4 ] interface\n", ++ (void) fprintf(stderr, "usage: %s -a [ -d -m ] [ -3 | -4 ]\n",Program); ++ (void) fprintf(stderr, " %s [ -d -m ] [ -3 | -4 ] interface\n", + Program); + exit(1); + } --- mopd-2.5.3.orig/patches/mopd-2.5.3-length.patch +++ mopd-2.5.3/patches/mopd-2.5.3-length.patch @@ -0,0 +1,31 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/mopd/process.c mopd-2.5.3/mopd/process.c +--- mopd-2.5.3.macro/mopd/process.c 2001-10-27 19:14:58.000000000 +0000 ++++ mopd-2.5.3/mopd/process.c 2002-11-17 13:00:56.000000000 +0000 +@@ -47,7 +47,7 @@ static char rcsid[] = "$Id: process.c,v + + #define SEND_REAL_HOSTNAME + +-#define MAX_ETH_PAYLOAD 1492 ++#define MAX_ETH_PAYLOAD 1500 + + extern u_char buf[]; + extern int DebugFlag; +@@ -273,11 +273,15 @@ mopStartLoad(dst, src, dl_rpr, trans) + if (dllist[slot].dl_bsz >= MAX_ETH_PAYLOAD) + dllist[slot].dl_bsz = MAX_ETH_PAYLOAD; + if (dllist[slot].dl_bsz == 1030) /* VS/uVAX 2000 needs this */ +- dllist[slot].dl_bsz = 1000; ++ dllist[slot].dl_bsz = 1010; + if (dllist[slot].dl_bsz == 0) /* Needed by "big" VAXen */ +- dllist[slot].dl_bsz = MAX_ETH_PAYLOAD; ++ dllist[slot].dl_bsz = MOP_K_DLBSZ_DEFAULT; + if (trans == TRANS_8023) +- dllist[slot].dl_bsz = dllist[slot].dl_bsz - 8; ++ if (dllist[slot].dl_bsz > MAX_ETH_PAYLOAD - 8) ++ dllist[slot].dl_bsz = MAX_ETH_PAYLOAD - 8; ++ if (trans == TRANS_ETHER) ++ dllist[slot].dl_bsz -= 2; /* For packet length */ ++ dllist[slot].dl_bsz -= 6; /* For Memory Load header */ + + index = 0; + mopPutHeader(pkt, &index, dst, src, ptype, trans); --- mopd-2.5.3.orig/patches/mopd-2.5.3-pf.patch +++ mopd-2.5.3/patches/mopd-2.5.3-pf.patch @@ -0,0 +1,22 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/common/pf.c mopd-2.5.3/common/pf.c +--- mopd-2.5.3.macro/common/pf.c 1996-08-06 14:20:27.000000000 +0000 ++++ mopd-2.5.3/common/pf.c 2002-11-17 15:22:31.000000000 +0000 +@@ -65,7 +65,7 @@ static char rcsid[] = "$Id: pf.c,v 1.16 + */ + + extern int errno; +-extern int promisc; ++extern int nomulti; + + /* + * Return information to device.c how to open device. +@@ -144,7 +144,8 @@ pfInit(interface, mode, protocol, typ) + syslog(LOG_ERR,"pfInit: %s is not ethernet", device); + return(-1); + } +- if (promisc) { ++ if (!nomulti) { ++ syslog(LOG_WARNING,"pfInit: using promiscuous mode for multicast reception"); + /* Set promiscuous mode. */ + if (ioctl(fd, BIOCPROMISC, (caddr_t)0) < 0) { + syslog(LOG_ERR,"pfInit: BIOCPROMISC: %m"); --- mopd-2.5.3.orig/patches/mopd-2.5.3-syslog.patch +++ mopd-2.5.3/patches/mopd-2.5.3-syslog.patch @@ -0,0 +1,66 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/common/pf-linux.c mopd-2.5.3/common/pf-linux.c +--- mopd-2.5.3.macro/common/pf-linux.c Fri Oct 26 00:05:23 2001 ++++ mopd-2.5.3/common/pf-linux.c Fri Oct 26 00:25:14 2001 +@@ -31,6 +31,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -133,7 +134,7 @@ int typ, mode; + + prot = ((typ == 2) ? htons(ETH_P_802_2) : htons(protocol)); + if ((s = socket(AF_INET, SOCK_PACKET, prot)) < 0) { +- perror(interface); ++ syslog(LOG_ERR, "pfInit: %s: socket: %m", interface); + return(-1); + } + if (s >= 32) { +@@ -178,7 +179,7 @@ u_char *addr; + strcpy(ifr.ifr_name, interface); + ifr.ifr_addr.sa_family = AF_INET; + if (ioctl(s, SIOCGIFHWADDR, &ifr) < 0) { +- perror("SIOCGIFHWADDR"); ++ syslog(LOG_ERR, "pfEthAddr: %s: SIOCGIFHWADDR: %m", interface); + return(-1); + } + memcpy((char *)addr, ifr.ifr_hwaddr.sa_data, 6); +@@ -205,7 +206,7 @@ u_char *addr; + #ifdef UPFILT + /* get the real interface name */ + if (ioctl(s, EIOCIFNAME, &ifr) < 0) { +- perror("EIOCIFNAME"); ++ syslog(LOG_ERR, "pfAddMulti: %s: EIOCIFNAME: %m", interface); + return(-1); + } + #endif UPFILT +@@ -220,11 +221,11 @@ u_char *addr; + * + */ + if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { +- perror("socket()"); ++ syslog(LOG_ERR, "pfAddMulti: %s: socket: %m", interface); + return(-1); + } + if (ioctl(sock, SIOCADDMULTI, (caddr_t)&ifr) < 0) { +- perror("SIOCADDMULTI"); ++ syslog(LOG_ERR, "pfAddMulti: %s: SIOCADDMULTI: %m", interface); + close(sock); + return(-1); + } +@@ -258,11 +259,11 @@ u_char *addr; + * + */ + if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { +- perror("socket()"); ++ syslog(LOG_ERR, "pfDelMulti: %s: socket: %m", interface); + return(-1); + } + if (ioctl(sock, SIOCDELMULTI, (caddr_t)&ifr) < 0) { +- perror("SIOCDELMULTI"); ++ syslog(LOG_ERR, "pfDelMulti: %s: SIOCDELMULTI: %m", interface); + close(sock); + return(-1); + } --- mopd-2.5.3.orig/patches/mopd-2.5.3-freebsd-put.patch +++ mopd-2.5.3/patches/mopd-2.5.3-freebsd-put.patch @@ -0,0 +1,51 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/common/put.c mopd-2.5.3/common/put.c +--- mopd-2.5.3.macro/common/put.c 2002-11-17 13:05:38.000000000 +0000 ++++ mopd-2.5.3/common/put.c 2002-11-17 15:37:16.000000000 +0000 +@@ -34,6 +34,9 @@ static char rcsid[] = "$Id: put.c,v 1.5 + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif + #include "mopdef.h" + + void +@@ -147,10 +150,7 @@ mopPutHeader(pkt, index, dst, src, proto + mopPutChar (pkt, index, 0x00); + mopPutChar (pkt, index, 0x2b); + } +-#if !defined(__FreeBSD__) +- mopPutChar(pkt, index, (proto / 256)); +- mopPutChar(pkt, index, (proto % 256)); +-#else ++#if defined(__FreeBSD__) && __FreeBSD_version < 220000 + if (trans == TRANS_ETHER) { + mopPutChar(pkt, index, (proto % 256)); + mopPutChar(pkt, index, (proto / 256)); +@@ -158,6 +158,9 @@ mopPutHeader(pkt, index, dst, src, proto + mopPutChar(pkt, index, (proto / 256)); + mopPutChar(pkt, index, (proto % 256)); + } ++#else ++ mopPutChar(pkt, index, (proto / 256)); ++ mopPutChar(pkt, index, (proto % 256)); + #endif + if (trans != TRANS_8023) + mopPutShort(pkt, index, 0); +@@ -180,12 +183,12 @@ mopPutLength(pkt, trans, len) + break; + case TRANS_8023: + index = 12; +-#if !defined(__FreeBSD__) +- mopPutChar(pkt, &index, ((len - 14) / 256)); ++#if defined(__FreeBSD__) && __FreeBSD_version < 220000 + mopPutChar(pkt, &index, ((len - 14) % 256)); ++ mopPutChar(pkt, &index, ((len - 14) / 256)); + #else +- mopPutChar(pkt, &index, ((len - 14) % 256)); + mopPutChar(pkt, &index, ((len - 14) / 256)); ++ mopPutChar(pkt, &index, ((len - 14) % 256)); + #endif + break; + case TRANS_FDDI_8021H: --- mopd-2.5.3.orig/patches/INDEX +++ mopd-2.5.3/patches/INDEX @@ -0,0 +1,23 @@ +The following patches were downloaded from +http://source.rfc822.org/pub/mirror/ftp.ds2.pg.gda.pl/pub/macro/mopd/ + +mopd-2.5.3-linux.patch +mopd-2.5.3-mcast.patch +mopd-2.5.3-aout.patch mopd-2.5.3-pf.patch +mopd-2.5.3-bind.patch mopd-2.5.3-pmax.patch +mopd-2.5.3-eaddr.patch mopd-2.5.3-proto.patch +mopd-2.5.3-elf.patch mopd-2.5.3-select.patch +mopd-2.5.3-fddi.patch mopd-2.5.3-syslog.patch +mopd-2.5.3-freebsd-put.patch mopd-2.5.3-vax-linux.patch +mopd-2.5.3-length.patch + +The rest were created by patrick@debian.org: + +253patched-254.patch - adds back in the changes from 2.5.3 to 2.5.4 + to the new, patched, codebase. + +debian254.patch - is the code patches for the Debian 2.5.4-7 + release that apply to the code after all the previous patches + +alpha.patch - define NOAOUT for alpha builds. May be needed for other archs + too --- mopd-2.5.3.orig/patches/mopd-2.5.3-aout.patch +++ mopd-2.5.3/patches/mopd-2.5.3-aout.patch @@ -0,0 +1,114 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/common/file.c mopd-2.5.3/common/file.c +--- mopd-2.5.3.macro/common/file.c Fri Aug 16 22:39:41 1996 ++++ mopd-2.5.3/common/file.c Fri Oct 26 00:22:07 2001 +@@ -45,6 +45,28 @@ static char rcsid[] = "$Id: file.c,v 1.4 + #if defined(__FreeBSD__) + #include + #endif ++#if defined(__linux__) ++#include ++/* ++ * Linux provides appropriate structures but access macros ++ * have different names and BSD machine ids are missing. ++ */ ++#define N_GETMID N_MACHTYPE ++#define N_GETMAGIC N_MAGIC ++#define MID_SUN010 M_68010 /* sun 68010/68020 binary */ ++#define MID_SUN020 M_68020 /* sun 68020-only binary */ ++#define MID_PC386 M_386 /* 386 PC binary */ ++#define MID_I386 134 /* i386 binary */ ++#define MID_M68K 135 /* m68k binary with 8K page sizes */ ++#define MID_M68K4K 136 /* m68k binary with 4K page sizes */ ++#define MID_NS32532 137 /* ns32532 binary */ ++#define MID_SPARC 138 /* sparc binary */ ++#define MID_PMAX 139 /* pmax (little-endian MIPS) binary */ ++#define MID_VAX 140 /* vax binary */ ++#define MID_ALPHA 141 /* Alpha binary */ ++#define MID_MIPS 142 /* big-endian MIPS binary */ ++#define MID_ARM6 143 /* ARM6 binary */ ++#endif + #if !defined(MID_VAX) + #define MID_VAX 140 + #endif +@@ -297,56 +319,56 @@ getMID(old_mid,new_mid) + + switch (new_mid) { + case MID_I386: +- mid = MID_I386; +- break; ++ case MID_SPARC: ++#ifdef MID_SUN010 ++ case MID_SUN010: ++#endif ++#ifdef MID_SUN020 ++ case MID_SUN020: ++#endif ++#ifdef MID_PC386 ++ case MID_PC386: ++#endif + #ifdef MID_M68K + case MID_M68K: +- mid = MID_M68K; +- break; + #endif + #ifdef MID_M68K4K + case MID_M68K4K: +- mid = MID_M68K4K; +- break; + #endif + #ifdef MID_NS32532 + case MID_NS32532: +- mid = MID_NS32532; +- break; + #endif +-/*###323 [cc] for each function it appears in.)%%%*/ +-/*###323 [cc] (Each undeclared identifier is reported only once%%%*/ +-/*###323 [cc] `MID_SPARC' undeclared (first use this function)%%%*/ +- case MID_SPARC: +- mid = MID_SPARC; +- break; + #ifdef MID_PMAX + case MID_PMAX: +- mid = MID_PMAX; +- break; + #endif + #ifdef MID_VAX + case MID_VAX: +- mid = MID_VAX; +- break; + #endif + #ifdef MID_ALPHA + case MID_ALPHA: +- mid = MID_ALPHA; +- break; + #endif + #ifdef MID_MIPS + case MID_MIPS: +- mid = MID_MIPS; +- break; + #endif + #ifdef MID_ARM6 + case MID_ARM6: +- mid = MID_ARM6; +- break; + #endif ++#ifdef M_SPARC ++ case M_SPARC: ++#endif ++#ifdef M_ARM ++ case M_ARM: ++#endif ++#ifdef M_MIPS1 ++ case M_MIPS1: ++#endif ++#ifdef M_MIPS2 ++ case M_MIPS2: ++#endif ++ mid = new_mid; ++ break; + default: +-/*###352 [cc] syntax error before `}'%%%*/ ++ ; + } + + return(mid); --- mopd-2.5.3.orig/patches/debian254.patch +++ mopd-2.5.3/patches/debian254.patch @@ -0,0 +1,122 @@ +--- mopd-2.5.4.orig/mopd/process.c ++++ mopd-2.5.4/mopd/process.c +@@ -30,6 +30,7 @@ + */ + + #include ++#include + #ifndef lint + static char rcsid[]="$NetBSD: process.c,v 1.7 2000/06/27 18:57:41 ragge Exp $"; + #endif +@@ -461,6 +462,7 @@ + int i,nfd,iindex; + struct dllist dl,*dl_rpr; + u_char rpr_pgty,load; ++ char *ptr; + + if ((DebugFlag == DEBUG_ONELINE)) { + mopPrintOneline(stdout, pkt, trans); +@@ -532,10 +534,22 @@ + memmove((char *)(dl_rpr->eaddr), (char *)src, 6); + mopProcessInfo(pkt,index,moplen,dl_rpr,trans); + +- sprintf(filename,"%s/%s.SYS", MOP_FILE_PATH, pfile); ++ ptr = pfile + strlen (pfile) - strlen(".sys"); ++ if ( ! strstr(ptr, ".SYS") && ! strstr(ptr, ".sys") ) { ++ sprintf(filename,"%s/%s.SYS", MOP_FILE_PATH, pfile); ++ } ++ else { ++ sprintf(filename,"%s/%s", MOP_FILE_PATH, pfile); ++ } ++ + if ((mopCmpEAddr(dst,dl_mcst) == 0)) { + if ((nfd = open(filename, O_RDONLY, 0)) != -1) { + close(nfd); ++ printf("My address is " ++ "%02x:%02x:%02x:%02x:%02x:%02x\n", ++ ii->eaddr[0], ii->eaddr[1], ++ ii->eaddr[2], ii->eaddr[3], ++ ii->eaddr[4], ii->eaddr[5]); + mopSendASV(src, ii->eaddr, ii, trans); + sprintf(line, + "%x:%x:%x:%x:%x:%x (%d) Do you have %s? (Yes)", +--- mopd-2.5.4.orig/Makefile ++++ mopd-2.5.4/Makefile +@@ -9,6 +9,12 @@ + (cd $$dir; make CFLAGS=$(CFLAGS) ) ; \ + done + ++install: ++ install -d $(DESTDIR)/usr/sbin/ ++ install -m0755 mopd/mopd $(DESTDIR)/usr/sbin/ ++ install -m0755 mopchk/mopchk $(DESTDIR)/usr/sbin/ ++ install -m0755 mopprobe/mopprobe $(DESTDIR)/usr/sbin/ ++ install -m0755 moptrace/moptrace $(DESTDIR)/usr/sbin/ + + clean: + for dir in ${SUBDIRS} ; \ +--- mopd-2.5.4.orig/common/pf.h ++++ mopd-2.5.4/common/pf.h +@@ -38,7 +38,7 @@ + __BEGIN_DECLS + int pfTrans __P((char *)); + int pfInit __P((char *, int, u_short, int)); +-int pfEthAddr __P((int, u_char *)); ++int pfEthAddr __P((int, u_char *, u_char *)); + int pfAddMulti __P((int, char *, char *)); + int pfDelMulti __P((int, char *, char *)); + int pfRead __P((int, u_char *, int)); +--- mopd-2.5.4.orig/common/pf-linux2.c ++++ mopd-2.5.4/common/pf-linux2.c +@@ -14,7 +14,7 @@ + * Supports: + * Linux SOCK_PACKET + * +- * $Author: bitblt $ ++ * $Author: davidw $ + * $Revision: 1.2 $ + * + * +--- mopd-2.5.4.orig/common/device.c ++++ mopd-2.5.4/common/device.c +@@ -104,6 +104,7 @@ + int trans; + { + struct if_info *p, tmp; ++ int s; + + strcpy(tmp.if_name,ifname); + tmp.iopen = pfInit; +@@ -140,14 +141,21 @@ + p->fd = tmp.fd; + + #ifdef DEV_NEW_CONF ++#error Does not work + deviceEthAddr(p->if_name,&p->eaddr[0]); + #else ++ s = socket(AF_INET, SOCK_DGRAM, 0); ++ pfEthAddr(s, p->if_name, &p->eaddr[0]); ++ (void) close(s); ++ ++#if 0 + p->eaddr[0]= tmp.eaddr[0]; + p->eaddr[1]= tmp.eaddr[1]; + p->eaddr[2]= tmp.eaddr[2]; + p->eaddr[3]= tmp.eaddr[3]; + p->eaddr[4]= tmp.eaddr[4]; + p->eaddr[5]= tmp.eaddr[5]; ++#endif + #endif /* DEV_NEW_CONF */ + + } +--- mopd-2.5.4.orig/common/loop-linux2.c ++++ mopd-2.5.4/common/loop-linux2.c +@@ -28,7 +28,7 @@ + */ + + #ifndef LINT +-static char rcsid[] = "$Id: loop-linux2.c,v 1.1 1999/03/27 14:31:22 maja Exp $"; ++static char rcsid[] = "$Id: loop-linux2.c,v 1.2 2001/03/07 02:36:19 davidw Exp $"; + #endif + + #include --- mopd-2.5.3.orig/patches/gcc-3.4-fix.patch +++ mopd-2.5.3/patches/gcc-3.4-fix.patch @@ -0,0 +1,20 @@ +--- file.c 2004-09-05 11:29:13.960061000 +0200 ++++ buildtree/common/file.c 2004-09-05 11:30:30.087488417 +0200 +@@ -413,7 +413,7 @@ + mid = new_mid; + break; + default: +- ; ++ break; + } + + return(mid); +@@ -584,7 +584,7 @@ + ex.a_trsize= mopFileGetBX((u_char *)&ex_swap, 24, 4); + ex.a_drsize= mopFileGetBX((u_char *)&ex_swap, 28, 4); + break; +- default: ++ default: break; + /*###525 [cc] syntax error before `}'%%%*/ + } + --- mopd-2.5.3.orig/patches/mopd-2.5.3-bind.patch +++ mopd-2.5.3/patches/mopd-2.5.3-bind.patch @@ -0,0 +1,15 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/common/pf-linux.c mopd-2.5.3/common/pf-linux.c +--- mopd-2.5.3.macro/common/pf-linux.c 2002-11-17 12:37:22.000000000 +0000 ++++ mopd-2.5.3/common/pf-linux.c 2002-11-17 12:46:41.000000000 +0000 +@@ -162,6 +162,11 @@ int typ, mode; + strncpy(socklist[s].sa.sa_data, interface, sizeof(socklist[s].sa.sa_data)); + socklist[s].iflen = strlen(interface); + ++ if (bind(s, &socklist[s].sa, sizeof(socklist[s].sa)) < 0) { ++ syslog(LOG_ERR, "pfInit: %s: bind: %m", interface); ++ exit(1); ++ } ++ + return(s); + } + --- mopd-2.5.3.orig/patches/mopd-2.5.3-select.patch +++ mopd-2.5.3/patches/mopd-2.5.3-select.patch @@ -0,0 +1,14 @@ +diff -up --recursive --new-file mopd-2.5.3.macro/common/loop-bsd.c mopd-2.5.3/common/loop-bsd.c +--- mopd-2.5.3.macro/common/loop-bsd.c Fri Aug 16 22:41:43 1996 ++++ mopd-2.5.3/common/loop-bsd.c Fri Oct 26 00:14:37 2001 +@@ -135,8 +135,8 @@ Loop() + } + while (1) { + listeners = fds; +- if (select(maxfd + 1, &listeners, (struct fd_set *) 0, +- (struct fd_set *) 0, (struct timeval *) 0) < 0) { ++ if (select(maxfd + 1, &listeners, (fd_set *) 0, ++ (fd_set *) 0, (struct timeval *) 0) < 0) { + syslog(LOG_ERR, "select: %m"); + exit(0); + } --- mopd-2.5.3.orig/mopa.out/mopa.out.1 +++ mopd-2.5.3/mopa.out/mopa.out.1 @@ -56,4 +56,3 @@ .Xr moptrace 1 .Sh AUTHORS Lloyd Parkes. - --- mopd-2.5.3.orig/mopd/mopd.8 +++ mopd-2.5.3/mopd/mopd.8 @@ -55,10 +55,10 @@ .Nm mopd checks if the requested file exists in .Pa /tftpboot/mop , -the filename is normaly uppercase and with an extension of +the filename is normally uppercase and with an extension of .Pa .SYS . -If the filename isn't given, the ethernet address of the target is used as -filename, e.g. +If the filename isn't given, the ethernet address (in lower case, apart from +the .SYS) of the target is used as the filename, e.g. .Pa 08002b09f4de.SYS and it might be a soft link to another file. .Pp --- mopd-2.5.3.orig/debian/postrm.debhelper +++ mopd-2.5.3/debian/postrm.debhelper @@ -0,0 +1,11 @@ +# Automatically added by dh_installdebconf +if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_purge +fi +# End automatically added section +# Automatically added by dh_installinit +if [ "$1" = "purge" ] ; then + update-rc.d mopd remove >/dev/null || exit $? +fi +# End automatically added section --- mopd-2.5.3.orig/debian/manpages +++ mopd-2.5.3/debian/manpages @@ -0,0 +1,4 @@ +buildtree/mopd/mopd.8 +buildtree/moptrace/moptrace.1 +buildtree/mopchk/mopchk.1 +buildtree/mopprobe/mopprobe.1 --- mopd-2.5.3.orig/debian/postinst.debhelper +++ mopd-2.5.3/debian/postinst.debhelper @@ -0,0 +1,10 @@ +# Automatically added by dh_installinit +if [ -x "/etc/init.d/mopd" ]; then + update-rc.d mopd defaults >/dev/null + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d mopd start || exit $? + else + /etc/init.d/mopd start || exit $? + fi +fi +# End automatically added section --- mopd-2.5.3.orig/debian/postinst +++ mopd-2.5.3/debian/postinst @@ -0,0 +1,27 @@ +#!/bin/sh -e + +CONF_FILE=/etc/mopd.conf + +# Source debconf library. +. /usr/share/debconf/confmodule + +db_get mopd/interface +if [ ! -e "$CONF_FILE" ]; then + cat > $CONF_FILE <> $CONF_FILE +else + sed -e "s/^[^#]*INTERFACE=.*/INTERFACE=$RET/" < $CONF_FILE > ${CONF_FILE}.new + mv -f ${CONF_FILE}.new $CONF_FILE + +fi +#DEBHELPER# + --- mopd-2.5.3.orig/debian/compat +++ mopd-2.5.3/debian/compat @@ -0,0 +1 @@ +5 --- mopd-2.5.3.orig/debian/templates +++ mopd-2.5.3/debian/templates @@ -0,0 +1,35 @@ +# These templates have been reviewed by the debian-l10n-english +# team +# +# If modifications/additions/rewording are needed, please ask +# debian-l10n-english@lists.debian.org for advice. +# +# Even minor modifications require translation updates and such +# changes should be coordinated with translators and reviewers. + +Template: mopd/other_interface +Type: string +_Description: Interface for mopd: + Please enter the interface you would like to run mopd on. + +Template: mopd/bad_interface +Type: error +_Description: Nonexistent interface for mopd + The MOP daemon configuration already exists as /etc/mopd.conf. + . + However, that configuration file specifies '${cur_iface}' as listening + interface, which currently does not exist. + . + You should resolve this + situation by manually editing the configuration file appropriately. Until + this issue is resolved it is likely that mopd will not function correctly. + +Template: mopd/interface +Type: select +#flag:translate!:3 +__Choices: other, all, ${choices} +_Description: Interface for mopd: + Please choose the interface you would like to run mopd on, or select + 'other' if the interface is not in this list. + . + If you want mopd to listen on all interfaces, please choose 'all'. --- mopd-2.5.3.orig/debian/prerm.debhelper +++ mopd-2.5.3/debian/prerm.debhelper @@ -0,0 +1,9 @@ +# Automatically added by dh_installinit +if [ -x "/etc/init.d/mopd" ]; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d mopd stop || exit $? + else + /etc/init.d/mopd stop || exit $? + fi +fi +# End automatically added section --- mopd-2.5.3.orig/debian/control +++ mopd-2.5.3/debian/control @@ -0,0 +1,15 @@ +Source: mopd +Section: net +Priority: extra +Maintainer: Chrissie Caulfield +Build-Depends: debhelper (>= 4.1.16), libelfg0-dev, cpio +Standards-Version: 3.5.6.0 + +Package: mopd +Architecture: any +Depends: ${shlibs:Depends}, debconf | debconf-2.0 +Description: Maintenance Operations Protocol loader daemon + This daemon services load requests on one or all Ethernet interfaces using + the DEC Maintenance Operations Protocol. Normally, a filename (uppercase + and ending in .SYS) is included in the load request; this is looked for in + /tftpboot/mop by default and may be used as a netboot image. --- mopd-2.5.3.orig/debian/README.Debian +++ mopd-2.5.3/debian/README.Debian @@ -0,0 +1,17 @@ +As of 1:2.5.3-1 this is a new source build so please treat carefully! + +I have taken the 2.5.3 sources and all the patches from +http://source.rfc822.org/pub/mirror/ftp.ds2.pg.gda.pl/pub/macro/mopd/ +then manually applied the (some hand-editted) patches to try to +incorporate the 2.5.3->2.5.4 code changes, then added David Kimdon's +patches on top of that. + +The code works for me (naturally), it boots a DECserver 200, +a DECstation 2100, a DECstation 5000/25, a VAXstation 400VLC +and a MicroVAX 3100/95. + +A lot of work has gone into this new package but I don't want praise, +I want BUG REPORTS !! + +Patrick Caulfield + --- mopd-2.5.3.orig/debian/changelog +++ mopd-2.5.3/debian/changelog @@ -0,0 +1,223 @@ +mopd (1:2.5.3-21) unstable; urgency=low + + * Add po-debconf translations for Japanese + Closes: #603653 + + -- Chrissie Caulfield Fri, 3 Dec 2010 10:04:12 +0000 + +mopd (1:2.5.3-20) unstable; urgency=low + + * Add po-debconf translations for Danish + Closes: #589858 + * Fix some lintian errors + + -- Christine Caulfield Fri, 23 Jul 2010 09:20:06 +0100 + +mopd (1:2.5.3-19) unstable; urgency=low + + * Look for boot files in FHS-compliant /srv/tftp/mop. The old directory will + also be searched, for backwards compatibility. + Closes: #537651 + + -- Christine Caulfield Sun, 26 Jul 2009 11:22:12 +0100 + +mopd (1:2.5.3-18) unstable; urgency=low + + * Build-Depend on cpio + Closes: #536939 + + -- Christine Caulfield Sun, 19 Jul 2009 09:21:04 +0100 + +mopd (1:2.5.3-17) unstable; urgency=low + + * Incude binaries in the package! Oops. + Closes: #526367 + + -- Christine Caulfield Mon, 04 May 2009 13:04:43 +0100 + +mopd (1:2.5.3-16) unstable; urgency=low + + * Debconf templates and debian/control reviewed by the debian-l10n- + english team as part of the Smith review project. Closes: #512008 + * [Debconf translation updates] + * Bokmål, Norwegian. Closes: #512680 + * Basque. Closes: #512744 + * Vietnamese. Closes: #512963 + * Portuguese. Closes: #513277 + * Italian. Closes: #513364 + * Russian. Closes: #513401 + * German. Closes: #513507 + * Swedish. Closes: #513658 + * Spanish. Closes: #513693 + * Czech. Closes: #513711 + * Debconf templates and debian/control reviewed by the debian-l10n- + english team as part of the Smith review project. Closes: #514094 + * [Debconf translation updates] + * French. Closes: #514094 + * Slovak. Closes: #514389 + + -- Christine Caulfield Wed, 04 Feb 2009 18:24:56 +0100 + +mopd (1:2.5.3-14) unstable; urgency=low + + * Add Spanish debconf template translation + Closes: #510335 + * Fix some lintian-reported problems + + -- Christine Caulfield Thu, 01 Jan 2009 11:13:12 +0000 + +mopd (1:2.5.3-13) unstable; urgency=low + + * Add LSB info to init script + Closes: #469705 + + -- Christine Caulfield Sun, 09 Mar 2008 14:02:04 +0000 + +mopd (1:2.5.3-12) unstable; urgency=low + + * Add Dutch debconf templates translation + Closes: #450982 + + -- Patrick Caulfield Wed, 14 Nov 2007 13:45:53 +0000 + +mopd (1:2.5.3-11) unstable; urgency=low + + * Add Portugese debconf templates translation + Closes: #419179 + + -- Patrick Caulfield Sat, 14 Apr 2007 14:08:48 +0100 + +mopd (1:2.5.3-10) unstable; urgency=low + + * Add Swedish debconf templates translation. + Closes: 336690 + + -- Patrick Caulfield Mon, 7 Nov 2005 16:11:43 +0000 + +mopd (1:2.5.3-9) unstable; urgency=low + + * Add alternative dependancy on debconf-2.0 + + -- Patrick Caulfield Tue, 27 Sep 2005 08:46:04 +0100 + +mopd (1:2.5.3-8) unstable; urgency=low + + * Add Vietnamese translation of debconf messages + Closes: #312967 + + -- Patrick Caulfield Tue, 14 Jun 2005 10:30:57 +0100 + +mopd (1:2.5.3-7) unstable; urgency=low + + * Add Czech translation of debconf messages + Closes: #298209 + + -- Patrick Caulfield Sun, 6 Mar 2005 14:20:50 +0000 + +mopd (1:2.5.3-6) unstable; urgency=low + + * Fix compilation problems with gcc 3.4 (thanks to Andreas Jochens) + Closes: #270068 + + -- Patrick Caulfield Mon, 13 Sep 2004 09:50:08 +0100 + +mopd (1:2.5.3-5) unstable; urgency=low + + * Remove some compilation warnings. + * Catalan debconf translation + Closes: #236656 + + -- Patrick Caulfield Sun, 14 Mar 2004 10:42:39 +0000 + +mopd (1:2.5.3-4) unstable; urgency=low + + * Update fr.po file I forgot last time. + corrects translator's name. + + -- Patrick Caulfield Fri, 8 Aug 2003 10:23:55 +0100 + +mopd (1:2.5.3-3) unstable; urgency=low + + * Use gettext-based debconf templates. + Closes: #201285 + * Fix comma in debconf template + Closes: #201246 + * Thanks to Christian Perrier for both those. + + -- Patrick Caulfield Tue, 5 Aug 2003 09:36:40 +0100 + +mopd (1:2.5.3-2) unstable; urgency=low + + * define NOAOUT on IA64 so it compiles. + + -- Patrick Caulfield Tue, 3 Jun 2003 14:54:14 +0100 + +mopd (1:2.5.3-1) unstable; urgency=low + + * This is a major change, please see README.Debian for details + * Includes all of the DECstation patches, + Closes: #162703 + + -- Patrick Caulfield Fri, 9 May 2003 13:37:31 +0100 + +mopd (2.5.4-9) unstable; urgency=low + + * New maintainer done properly this time. + + -- Patrick Caulfield Wed, 5 Mar 2003 09:26:05 +0000 + +mopd (2.5.4-8) unstable; urgency=low + + * New Maintainer + Closes: #157912 + + -- Patrick Caulfield Wed, 5 Mar 2003 08:25:42 +0000 + +mopd (2.5.4-7) unstable; urgency=low + + * only merge templates at build time. (closes: #139918) + * cleanup to config and init scripts to handle obscure + cases better + + -- David Kimdon Fri, 23 Aug 2002 21:52:12 -0700 + +mopd (2.5.4-6) unstable; urgency=low + + * add French template thanks to laurb (closes: #139918) + * change my name (marriage) + * update standards version + * remove cruft from debian/rules + + -- David Kimdon Thu, 22 Aug 2002 21:02:54 -0700 + +mopd (2.5.4-5) unstable; urgency=low + + * German template translation contributed by: + "Sebastian Feltel" (closes: #96336) + + -- David Whedon Sat, 5 May 2001 22:05:05 -0700 + +mopd (2.5.4-4) unstable; urgency=low + + * fix build failure on alpha (closes: #94856) + + -- David Whedon Mon, 23 Apr 2001 11:15:55 -0700 + +mopd (2.5.4-3) unstable; urgency=low + + * applied patch that was on the code Josh found. Without this + the MOP server gets it's own hardware address wrong. + + -- David Whedon Fri, 16 Mar 2001 13:54:50 -0800 + +mopd (2.5.4-2) unstable; urgency=low + + * use debconf to configure the interface. + + -- David Whedon Fri, 16 Mar 2001 12:07:51 -0800 + +mopd (2.5.4-1) unstable; urgency=low + + * Initial Release. + + -- David Whedon Tue, 6 Mar 2001 10:46:15 -0800 --- mopd-2.5.3.orig/debian/postrm +++ mopd-2.5.3/debian/postrm @@ -0,0 +1,7 @@ +#!/bin/sh -e + +if [ "$1" = "purge" ] ; then + rm -f /etc/mopd.conf +fi + +#DEBHELPER# --- mopd-2.5.3.orig/debian/rules +++ mopd-2.5.3/debian/rules @@ -0,0 +1,83 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# Patches, in order they need to be applied +PATCHES=mopd-2.5.3-aout.patch mopd-2.5.3-linux.patch \ + mopd-2.5.3-bind.patch mopd-2.5.3-vax-linux.patch \ + mopd-2.5.3-elf.patch \ + mopd-2.5.3-length.patch mopd-2.5.3-pf.patch \ + mopd-2.5.3-pmax.patch mopd-2.5.3-proto.patch \ + mopd-2.5.3-select.patch mopd-2.5.3-syslog.patch \ + mopd-2.5.3-eaddr.patch mopd-2.5.3-fddi.patch \ + mopd-2.5.3-freebsd-put.patch mopd-2.5.3-mcast.patch \ + 253patched-254.patch debian254.patch alpha.patch\ + gcc-3.4-fix.patch fhs-fileloc.patch + + +build: build-stamp +build-stamp: + dh_testdir + # + mkdir buildtree + find common mopa.out mopd moptrace mopprobe mopchk Makefile Makefile.inc |cpio -pmd buildtree + # + # Apply patches + set -e; cd buildtree ; for i in ${PATCHES}; do echo "--- Applying patch $$i"; patch -f -p1 < ../patches/$$i; done + # + # Compile it + $(MAKE) -C buildtree CFLAGS=-Wno-endif-labels + # + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + # + # Add here commands to clean up after the build process. + -$(MAKE) clean + rm -rf buildtree + # + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + # Add here commands to install the package into debian/tmp. + $(MAKE) -C buildtree install DESTDIR=`pwd`/debian/mopd + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installdebconf + dh_installdocs + dh_installexamples + dh_installmenu + dh_installinit + dh_installman + dh_installinfo + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- mopd-2.5.3.orig/debian/init +++ mopd-2.5.3/debian/init @@ -0,0 +1,82 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: mopd +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start The Maintenance Operations Protocol (MOP) loader daemon. +### END INIT INFO + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +DAEMON=/usr/sbin/mopd +DESC="MOP boot assistant daemon" + +IFACE_LIST="" + +test -x $DAEMON || exit 0 + +if [ -f /etc/mopd.conf ] ; then + . /etc/mopd.conf +fi + +if [ "x$INTERFACE" = "x" ]; then + echo "$DESC disabled, no interfaces." + exit 0 +fi + + +if [ "$INTERFACE" = "all" ] ; then + ARGS="-a" + IFACE_LIST=`sed -e "1,2d" -e "/lo:/d" -e "s/:.*/ /" /proc/net/dev \ + | tr -d "\n"` + if [ -z "$IFACE_LIST" ] ; then + echo "No interfaces found, mopd not started." + exit 0 + fi +else + ARGS="$INTERFACE" +fi + +case "$1" in + start) + echo -n "Starting $DESC: " + + # enable receipt of multicast packets + if [ "$IFACE_LIST" ] ; then + for IFACE in $IFACE_LIST ; do + /sbin/ifconfig $IFACE allmulti + done + else + /sbin/ifconfig $INTERFACE allmulti + fi + + if start-stop-daemon --background --start --exec $DAEMON -- $ARGS ; then + echo "mopd." + else + echo "error starting mopd." + fi + ;; + stop) + + # we don't disable allmulti in case another service needs it + echo -n "Stopping $DESC: " + start-stop-daemon --stop --exec $DAEMON + if [ $? = 0 ] ; then + echo "mopd." + fi + ;; + reload) + echo "Not implemented." + ;; + force-reload|restart) + sh $0 stop + sh $0 start + ;; + *) + echo "Usage: /etc/init.d/mopd {start|stop|restart|force-reload|reload}" + exit 1 + ;; +esac + +exit 0 --- mopd-2.5.3.orig/debian/copyright +++ mopd-2.5.3/debian/copyright @@ -0,0 +1,14 @@ +This package is based on the debianization by David Whedon +with some tweaks by Christine Caulfield + +It was downloaded from +http://source.rfc822.org/pub/mirror/ftp.ds2.pg.gda.pl/pub/macro/mopd/ + +Upstream Author: Mats O Jansson + +Copyright (c) 1993-95 Mats O Jansson +Copyright (c) 1990 The Regents of the University of California. +Copyright (c) 1992-1995, The University of Melbourne. + +This software can be redustributed under the terms of a BSD-type license +Please see the individualy source files for details. --- mopd-2.5.3.orig/debian/substvars +++ mopd-2.5.3/debian/substvars @@ -0,0 +1,2 @@ +misc:Depends=debconf (>= 0.5) | debconf-2.0 +shlibs:Depends=libc6 (>= 2.7-1), libelfg0 (>= 0.8.10) --- mopd-2.5.3.orig/debian/debhelper.log +++ mopd-2.5.3/debian/debhelper.log @@ -0,0 +1,18 @@ +dh_installdirs +dh_installdebconf +dh_installdocs +dh_installexamples +dh_installmenu +dh_installinit +dh_installman +dh_installinfo +dh_installchangelogs +dh_link +dh_strip +dh_compress +dh_fixperms +dh_installdeb +dh_shlibdeps +dh_gencontrol +dh_md5sums +dh_builddeb --- mopd-2.5.3.orig/debian/config +++ mopd-2.5.3/debian/config @@ -0,0 +1,52 @@ +#!/bin/sh -e +CONF_FILE="/etc/mopd.conf" + +priority="medium" +INTERFACES="" + +. /usr/share/debconf/confmodule + +if [ -e "$CONF_FILE" ]; then +# if configuration already exists, use it + . $CONF_FILE || true + if [ "$INTERFACE" ]; then + db_set mopd/interface $INTERFACE + else + # config file exists but doesn't tell us anything + priority="critical" + fi +else +# otherwise if there is only one, we can set default to that + if [ "sed -e '1,2d' -e '/lo:/d' /proc/net/dev | grep -c ." = "1" ] ; then + # only one interface, they probably want to use it + INTERFACE=`sed -e "1,2d" -e "/lo:/d" -e "s/:.*//" /proc/net/dev` + db_set mopd/interface $INTERFACE + else + # no interface already chosen, and there is more than one interface + priority="critical" + fi +fi + + +INTERFACES=`sed -e "1,2d" -e "/lo:/d" -e "s/:.*/ , /" /proc/net/dev | tr -d "\n" | sed -e "s/,[[:space:]]*$//"` + +if [ -n "$INTERFACES" ] ; then + db_subst mopd/interface choices ", $INTERFACES" +else + db_subst mopd/interface choices "" + +fi + +db_subst mopd/interface default all + +db_input $priority mopd/interface || true +db_go || true + +db_get mopd/interface + +if [ $RET = "other" ] ; then + db_input $priority mopd/other_interface || true + db_go || true + db_get mopd/other_interface + db_set mopd/interface $RET +fi --- mopd-2.5.3.orig/debian/po/da.po +++ mopd-2.5.3/debian/po/da.po @@ -0,0 +1,94 @@ +# Danish translation mopd. +# Copyright (C) 2010 mopd & nedenstående oversættere. +# This file is distributed under the same license as the mopd package. +# Joe Hansen , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: mopd\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2010-07-21 14:44+0200\n" +"Last-Translator: Joe Hansen \n" +"Language-Team: Danish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Grænseflade til mopd:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Indtast venligst grænsefladen du ønsker at køre mopd på." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Ikkeeksisterende grænsefalde til mopd" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "MOP-dæmonens konfiguration findes allerede som /etc/mopd.conf." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"Den konfigurationsfil angiver dog '${cur_iface}' som lyttegrænseflade, " +"og denne findes aktuelt ikke." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Du skal løse denne situation ved manuelt at redigere konfigurationsfilen " +"så den passer. Indtil dette sker er det sandsynligt, at mopd ikke vil fungere " +"korrekt." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "anden" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "alle" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Vælg venligst grænsefladen du ønsker at køre mopd på, eller vælg 'anden' " +"hvis grænsefladen ikke er i denne liste." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "Hvis du ønsker at mopd skal lytte på alle grænsefalder, så vælg 'alle'." + + --- mopd-2.5.3.orig/debian/po/templates.pot +++ mopd-2.5.3/debian/po/templates.pot @@ -0,0 +1,86 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "" --- mopd-2.5.3.orig/debian/po/vi.po +++ mopd-2.5.3/debian/po/vi.po @@ -0,0 +1,95 @@ +# Vietnamese Translation for mopd. +# Copyright © 2009 Free Software Foundation, Inc. +# Clytie Siddall , 2005-2009. +# +msgid "" +msgstr "" +"Project-Id-Version: mopd 1:2.5.3-15\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-01-25 23:33+1030\n" +"Last-Translator: Clytie Siddall \n" +"Language-Team: Vietnamese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: LocFactoryEditor 1.8\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Giao diện cho mopd:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Hãy nhập giao diện trên đó bạn muốn chạy trình nền mpod." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Giao diện mopd không tồn tại" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "Cấu hình trình nền MOP đã tồn tại là tập tin « /etc/mopd.conf »." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"Tuy nhiên tập tin cấu hình đó ghi rõ « ${cur_iface} » làm giao diện lắng " +"nghe, mà hiện thời không tồn tại." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Bạn nên giải quyết trường hợp này bằng cách tự chỉnh sửa tập tin cấu hình " +"một cách thích hợp. Không giải quyết thì rất có thể là trình nền mopd không " +"chạy đúng." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "khác" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "tất cả" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Hãy chọn giao diện trên đó bạn muốn chạy trình nền mopd, hoặc chọn mục « khác " +"» danh sách này không chứa giao diện thích hợp." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "" +"Muốn trình nền mopd lắng nghe trên tất cả các giao diện thì hãy chọn mục « " +"tất cả »." --- mopd-2.5.3.orig/debian/po/ca.po +++ mopd-2.5.3/debian/po/ca.po @@ -0,0 +1,115 @@ +# mopd (debconf) translation to Catalan. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# Aleix Badia i Bosch 2004 +# +msgid "" +msgstr "" +"Project-Id-Version: mopd_1:2.5.3-4_templates\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2004-01-31 18:49GMT\n" +"Last-Translator: Aleix Badia i Bosch >\n" +"Language-Team: Debian L10n Catalan \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Introduu la interfcie sobre la qual voleu que s'executi mopd." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" + +#. Type: error +#. Description +#: ../templates:3001 +#, fuzzy +#| msgid "" +#| "A configuration exists in /etc/mopd.conf. The interface indicated in " +#| "that file '${cur_iface}' does not appear to be available. Please resolve " +#| "the situation by manually editing the configuration file appropriately. " +#| "Until this issue is resolved it is likely that mopd will not function " +#| "correctly." +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Hi ha una fitxer de configuraci a /etc/mopd.conf. La interfcie configurada " +"a aquest fitxer '${cur_iface}' no est disponible. Solucioneu la situaci " +"editant manualment i correctament el fitxer de configuraci. El mopd no " +"funcionar correctament mentre no es solucioni aquest problema." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "" + +#. Type: select +#. Description +#: ../templates:4002 +#, fuzzy +#| msgid "" +#| "Please choose the interface you would like to run mopd on, or select " +#| "'other' if the interface is not in this list, select 'all' if you would " +#| "like mopd to listen on all interfaces." +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Seleccioneu la interfce sobre la qual voleu executar mopd; en cas que no " +"estigui a la llista seleccioneu 'other'; si voleu que s'executi sobre totes " +"les interfcies seleccioneu 'all'." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "" + +#~ msgid "Enter an interface." +#~ msgstr "Introduu una interfcie." + +#~ msgid "mopd's currently configured interface is unavailable." +#~ msgstr "La interfcie configurada del mopd actual no est disponible." + +#~ msgid "other, all, ${choices}" +#~ msgstr "altres, tots, ${choices}" + +#~ msgid "Choose an interface." +#~ msgstr "Seleccioneu una interfcie" --- mopd-2.5.3.orig/debian/po/nb.po +++ mopd-2.5.3/debian/po/nb.po @@ -0,0 +1,92 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Bjørn Steensrud , 2009. +msgid "" +msgstr "" +"Project-Id-Version: mopd\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-01-22 20:16+0100\n" +"Last-Translator: Bjørn Steensrud \n" +"Language-Team: Norwegian Bokmål \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Lokalize 0.3\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Grensesnitt for mopd:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Oppgi det grensesnittet du vil kjøre mopd mot." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Grensesnitt for mopd finnes ikke" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "Oppsettet for MOP-nissesn finnes fra før som /etc/mopd.conf." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"Men den oppsettsfila oppgir «${cur_iface}» som lyttende grensesnitt, og det " +"finnes ikke nå." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Du bør løse denne situasjonen ved å redigere oppsettsfila manuelt på " +"passende måte. Mopd vil nok ikke virke riktig før dette problemet er løst." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "andre" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "alle" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Velg det grensesnittet du vil kjøre mopd mot, eller velg «andre» hvis " +"grensesnittet ikke er i denne lista." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "Velg «alle» hvis du vil at mopd skal lytte på alle grensesnittene." --- mopd-2.5.3.orig/debian/po/pt.po +++ mopd-2.5.3/debian/po/pt.po @@ -0,0 +1,108 @@ +# Portuguese translations for mopd package. +# Copyright (C) 2007 Miguel Figueiredo +# This file is distributed under the same license as the mopd package. +# Miguel Figueiredo , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: mopd 2.3.5-10\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-01-27 19:34+0000\n" +"Last-Translator: Miguel Figueiredo \n" +"Language-Team: Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Interface para o mopd:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Por favor introduza o interface no qual gostava de correr o mopd." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Interface inexistente para o mopd" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "A configuração do daemon MOP já existe em /etc/mopd.conf." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"No entanto, esse ficheiro de configuração específica '${cur_iface}' como " +"interface à escuta, o qual actualmente não existe." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Deve resolver esta situação editando apropriadamente o ficheiro de " +"configuração. Até este problema ser resolvido é provável que o mopd não " +"funcione correctamente." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "outro" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "todos" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Por favor escolha o interface em que deseja que corra o mopd, ou seleccione " +"'outro' se o interface não estiver nesta lista." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "" +"Se desejar que o mopd escute todos os interfaces, por favor escolha 'todos'." + +#~ msgid "Enter an interface." +#~ msgstr "Introduza um interface." + +#~ msgid "mopd's currently configured interface is unavailable." +#~ msgstr "" +#~ "O interface para o qual está actualmente configurado o mopd não está " +#~ "disponível." + +#~ msgid "other, all, ${choices}" +#~ msgstr "outro, todos, ${choices}" + +#~ msgid "Choose an interface." +#~ msgstr "Escolha um interface." --- mopd-2.5.3.orig/debian/po/sk.po +++ mopd-2.5.3/debian/po/sk.po @@ -0,0 +1,91 @@ +# Slovak debconf translation of mopd +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the mopd package. +# Ivan Masár , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: mopd\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-02-07 00:25+0100\n" +"Last-Translator: Ivan Masár \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Rozhranie pre mopd:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Prosím, zadajte rozhranie, na ktorom chcete aby mopd bežal." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Rozhranie pre mopd neexistuje" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "Konfigurácia MOP démona už existuje v súbore /etc/mopd.conf." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"Tento konfiguračný súbor však uvádza ako rozhranie pre počúvanie " +"„${cur_iface}“, ktoré momentálne neexistuje." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Túto situáciu by ste mali vyriešiť príslušnou manuálnou úpravou súboru. Kým " +"tento problém nevyriešite, mopd pravdepodobne nebude fungovať správne." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "iné" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "všetky" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Prosím, zadajte rozhranie, na ktorom chcete aby mopd bežal alebo zvoľte " +"„iné“ ak rozhranie nie je v zozname." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "Ak chcete, aby mpd počúval na každom rozhraní, zvoľte prosím „všetky“." --- mopd-2.5.3.orig/debian/po/ja.po +++ mopd-2.5.3/debian/po/ja.po @@ -0,0 +1,80 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2010-11-16 12:28+0900\n" +"Last-Translator: Nobuhiro Iwamatsu \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 +#: ../templates:4002 +msgid "Interface for mopd:" +msgstr "mopd のインターフェイス:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "mopd で動作させたいインターフェースを入力してください。" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "mopd 用の存在しないインターフェイス" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "MOP デーモンの設定は /etc/mopd.conf として既に存在します。" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "However, that configuration file specifies '${cur_iface}' as listening interface, which currently does not exist." +msgstr "しかし、その設定ファイルは listen するインターフェースとして '${cur_iface}' を指定していますが、現在それは存在しません。" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "You should resolve this situation by manually editing the configuration file appropriately. Until this issue is resolved it is likely that mopd will not function correctly." +msgstr "手動で設定ファイルを適切に編集し、この状況を解決しなければなりません。この問題が解決されるまで、mopd が正しく機能しないかもしれません。" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "その他" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "全て" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "Please choose the interface you would like to run mopd on, or select 'other' if the interface is not in this list." +msgstr "mopd で動作させたいインターフェースを選択してください。もしインターフェスがリストにないなら、'その他' を選択してください。" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "mopd で全てのインターフェースを listen したいのなら、'全て' を選んでください。" + --- mopd-2.5.3.orig/debian/po/it.po +++ mopd-2.5.3/debian/po/it.po @@ -0,0 +1,95 @@ +# ITALIAN TRANSLATION OF MOPD'S.PO-DEBCONF FILE +# COPYRIGHT (C) 2009 THE MOPD'S COPYRIGHT HOLDER +# This file is distributed under the same license as the mopd package. +# +# Vincenzo Campanella , 2009. +msgid "" +msgstr "" +"Project-Id-Version: mopd 1:2.5.3-15\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-01-22 05:20+0100\n" +"Last-Translator: Vincenzo Campanella \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Interfaccia per mopd:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Inserire l'interfaccia su cui si desidera eseguire mopd." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Interfaccia per mopd inesistente" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "La configurazione del demone MOP esiste già come «/etc/mopd.conf»." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"Comunque, quel file di configurazione specifica «${cur_iface}» come " +"interfaccia di ascolto, che attualmente non esiste." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"È necessario risolvere questa situazione modificando manualmente il file di " +"configurazione in modo appropriato. Fintanto che questo problema non sarà " +"stato risolto, è molto probabile che mopd non funzioni correttamente." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "altra" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "tutte" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Selezionare l'interfaccia su cui si vorrebbe eseguire mopd, o selezionare " +"«altra» se l'interfaccia non compare in questo elenco." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "" +"Se si desidera che mopd si metta in ascolto su tutte le interfacce, " +"scegliere «tutte»." --- mopd-2.5.3.orig/debian/po/cs.po +++ mopd-2.5.3/debian/po/cs.po @@ -0,0 +1,112 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: mopd\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-01-31 16:23+0100\n" +"Last-Translator: Miroslav Kure \n" +"Language-Team: Czech \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Rozhraní pro mopd:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Zadejte rozhraní, na kterém má mopd naslouchat." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Neexistující rozhraní pro mopd" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "Konfigurační soubor daemona MOP již existuje v /etc/mopd.conf." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"Tento konfigurační soubor říká, že má mopd naslouchat na rozhraní " +"„${cur_iface}“, které však neexistuje." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Situaci byste měli vyřešit tak, že ručně upravíte konfigurační soubor podle " +"skutečnosti. Do té doby nebude mopd s největší pravděpodobností pracovat " +"správně." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "jiné" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "všechna" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Vyberte rozhraní, na kterém má mopd pracovat. Není-li rozhraní v seznamu, " +"zvolte „jiné“." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "Jestliže má mopd naslouchat na všech rozhraních, vyberte „všechna“." + +#~ msgid "Enter an interface." +#~ msgstr "Zadejte rozhraní." + +#~ msgid "mopd's currently configured interface is unavailable." +#~ msgstr "Momentálně vybrané rozhraní není dostupné." + +#~ msgid "other, all, ${choices}" +#~ msgstr "jiné, všechna, ${choices}" + +#~ msgid "Choose an interface." +#~ msgstr "Vyberte rozhraní." --- mopd-2.5.3.orig/debian/po/sv.po +++ mopd-2.5.3/debian/po/sv.po @@ -0,0 +1,108 @@ +# Translation of mopd debconf templates to Swedish +# Copyright (C) 2009 Martin Bagge +# This file is distributed under the same license as the mopd package. +# +# Daniel Nylander , 2005 +# Martin Bagge , 2009 +# +msgid "" +msgstr "" +"Project-Id-Version: mopd\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-01-31 13:41+0100\n" +"Last-Translator: Martin Bagge \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Swedish\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Gränssnitt för mopd:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Ange ett gränssnitt som du vill köra mopd på." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Ickeexisterande gränssnitt för mopd" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "Inställningsfilen för MOP-tjänsten existerar redan i /etc/mopd.conf." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"En inställningsfil existerar, /etc/mopd.conf. Gränssnittet som enligt " +"inställningsfilen ska användas för att lyssna, \"${cur_iface}\", verkar inte " +"vara tillgängligt." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Vänligen lös situationen genom att manuellt redigera inställningsfilen på " +"lämpligt sätt. Tills detta problem är löst är det troligt att mopd inte " +"kommer att fungera korrekt." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "annat" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "alla" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Vänligen välj det gränssnitt du vill att mopd ska köras på eller välj \"annat" +"\" om gränssnittet inte finns med i listan." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "" +"Om du vill att mopd ska lyssna på alla gränssnitt anger du \"alla\" nedan." + +#~ msgid "Enter an interface:" +#~ msgstr "Ange ett gränssnitt." + +#~ msgid "mopd's currently configured interface is unavailable" +#~ msgstr "" +#~ "Gränssnittet som mopd för närvarande är inställt att användas på är inte " +#~ "tillgängligt." + +#~ msgid "other, all, ${choices}" +#~ msgstr "annat, alla, ${choices}" --- mopd-2.5.3.orig/debian/po/eu.po +++ mopd-2.5.3/debian/po/eu.po @@ -0,0 +1,93 @@ +# translation of mopd-eu.po to Euskara +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Piarres Beobide , 2009. +msgid "" +msgstr "" +"Project-Id-Version: mopd-eu\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-01-23 11:51+0100\n" +"Last-Translator: Piarres Beobide \n" +"Language-Team: Euskara \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "mopd-ren interfazea:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Mesedez hautatu mopd zein interfazetan exekutatu nahi duzun." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Ez dagoen interfazea mopd-rentzat" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "MOP deabru konfigurazioa badago dagoeneko /etc/mopd.conf fitxategian." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"Hala ere konfigurazio interfaze honek '${cur_iface}' interfazea ezartzen du " +"entzuteko baina interfaze hori ez da existitzen." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Egoera hau eskuz konpondu beharko duzu konfigurazio fitxategia behar bezala " +"editatuaz. Arazo hau konpondu arte ziurrenik mopd-ek ez du behar bezala " +"funtzionatuko." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "beste bat" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "denak" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Mesedez hautatu mopd zein interfazetan exekutatu nahi duzun, edo 'beste bat' " +"hautatu interfazea zerrendan ez badago." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "Mopd-ek interfaze guztietan entzutea nahi izanez gero 'denak' hautatu." --- mopd-2.5.3.orig/debian/po/fr.po +++ mopd-2.5.3/debian/po/fr.po @@ -0,0 +1,97 @@ +# Translation of mopd debconf templates to French +# Copyright (C) 2003-2009 Debian French l10n team +# This file is distributed under the same license as the mopd package. +# +# Translators: +# Laurence Colombet , 2003. +# Christian Perrier , 2009. +msgid "" +msgstr "" +"Project-Id-Version: fr\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-01-30 06:50+0100\n" +"Last-Translator: Christian Perrier \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Interface réseau pour mopd :" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Veuillez indiquer l'interface sur laquelle vous désirez lancer mopd." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Interface pour mopd inexistante" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "Le fichier de configuration du démon MOP, /etc/mopd.conf, existe déjà." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"Cependant, ce fichier de configuration indique ${cur_iface} comme interface " +"d'écoute alors que cette interface réseau n'existe pas." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Vous devriez corriger cela en modifiant vous-même le fichier de " +"configuration. Sans cette correction, mopd ne fonctionnera probablement pas " +"correctement." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "autre" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "toutes" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Veuillez choisir l'interface sur laquelle vous désirez lancer mopd. " +"Choisissez « autre » si l'interface ne se trouve pas dans cette liste." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "" +"Si vous souhaitez que mopd soit à l'écoute sur toutes les interfaces, " +"choisissez « toutes »." --- mopd-2.5.3.orig/debian/po/POTFILES.in +++ mopd-2.5.3/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] templates --- mopd-2.5.3.orig/debian/po/de.po +++ mopd-2.5.3/debian/po/de.po @@ -0,0 +1,104 @@ +# Translation of mopd debconf templates to German +# Copyright (C) Helge Kreutzmann , 2009. +# This file is distributed under the same license as the mopd package. +# It is based on an earlier translation by an unkown author. +# +msgid "" +msgstr "" +"Project-Id-Version: mopd 1:2.5.3-15\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-01-28 18:52+0100\n" +"Last-Translator: Helge Kreutzmann \n" +"Language-Team: de \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Schnittstelle fr Mopd:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Bitte geben Sie die Schnittstelle ein, an der Mopd laufen soll." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Nichtexistierende Schnittstelle fr Mopd" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "Der MOP-Daemon ist bereits in /etc/mopd.conf konfiguriert." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"Allerdings spezifiziert diese Konfigurationsdatei die derzeit nicht " +"existierende Schnittstelle ${cur_iface}, an der auf Anfragen gewartet " +"werden soll." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Sie sollten diese Situation auflsen, indem Sie die Konfigurationsdatei " +"manuell entsprechend bearbeiten. Wahrscheinlich wird Mopd nicht korrekt " +"funktionieren, bis dieses Problem behoben ist." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "andere" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "alle" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Bitte whlen Sie die Schnittstelle aus, an der Mopd laufen soll. Whlen Sie " +"andere, falls die Schnittstelle nicht in der Liste enthalten ist." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "" +"Falls Sie mchten, dass Mopd auf allen Schnittstellen auf Anfragen wartet, " +"whlen Sie alle." + +#~ msgid "mopd's currently configured interface is unavailable." +#~ msgstr "Das fr mopd gewhle Interface ist nicht verfgbar." + +#~ msgid "other, all, ${choices}" +#~ msgstr "andere, alle, ${choices}" + +#~ msgid "Choose an interface." +#~ msgstr "Whlen Sie eine Schnittstelle" --- mopd-2.5.3.orig/debian/po/nl.po +++ mopd-2.5.3/debian/po/nl.po @@ -0,0 +1,118 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE 'S COPYRIGHT HOLDER +# This file is distributed under the same license as the package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: mopd\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2007-10-26 18:43+0100\n" +"Last-Translator: Bart Cornelis \n" +"Language-Team: debian-l10n-dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Dutch\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Op welke interface dient mopd te luisteren?" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" + +#. Type: error +#. Description +#: ../templates:3001 +#, fuzzy +#| msgid "" +#| "A configuration exists in /etc/mopd.conf. The interface indicated in " +#| "that file '${cur_iface}' does not appear to be available. Please resolve " +#| "the situation by manually editing the configuration file appropriately. " +#| "Until this issue is resolved it is likely that mopd will not function " +#| "correctly." +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Er bestaat een configuratie in /etc/mopd.conf, maar de in dat bestand " +"aangegeven interface '${cur_iface}' lijkt niet beschikbaar. Gelieve deze " +"situatie op te lossen door het configuratiebestand aan te passen. mopd zal " +"pas correct werken eens dit probleem opgelost is." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "" + +#. Type: select +#. Description +#: ../templates:4002 +#, fuzzy +#| msgid "" +#| "Please choose the interface you would like to run mopd on, or select " +#| "'other' if the interface is not in this list, select 'all' if you would " +#| "like mopd to listen on all interfaces." +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Op welke interface dient mopd te luisteren? Selecteer 'anders' als de " +"gewenste interface niet in de lijst voorkomt, en 'alle' als u wilt dat mopd " +"op alle interfaces luistert. " + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "" + +#~ msgid "Enter an interface." +#~ msgstr "Geef een interface aan." + +#~ msgid "mopd's currently configured interface is unavailable." +#~ msgstr "" +#~ "De interface waarvoor mopd momenteel geconfigureerd is, is onbeschikbaar." + +#~ msgid "other, all, ${choices}" +#~ msgstr "anders, alle, ${choices}" + +#~ msgid "Choose an interface." +#~ msgstr "Selecteer een interface." --- mopd-2.5.3.orig/debian/po/ru.po +++ mopd-2.5.3/debian/po/ru.po @@ -0,0 +1,94 @@ +# translation of ru.po to Russian +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Yuri Kozlov , 2009. +msgid "" +msgstr "" +"Project-Id-Version: mopd 1:2.5.3-15\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-01-28 21:08+0300\n" +"Last-Translator: Yuri Kozlov \n" +"Language-Team: Russian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Интерфейс для mopd:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Укажите интерфейс, с которым будет работать mopd." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "Несуществующий интерфейс для mopd" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "Настройка для службы MOP уже есть в файле /etc/mopd.conf." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"Однако, данный файл настройки указывает использовать для прослушивания " +"интерфейс '${cur_iface}', который в данный момент не существует." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Вы должны исправить это, отредактировав файл настройки вручную. Пока это " +"проблема не будет решена, mopd будет работать некорректно." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "другой" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "все" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Выберите интерфейс для работы mopd, или выберите 'другой', если интерфейса " +"нет в списке." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "Если нужно, чтобы mopd прослушивал все интерфейсы, выберите 'все'." --- mopd-2.5.3.orig/debian/po/es.po +++ mopd-2.5.3/debian/po/es.po @@ -0,0 +1,129 @@ +# mopd po-debconf translation to Spanish +# Copyright (C) 2007, 2008, 2009 Software in the Public Interest +# This file is distributed under the same license as the mopd package. +# +# Changes: +# - Initial translation +# Enrique Matias Sanchez , 2007 +# +# - Updates +# Francisco Javier Cuadrado , 2008, 2009 +# +# Traductores, si no conocen el formato PO, merece la pena leer la +# documentación de gettext, especialmente las secciones dedicadas a este +# formato, por ejemplo ejecutando: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Equipo de traducción al español, por favor lean antes de traducir +# los siguientes documentos: +# +# - El proyecto de traducción de Debian al español +# http://www.debian.org/intl/spanish/ +# especialmente las notas de traducción en +# http://www.debian.org/intl/spanish/notas +# +# - La guía de traducción de po's de debconf: +# /usr/share/doc/po-debconf/README-trans +# o http://www.debian.org/intl/l10n/po-debconf/README-trans +# +msgid "" +msgstr "" +"Project-Id-Version: mopd 1:2.5.3-15\n" +"Report-Msgid-Bugs-To: mopd@packages.debian.org\n" +"POT-Creation-Date: 2009-01-21 18:49+0100\n" +"PO-Revision-Date: 2009-01-28 18:11+0100\n" +"Last-Translator: Francisco Javier Cuadrado \n" +"Language-Team: Debian l10n Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: string +#. Description +#. Type: select +#. Description +#: ../templates:2001 ../templates:4002 +msgid "Interface for mopd:" +msgstr "Interfaz para mopd:" + +#. Type: string +#. Description +#: ../templates:2001 +msgid "Please enter the interface you would like to run mopd on." +msgstr "Introduzca la interfaz sobre la que quiere ejecutar mopd." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "Nonexistent interface for mopd" +msgstr "La interfaz para mopd no existe" + +#. Type: error +#. Description +#: ../templates:3001 +msgid "The MOP daemon configuration already exists as /etc/mopd.conf." +msgstr "" +"La configuración del demonio MOP ya existe en el archivo «/etc/mopd.conf»." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"However, that configuration file specifies '${cur_iface}' as listening " +"interface, which currently does not exist." +msgstr "" +"Sin embargo, ese archivo de configuración especifica «${cur_iface}» como la " +"interfaz de escucha, pero actualmente no existe." + +#. Type: error +#. Description +#: ../templates:3001 +msgid "" +"You should resolve this situation by manually editing the configuration file " +"appropriately. Until this issue is resolved it is likely that mopd will not " +"function correctly." +msgstr "" +"Corrija esta situación editando manualmente el archivo de configuración " +"apropiado. Hasta que no resuelva este problema, es probable que mopd no " +"funcione correctamente." + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "other" +msgstr "otra" + +#. Type: select +#. Choices +#: ../templates:4001 +msgid "all" +msgstr "todas" + +#. Type: select +#. Description +#: ../templates:4002 +msgid "" +"Please choose the interface you would like to run mopd on, or select 'other' " +"if the interface is not in this list." +msgstr "" +"Elija la interfaz sobre la que desee ejecutar mopd, o seleccione «otra» si la " +"interfaz no está en esta lista." + +#. Type: select +#. Description +#: ../templates:4002 +msgid "If you want mopd to listen on all interfaces, please choose 'all'." +msgstr "Elija «todas», si desea que mopd escuche en todas las interfaces." + +#~ msgid "Enter an interface." +#~ msgstr "Introduzca una interfaz." + +#~ msgid "mopd's currently configured interface is unavailable." +#~ msgstr "La interfaz configurada actualmente para mopd no está disponible." + +#~ msgid "other, all, ${choices}" +#~ msgstr "otra, todas, ${choices}" + +#~ msgid "Choose an interface." +#~ msgstr "Elija una interfaz."