sbin/routed: Remove unused code for sgi and NetBSD.

MFC after:	2 weeks
This commit is contained in:
Xin LI 2020-12-25 17:42:11 -08:00
parent 261295ba4c
commit 7e75718295
11 changed files with 0 additions and 142 deletions

View File

@ -33,9 +33,6 @@
* $FreeBSD$
*/
#ifdef sgi
#ident "$FreeBSD$"
#endif
/* Definitions for RIPv2 routing process.
*
@ -69,10 +66,6 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
#ifdef sgi
#include <strings.h>
#include <bstring.h>
#endif
#include <stdarg.h>
#include <syslog.h>
#include <time.h>
@ -84,14 +77,9 @@
#include <sys/sysctl.h>
#include <sys/socket.h>
#include <sys/queue.h>
#ifdef sgi
#define _USER_ROUTE_TREE
#include <net/radix.h>
#else
#include "radix.h"
#define UNUSED __attribute__((unused))
#define PATTRIB(f,l) __attribute__((format (printf,f,l)))
#endif
#include <net/if.h>
#include <net/route.h>
#include <net/if_dl.h>
@ -113,17 +101,9 @@
* So define it here so it can be changed for the target system.
* It should be defined somewhere netinet/in.h, but it is not.
*/
#ifdef sgi
#define naddr u_int32_t
#elif defined (__NetBSD__)
#define naddr u_int32_t
#define _HAVE_SA_LEN
#define _HAVE_SIN_LEN
#else
#define naddr u_long
#define _HAVE_SA_LEN
#define _HAVE_SIN_LEN
#endif
#define DAY (24*60*60)
#define NEVER DAY /* a long time */
@ -147,9 +127,7 @@
/* Router Discovery parameters */
#ifndef sgi
#define INADDR_ALLROUTERS_GROUP 0xe0000002 /* 224.0.0.2 */
#endif
#define MaxMaxAdvertiseInterval 1800
#define MinMaxAdvertiseInterval 4
#define DefMaxAdvertiseInterval 600
@ -295,9 +273,6 @@ struct interface {
u_int ierrors;
u_int opackets;
u_int oerrors;
#ifdef sgi
u_int odrops;
#endif
time_t ts; /* timestamp on network stats */
} int_data;
# define MAX_AUTH_KEYS 5
@ -502,10 +477,6 @@ extern char inittracename[PATH_MAX];
extern struct radix_node_head *rhead;
#ifdef sgi
/* Fix conflicts */
#define dup2(x,y) BSDdup2(x,y)
#endif /* sgi */
void fix_sock(int, const char *);
void fix_select(void);
@ -635,16 +606,4 @@ struct interface *iflookup(naddr);
struct auth *find_auth(struct interface *);
void end_md5_auth(struct ws_buf *, struct auth *);
#if defined(__FreeBSD__) || defined(__NetBSD__)
#include <md5.h>
#else
#define MD5_DIGEST_LEN 16
typedef struct {
u_int32_t state[4]; /* state (ABCD) */
u_int32_t count[2]; /* # of bits, modulo 2^64 (LSB 1st) */
unsigned char buffer[64]; /* input buffer */
} MD5_CTX;
void MD5Init(MD5_CTX*);
void MD5Update(MD5_CTX*, u_char*, u_int);
void MD5Final(u_char[MD5_DIGEST_LEN], MD5_CTX*);
#endif

View File

@ -36,14 +36,7 @@
#include "defs.h"
#include "pathnames.h"
#ifdef __NetBSD__
__RCSID("$NetBSD$");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
__RCSID("$Revision: 2.27 $");
#ident "$Revision: 2.27 $"
#endif
struct ifhead ifnet = LIST_HEAD_INITIALIZER(ifnet); /* all interfaces */
struct ifhead remote_if = LIST_HEAD_INITIALIZER(remote_if); /* remote interfaces */
@ -735,9 +728,6 @@ ifinit(void)
ifs0.int_data.ierrors = ifm->ifm_data.ifi_ierrors;
ifs0.int_data.opackets = ifm->ifm_data.ifi_opackets;
ifs0.int_data.oerrors = ifm->ifm_data.ifi_oerrors;
#ifdef sgi
ifs0.int_data.odrops = ifm->ifm_data.ifi_odrops;
#endif
sdl = (struct sockaddr_dl *)(ifm + 1);
sdl->sdl_data[sdl->sdl_nlen] = 0;
strncpy(ifs0.int_name, sdl->sdl_data,
@ -977,16 +967,6 @@ ifinit(void)
ierr = ifs.int_data.ierrors - ifp->int_data.ierrors;
out = ifs.int_data.opackets - ifp->int_data.opackets;
oerr = ifs.int_data.oerrors - ifp->int_data.oerrors;
#ifdef sgi
/* Through at least IRIX 6.2, PPP and SLIP
* count packets dropped by the filters.
* But FDDI rings stuck non-operational count
* dropped packets as they wait for improvement.
*/
if (!(ifp->int_if_flags & IFF_POINTOPOINT))
oerr += (ifs.int_data.odrops
- ifp->int_data.odrops);
#endif
/* If the interface just awoke, restart the counters.
*/
if (ifp->int_data.ts == 0) {

View File

@ -33,14 +33,7 @@
#include "defs.h"
#ifdef __NetBSD__
__RCSID("$NetBSD$");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
__RCSID("$Revision: 2.26 $");
#ident "$Revision: 2.26 $"
#endif
static void input(struct sockaddr_in *, struct interface *, struct interface *,
struct rip *, int);

View File

@ -33,9 +33,6 @@
#include "defs.h"
#include "pathnames.h"
#ifdef sgi
#include "math.h"
#endif
#include <signal.h>
#include <fcntl.h>
#include <sys/file.h>
@ -43,15 +40,7 @@
__COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993 "
"The Regents of the University of California."
" All rights reserved.");
#ifdef __NetBSD__
__RCSID("$NetBSD$");
#include <util.h>
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
__RCSID("$Revision: 2.31 $");
#ident "$Revision: 2.31 $"
#endif
pid_t mypid;
@ -292,18 +281,9 @@ main(int argc,
signal(SIGUSR2, sigtrace_off);
/* get into the background */
#ifdef sgi
if (0 > _daemonize(background ? 0 : (_DF_NOCHDIR|_DF_NOFORK),
STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO))
BADERR(0, "_daemonize()");
#else
if (background && daemon(0, 1) < 0)
BADERR(0,"daemon()");
#endif
#if defined(__NetBSD__)
pidfile(0);
#endif
mypid = getpid();
/* prepare socket connected to the kernel.

View File

@ -33,14 +33,7 @@
#include "defs.h"
#ifdef __NetBSD__
__RCSID("$NetBSD$");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
__RCSID("$Revision: 2.27 $");
#ident "$Revision: 2.27 $"
#endif
u_int update_seqno;

View File

@ -35,14 +35,7 @@
#include "pathnames.h"
#include <sys/stat.h>
#ifdef __NetBSD__
__RCSID("$NetBSD$");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
__RCSID("$Revision: 2.26 $");
#ident "$Revision: 2.26 $"
#endif
static struct parm *parms;

View File

@ -47,8 +47,4 @@
* Leave this undefined, and only the trace file originally specified
* when routed was started, if any, will be appended to.
*/
#ifndef __NetBSD__
#define _PATH_TRACE "/etc/routed.trace"
#else
#undef _PATH_TRACE
#endif

View File

@ -39,14 +39,7 @@
#include "defs.h"
#ifdef __NetBSD__
__RCSID("$NetBSD$");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
__RCSID("$Revision: 2.23 $");
#ident "$Revision: 2.23 $"
#endif
#define log(x, msg) syslog(x, msg)
#define panic(s) {log(LOG_ERR,s); exit(1);}

View File

@ -36,14 +36,7 @@
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#ifdef __NetBSD__
__RCSID("$NetBSD$");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
__RCSID("$Revision: 2.27 $");
#ident "$Revision: 2.27 $"
#endif
/* router advertisement ICMP packet */
struct icmp_ad {

View File

@ -33,14 +33,7 @@
#include "defs.h"
#ifdef __NetBSD__
__RCSID("$NetBSD$");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
__RCSID("$Revision: 2.27 $");
#ident "$Revision: 2.27 $"
#endif
static struct rt_spare *rts_better(struct rt_entry *);
static struct rt_spare rts_empty = {0,0,0,HOPCNT_INFINITY,0,0,0};

View File

@ -38,20 +38,9 @@
#include <sys/signal.h>
#include <fcntl.h>
#ifdef __NetBSD__
__RCSID("$NetBSD$");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
__RCSID("$Revision: 2.27 $");
#ident "$Revision: 2.27 $"
#endif
#ifdef sgi
/* use *stat64 for files on large file systems */
#define stat stat64
#endif
int tracelevel, new_tracelevel;
FILE *ftrace; /* output trace file */
@ -150,12 +139,8 @@ ts(time_t secs) {
static char s[20];
secs += epoch.tv_sec;
#ifdef sgi
(void)cftime(s, "%T", &secs);
#else
memcpy(s, ctime(&secs)+11, 8);
s[8] = '\0';
#endif
return s;
}