From e94a5fcb7620cf399ad1c2666b8093d6ca3df24b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Fri, 1 Jan 2021 16:57:43 +0100 Subject: [PATCH] pppoe-discovery: Remove unused file debug.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Pali Rohár --- pppd/plugins/pppoe/Makefile.linux | 7 +- pppd/plugins/pppoe/debug.c | 145 ------------------------------ pppd/plugins/pppoe/pppoe.h | 2 - 3 files changed, 2 insertions(+), 152 deletions(-) delete mode 100644 pppd/plugins/pppoe/debug.c diff --git a/pppd/plugins/pppoe/Makefile.linux b/pppd/plugins/pppoe/Makefile.linux index 13df537..0dd46ec 100644 --- a/pppd/plugins/pppoe/Makefile.linux +++ b/pppd/plugins/pppoe/Makefile.linux @@ -28,15 +28,12 @@ LN_S = ln -sf CFLAGS=$(COPTS) -I../../../include all: pppoe.so pppoe-discovery -pppoe-discovery: pppoe-discovery.o debug.o discovery.o if.o common.o - $(CC) $(LDFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o discovery.o if.o common.o +pppoe-discovery: pppoe-discovery.o discovery.o if.o common.o + $(CC) $(LDFLAGS) -o pppoe-discovery pppoe-discovery.o discovery.o if.o common.o pppoe-discovery.o: pppoe-discovery.c $(CC) $(CFLAGS) -I../../.. -c -o pppoe-discovery.o pppoe-discovery.c -debug.o: debug.c - $(CC) $(CFLAGS) -I../../.. -c -o debug.o debug.c - pppoe.so: plugin.o discovery.o if.o common.o $(CC) $(LDFLAGS) -o pppoe.so -shared plugin.o discovery.o if.o common.o diff --git a/pppd/plugins/pppoe/debug.c b/pppd/plugins/pppoe/debug.c deleted file mode 100644 index a6e6981..0000000 --- a/pppd/plugins/pppoe/debug.c +++ /dev/null @@ -1,145 +0,0 @@ -/*********************************************************************** -* -* debug.c -* -* Implementation of user-space PPPoE redirector for Linux. -* -* Functions for printing debugging information -* -* Copyright (C) 2000 by Roaring Penguin Software Inc. -* -* This program may be distributed according to the terms of the GNU -* General Public License, version 2 or (at your option) any later version. -* -***********************************************************************/ - -static char const RCSID[] = -"$Id: debug.c,v 1.2 2008/06/09 08:34:23 paulus Exp $"; - -#include "pppoe.h" -#include -#include -#include -#include - -/********************************************************************** -*%FUNCTION: dumpHex -*%ARGUMENTS: -* fp -- file to dump to -* buf -- buffer to dump -* len -- length of data -*%RETURNS: -* Nothing -*%DESCRIPTION: -* Dumps buffer to fp in an easy-to-read format -***********************************************************************/ -void -dumpHex(FILE *fp, unsigned char const *buf, int len) -{ - int i; - int base; - - if (!fp) return; - - /* do NOT dump PAP packets */ - if (len >= 2 && buf[0] == 0xC0 && buf[1] == 0x23) { - fprintf(fp, "(PAP Authentication Frame -- Contents not dumped)\n"); - return; - } - - for (base=0; baselength); - - /* Sheesh... printing times is a pain... */ - struct timeval tv; - time_t now; - int millisec; - struct tm *lt; - char timebuf[256]; - - UINT16_t type = etherType(packet); - if (!fp) return; - gettimeofday(&tv, NULL); - now = (time_t) tv.tv_sec; - millisec = tv.tv_usec / 1000; - lt = localtime(&now); - strftime(timebuf, 256, "%H:%M:%S", lt); - fprintf(fp, "%s.%03d %s PPPoE ", timebuf, millisec, dir); - if (type == Eth_PPPOE_Discovery) { - fprintf(fp, "Discovery (%x) ", (unsigned) type); - } else if (type == Eth_PPPOE_Session) { - fprintf(fp, "Session (%x) ", (unsigned) type); - } else { - fprintf(fp, "Unknown (%x) ", (unsigned) type); - } - - switch(packet->code) { - case CODE_PADI: fprintf(fp, "PADI "); break; - case CODE_PADO: fprintf(fp, "PADO "); break; - case CODE_PADR: fprintf(fp, "PADR "); break; - case CODE_PADS: fprintf(fp, "PADS "); break; - case CODE_PADT: fprintf(fp, "PADT "); break; - case CODE_PADM: fprintf(fp, "PADM "); break; - case CODE_PADN: fprintf(fp, "PADN "); break; - case CODE_SESS: fprintf(fp, "SESS "); break; - } - - fprintf(fp, "sess-id %d length %d\n", - (int) ntohs(packet->session), - len); - - /* Ugly... I apologize... */ - fprintf(fp, - "SourceAddr %02x:%02x:%02x:%02x:%02x:%02x " - "DestAddr %02x:%02x:%02x:%02x:%02x:%02x\n", - (unsigned) packet->ethHdr.h_source[0], - (unsigned) packet->ethHdr.h_source[1], - (unsigned) packet->ethHdr.h_source[2], - (unsigned) packet->ethHdr.h_source[3], - (unsigned) packet->ethHdr.h_source[4], - (unsigned) packet->ethHdr.h_source[5], - (unsigned) packet->ethHdr.h_dest[0], - (unsigned) packet->ethHdr.h_dest[1], - (unsigned) packet->ethHdr.h_dest[2], - (unsigned) packet->ethHdr.h_dest[3], - (unsigned) packet->ethHdr.h_dest[4], - (unsigned) packet->ethHdr.h_dest[5]); - dumpHex(fp, packet->payload, ntohs(packet->length)); -} diff --git a/pppd/plugins/pppoe/pppoe.h b/pppd/plugins/pppoe/pppoe.h index b70cccf..9c5073b 100644 --- a/pppd/plugins/pppoe/pppoe.h +++ b/pppd/plugins/pppoe/pppoe.h @@ -260,8 +260,6 @@ UINT16_t etherType(PPPoEPacket *packet); int openInterface(char const *ifname, UINT16_t type, unsigned char *hwaddr); int sendPacket(PPPoEConnection *conn, int sock, PPPoEPacket *pkt, int size); int receivePacket(int sock, PPPoEPacket *pkt, int *size); -void dumpPacket(FILE *fp, PPPoEPacket *packet, char const *dir); -void dumpHex(FILE *fp, unsigned char const *buf, int len); int parsePacket(PPPoEPacket *packet, ParseFunc *func, void *extra); void parseLogErrs(UINT16_t typ, UINT16_t len, unsigned char *data, void *xtra); void syncReadFromPPP(PPPoEConnection *conn, PPPoEPacket *packet); -- 2.39.2