A random bunch of cleanup changes.

This commit is contained in:
Poul-Henning Kamp 1996-01-10 21:28:04 +00:00
parent 94de173773
commit 7b64106a9e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13379
14 changed files with 47 additions and 36 deletions

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: arp.c,v 1.1 1995/02/26 12:17:09 amurai Exp $
* $Id: arp.c,v 1.2 1995/05/30 03:50:23 rgrimes Exp $
*
*/
@ -27,9 +27,12 @@
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/errno.h>
#include <unistd.h>
#include <string.h>
#include <net/if.h>
#include <net/route.h>
@ -83,7 +86,6 @@ sifproxyarp(unit, hisaddr)
u_long hisaddr;
{
int routes;
int l;
/*
* Get the hardware address of an interface on the same subnet
@ -237,7 +239,6 @@ get_ether_addr(s, ipaddr, hwaddr)
struct ifreq ifreq;
struct ifconf ifc;
struct ifreq ifs[MAX_IFS];
struct ifreq ifx;
ifc.ifc_len = sizeof(ifs);
ifc.ifc_req = ifs;

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: ccp.c,v 1.2 1995/02/26 12:17:14 amurai Exp $
* $Id: ccp.c,v 1.3 1995/05/30 03:50:27 rgrimes Exp $
*
* TODO:
* o Support other compression protocols
@ -86,7 +86,7 @@ ReportCcpStatus()
printf("%s [%s]\n", fp->name, StateNames[fp->state]);
printf("myproto = %s, hisproto = %s\n",
cftypes[icp->want_proto], cftypes[icp->his_proto]);
printf("Input: %d --> %d, Output: %d --> %d\n",
printf("Input: %ld --> %ld, Output: %ld --> %ld\n",
icp->orgin, icp->compin, icp->orgout, icp->compout);
}
@ -214,9 +214,6 @@ int plen;
int mode;
{
int type, length;
u_long *lp, compproto;
struct compreq *pcomp;
struct in_addr ipaddr, dstipaddr;
char tbuff[100];
ackp = AckBuff;

View File

@ -17,10 +17,12 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: chap.c,v 1.2 1995/02/26 12:17:17 amurai Exp $
* $Id: chap.c,v 1.3 1995/05/30 03:50:28 rgrimes Exp $
*
* TODO:
*/
#include <sys/types.h>
#include <time.h>
#include "fsm.h"
#include "chap.h"
#include "lcpproto.h"
@ -73,7 +75,7 @@ void
SendChapChallenge(chapid)
int chapid;
{
int keylen, len, i;
int len, i;
char *cp;
srandom(time(NULL));

View File

@ -17,11 +17,14 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: command.c,v 1.9 1995/09/02 17:20:50 amurai Exp $
* $Id: command.c,v 1.10 1995/10/08 14:57:27 amurai Exp $
*
*/
#include <sys/types.h>
#include <ctype.h>
#include <termios.h>
#include <wait.h>
#include <time.h>
#include "fsm.h"
#include "phase.h"
#include "lcp.h"
@ -756,7 +759,6 @@ struct cmdtab *list;
int argc;
char **argv;
{
int width;
DefMyAddress.ipaddr.s_addr = DefHisAddress.ipaddr.s_addr = 0L;
if (argc > 0) {

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: filter.c,v 1.4 1995/05/30 03:50:31 rgrimes Exp $
* $Id: filter.c,v 1.5 1995/09/17 16:14:45 amurai Exp $
*
* TODO: Shoud send ICMP error message when we discard packets.
*/
@ -200,8 +200,6 @@ int argc;
char **argv;
int proto;
{
int port;
char *cp;
if (argc == 0) {
/* permit/deny all tcp traffic */
@ -249,7 +247,7 @@ int proto;
return(0);
}
if (argc > 0)
printf("bad %s src/dst port syntax: %s\n", *argv);
printf("bad src/dst port syntax: %s\n", *argv);
return(0);
}

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: hdlc.c,v 1.4 1995/07/08 17:46:49 amurai Exp $
* $Id: hdlc.c,v 1.5 1995/07/30 15:18:29 gpalmer Exp $
*
* TODO:
*/
@ -196,6 +196,7 @@ HdlcOutput(int pri, u_short proto, struct mbuf *bp)
AsyncOutput(pri, mhp, proto);
}
void
DecodePacket(proto, bp)
u_short proto;
struct mbuf *bp;

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: ip.c,v 1.4 1995/05/30 03:50:37 rgrimes Exp $
* $Id: ip.c,v 1.5 1995/09/17 16:14:46 amurai Exp $
*
* TODO:
* o Return ICMP message for filterd packet
@ -200,7 +200,6 @@ direction, cproto, fp->opt.srcop, fp->opt.dstop, estab);
}
fp++;
}
drop:
return(A_DENY); /* No rule is mached. Deny this packet */
}
return(A_PERMIT); /* No rule is given. Permit this packet */

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: main.c,v 1.10 1995/09/18 12:41:52 bde Exp $
* $Id: main.c,v 1.11 1995/10/08 14:57:29 amurai Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@ -65,7 +65,7 @@ static void TerminalStop();
static struct termios oldtio; /* Original tty mode */
static struct termios comtio; /* Command level tty mode */
static int TermMode;
static int server, update;
static int server;
struct sockaddr_in ifsin;
char pid_filename[128];
@ -145,7 +145,6 @@ void
Cleanup(excode)
int excode;
{
int stat;
OsLinkdown();
OsCloseLink(1);
@ -251,7 +250,6 @@ int argc;
char **argv;
{
int tunno;
int on = 1;
argc--; argv++;

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: modem.c,v 1.7 1995/06/30 19:53:04 dfr Exp $
* $Id: modem.c,v 1.9 1995/09/02 17:20:53 amurai Exp $
*
* TODO:
*/
@ -27,6 +27,7 @@
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <errno.h>
#include <time.h>
#include "hdlc.h"
#include "lcp.h"
#include "modem.h"
@ -39,6 +40,7 @@
#endif
extern int DoChat();
extern void CloseModem();
static int mbits; /* Current DCD status */
static int connect_time; /* connection time */
@ -80,7 +82,8 @@ struct mqueue *queue;
#ifdef QDEBUG
logprintf("Dequeue: len = %d\n", queue->qlen);
#endif
if (bp = queue->top) {
bp = queue->top;
if (bp) {
queue->top = queue->top->pnext;
queue->qlen--;
if (queue->top == NULL) {
@ -600,6 +603,7 @@ int flag;
}
}
void
CloseModem()
{
if (modem >= 3)

View File

@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: os.h,v 1.1.1.1 1995/01/31 06:29:56 amurai Exp $
* $Id: os.h,v 1.2 1995/02/26 12:17:49 amurai Exp $
*
* TODO:
*/
@ -32,4 +32,6 @@ void OsCloseLink __P((int flag));
void OsLinkup __P((void)), OsLinkdown __P((void));
void OsSetRoute __P((int, struct in_addr, struct in_addr, struct in_addr));
void DeleteIfRoutes __P((int));
void OsAddInOctets __P((int cnt));
void OsAddOutOctets __P((int cnt));
#endif

View File

@ -5,7 +5,7 @@
/*
*
* $Id: pred.c,v 1.2 1995/02/26 12:17:55 amurai Exp $
* $Id: pred.c,v 1.3 1995/05/30 03:50:55 rgrimes Exp $
*
* pred.c -- Test program for Dave Rand's rendition of the
* predictor algorithm
@ -57,7 +57,6 @@ SyncTable(source, dest, len)
unsigned char *source, *dest;
int len;
{
int i;
while (len--) {
if (InputGuessTable[iHash] != *source) {

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: timer.c,v 1.3 1995/03/11 15:18:51 amurai Exp $
* $Id: timer.c,v 1.4 1995/05/30 03:50:59 rgrimes Exp $
*
* TODO:
*/
@ -146,7 +146,8 @@ TimerService()
#ifdef DEBUG
ShowTimers();
#endif
if (tp = TimerList) {
tp = TimerList;
if (tp) {
tp->rest--;
if (tp->rest == 0) {
/*
@ -204,7 +205,8 @@ ShowTimers()
}
#ifdef SIGALRM
u_int sleep( u_int sec )
u_int
sleep( u_int sec )
{
struct timeval to,st,et;
long sld, nwd, std;
@ -231,6 +233,7 @@ u_int sleep( u_int sec )
to.tv_usec = sld % 1000000;
}
}
return (0L);
}
void usleep( u_int usec)

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: uucplock.c,v 1.4 1995/03/11 15:18:53 amurai Exp $
* $Id: uucplock.c,v 1.5 1995/05/30 03:51:00 rgrimes Exp $
*
*/
@ -39,9 +39,14 @@ static char sccsid[] = "@(#)uucplock.c 5.5 (Berkeley) 6/1/90";
#endif /* not lint */
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/file.h>
#include <sys/dir.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <signal.h>
#include "pathnames.h"
/*
@ -50,6 +55,7 @@ static char sccsid[] = "@(#)uucplock.c 5.5 (Berkeley) 6/1/90";
* -1 - failure
*/
int
uu_lock(ttyname)
char *ttyname;
{

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: vars.c,v 1.5 1995/09/02 17:20:54 amurai Exp $
* $Id: vars.c,v 1.6 1995/10/08 14:57:31 amurai Exp $
*
*/
#include "fsm.h"
@ -29,7 +29,7 @@
#include "defs.h"
char VarVersion[] = "Version 0.94";
char VarLocalVersion[] = "$Date: 1995/09/02 17:20:54 $";
char VarLocalVersion[] = "$Date: 1995/10/08 14:57:31 $";
/*
* Order of conf option is important. See vars.h.
@ -180,9 +180,8 @@ struct cmdtab *list;
int argc;
char **argv;
{
char *p;
if (argc < 1) {
printf("Please Enter passwd for manupilating.\n");
printf("Please Enter passwd for manipulating.\n");
return(1);
}