From owner-dev-commits-src-main@freebsd.org Sat Dec 26 01:43:05 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F0D24CFF24; Sat, 26 Dec 2020 01:43:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2mm92Hgzz4cyh; Sat, 26 Dec 2020 01:43:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 410664BFF; Sat, 26 Dec 2020 01:43:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BQ1h5mg066536; Sat, 26 Dec 2020 01:43:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BQ1h5U0066535; Sat, 26 Dec 2020 01:43:05 GMT (envelope-from git) Date: Sat, 26 Dec 2020 01:43:05 GMT Message-Id: <202012260143.0BQ1h5U0066535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 7e7571829512 - sbin/routed: Remove unused code for sgi and NetBSD. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e7571829512b08641effefc9f112dc264a79e78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2020 01:43:05 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=7e7571829512b08641effefc9f112dc264a79e78 commit 7e7571829512b08641effefc9f112dc264a79e78 Author: Xin LI AuthorDate: 2020-12-26 01:42:11 +0000 Commit: Xin LI CommitDate: 2020-12-26 01:42:47 +0000 sbin/routed: Remove unused code for sgi and NetBSD. MFC after: 2 weeks --- sbin/routed/defs.h | 41 ----------------------------------------- sbin/routed/if.c | 20 -------------------- sbin/routed/input.c | 7 ------- sbin/routed/main.c | 20 -------------------- sbin/routed/output.c | 7 ------- sbin/routed/parms.c | 7 ------- sbin/routed/pathnames.h | 4 ---- sbin/routed/radix.c | 7 ------- sbin/routed/rdisc.c | 7 ------- sbin/routed/table.c | 7 ------- sbin/routed/trace.c | 15 --------------- 11 files changed, 142 deletions(-) diff --git a/sbin/routed/defs.h b/sbin/routed/defs.h index 5ce7b5be3b16..9b0218163d3b 100644 --- a/sbin/routed/defs.h +++ b/sbin/routed/defs.h @@ -33,9 +33,6 @@ * $FreeBSD$ */ -#ifdef sgi -#ident "$FreeBSD$" -#endif /* Definitions for RIPv2 routing process. * @@ -69,10 +66,6 @@ #include #include #include -#ifdef sgi -#include -#include -#endif #include #include #include @@ -84,14 +77,9 @@ #include #include #include -#ifdef sgi -#define _USER_ROUTE_TREE -#include -#else #include "radix.h" #define UNUSED __attribute__((unused)) #define PATTRIB(f,l) __attribute__((format (printf,f,l))) -#endif #include #include #include @@ -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 -#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 diff --git a/sbin/routed/if.c b/sbin/routed/if.c index af02b9e87391..da451e69e4d8 100644 --- a/sbin/routed/if.c +++ b/sbin/routed/if.c @@ -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) { diff --git a/sbin/routed/input.c b/sbin/routed/input.c index 116d15ca7437..ef1c025e8f81 100644 --- a/sbin/routed/input.c +++ b/sbin/routed/input.c @@ -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); diff --git a/sbin/routed/main.c b/sbin/routed/main.c index c4f9e56065e6..d3b6a4484689 100644 --- a/sbin/routed/main.c +++ b/sbin/routed/main.c @@ -33,9 +33,6 @@ #include "defs.h" #include "pathnames.h" -#ifdef sgi -#include "math.h" -#endif #include #include #include @@ -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 -#elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); -#else -__RCSID("$Revision: 2.31 $"); -#ident "$Revision: 2.31 $" -#endif pid_t mypid; @@ -292,18 +281,9 @@ usage: 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. diff --git a/sbin/routed/output.c b/sbin/routed/output.c index 7d5b1e4131a6..af4085ac02da 100644 --- a/sbin/routed/output.c +++ b/sbin/routed/output.c @@ -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; diff --git a/sbin/routed/parms.c b/sbin/routed/parms.c index ef501b043244..16665b18407f 100644 --- a/sbin/routed/parms.c +++ b/sbin/routed/parms.c @@ -35,14 +35,7 @@ #include "pathnames.h" #include -#ifdef __NetBSD__ -__RCSID("$NetBSD$"); -#elif defined(__FreeBSD__) __RCSID("$FreeBSD$"); -#else -__RCSID("$Revision: 2.26 $"); -#ident "$Revision: 2.26 $" -#endif static struct parm *parms; diff --git a/sbin/routed/pathnames.h b/sbin/routed/pathnames.h index fff6de671cfa..5a31fa7e86bc 100644 --- a/sbin/routed/pathnames.h +++ b/sbin/routed/pathnames.h @@ -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 diff --git a/sbin/routed/radix.c b/sbin/routed/radix.c index 0f3ef39ec213..2372b8c68581 100644 --- a/sbin/routed/radix.c +++ b/sbin/routed/radix.c @@ -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);} diff --git a/sbin/routed/rdisc.c b/sbin/routed/rdisc.c index b8b02d7b9e1a..3494f061b64b 100644 --- a/sbin/routed/rdisc.c +++ b/sbin/routed/rdisc.c @@ -36,14 +36,7 @@ #include #include -#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 { diff --git a/sbin/routed/table.c b/sbin/routed/table.c index 04b2f79f5e08..648a1d1a6b25 100644 --- a/sbin/routed/table.c +++ b/sbin/routed/table.c @@ -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}; diff --git a/sbin/routed/trace.c b/sbin/routed/trace.c index 5fe4a97c2146..98c29218fb89 100644 --- a/sbin/routed/trace.c +++ b/sbin/routed/trace.c @@ -38,20 +38,9 @@ #include #include -#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; }