From: Phil Blundell Date: Sun, 5 Mar 2000 11:26:02 +0000 (+0000) Subject: Fix problems with hwtype initialisation. X-Git-Tag: v1.60~65 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6124ebc0d1a5bdd2a3d1753cf5e7cb1f990306c0;p=platform%2Fupstream%2Fnet-tools.git Fix problems with hwtype initialisation. Reported by Anthony Towns --- diff --git a/lib/arcnet.c b/lib/arcnet.c index 7f1abda..eb0f46e 100644 --- a/lib/arcnet.c +++ b/lib/arcnet.c @@ -2,7 +2,7 @@ * lib/arcnet.c This file contains an implementation of the "ARCnet" * support functions for the NET-2 base distribution. * - * Version: $Id: arcnet.c,v 1.5 1998/11/19 13:01:53 philip Exp $ + * Version: $Id: arcnet.c,v 1.6 2000/03/05 11:26:02 philip Exp $ * * Author: Fred N. van Kempen, * Copyright 1993 MicroWalt Corporation @@ -44,17 +44,6 @@ static char *pr_arcnet(unsigned char *ptr) } -/* Display an ARCnet socket address. */ -static char *pr_sarcnet(struct sockaddr *sap) -{ - static char buf[64]; - - if (sap->sa_family == 0xFFFF || sap->sa_family == 0) - return safe_strncpy(buf, _("[NONE SET]"), sizeof(buf)); - return (pr_arcnet(sap->sa_data)); -} - - /* Input an ARCnet address and convert to binary. */ static int in_arcnet(char *bufp, struct sockaddr *sap) { @@ -133,7 +122,7 @@ static int in_arcnet(char *bufp, struct sockaddr *sap) struct hwtype arcnet_hwtype = { "arcnet", NULL, /*"2.5Mbps ARCnet", */ ARPHRD_ARCNET, 1, - pr_arcnet, pr_sarcnet, in_arcnet, NULL + pr_arcnet, in_arcnet, NULL }; diff --git a/lib/fddi.c b/lib/fddi.c index 4ece844..f6bf5ca 100644 --- a/lib/fddi.c +++ b/lib/fddi.c @@ -2,7 +2,7 @@ * lib/fddi.c This file contains an implementation of the "FDDI" * support functions. * - * Version: $Id: fddi.c,v 1.6 1998/11/26 10:16:39 philip Exp $ + * Version: $Id: fddi.c,v 1.7 2000/03/05 11:26:02 philip Exp $ * * Author: Lawrence V. Stefani, * @@ -58,17 +58,6 @@ static char *pr_fddi(unsigned char *ptr) } -/* Display an FDDI socket address. */ -static char *pr_sfddi(struct sockaddr *sap) -{ - static char buf[64]; - - if (sap->sa_family == 0xFFFF || sap->sa_family == 0) - return safe_strncpy(buf, _("[NONE SET]"), sizeof(buf)); - return (pr_fddi(sap->sa_data)); -} - - /* Input an FDDI address and convert to binary. */ static int in_fddi(char *bufp, struct sockaddr *sap) { @@ -147,7 +136,7 @@ static int in_fddi(char *bufp, struct sockaddr *sap) struct hwtype fddi_hwtype = { "fddi", NULL, /*"Fiber Distributed Data Interface (FDDI)", */ ARPHRD_FDDI, FDDI_K_ALEN, - pr_fddi, pr_sfddi, in_fddi, NULL + pr_fddi, in_fddi, NULL }; diff --git a/lib/frame.c b/lib/frame.c index 1cfd88e..58d1ad4 100644 --- a/lib/frame.c +++ b/lib/frame.c @@ -1,7 +1,7 @@ /* * lib/frame.c This file contains the Frame Relay support. * - * Version: $Id: frame.c,v 1.3 1998/11/15 20:09:39 freitag Exp $ + * Version: $Id: frame.c,v 1.4 2000/03/05 11:26:02 philip Exp $ * * Maintainer: Bernd 'eckes' Eckenfels, * @@ -48,12 +48,12 @@ char *pr_dlci(unsigned char *ptr) struct hwtype dlci_hwtype = { "dlci", NULL, /*"Frame Relay DLCI", */ ARPHRD_DLCI, 3, - pr_dlci, NULL, NULL, NULL + pr_dlci, NULL, NULL, 0 }; struct hwtype frad_hwtype = { "frad", NULL, /*"Frame Relay Access Device", */ ARPHRD_FRAD, 0, - NULL, NULL, NULL, NULL + NULL, NULL, NULL, 0 }; #endif /* HAVE_HWFR */ diff --git a/lib/hdlclapb.c b/lib/hdlclapb.c index 1753745..c4ed074 100644 --- a/lib/hdlclapb.c +++ b/lib/hdlclapb.c @@ -3,7 +3,7 @@ * This file contains the HDLC/LAPB support for the NET-2 base * distribution. * - * Version: $Id: hdlclapb.c,v 1.4 1999/01/05 20:53:26 philip Exp $ + * Version: $Id: hdlclapb.c,v 1.5 2000/03/05 11:26:02 philip Exp $ * * Original Author: * Fred N. van Kempen, @@ -49,12 +49,12 @@ struct hwtype hdlc_hwtype = { "hdlc", NULL, /*"(Cisco) HDLC", */ ARPHRD_HDLC, 0, - NULL, NULL, NULL, NULL, + NULL, NULL, NULL, 0 }; struct hwtype lapb_hwtype = { "lapb", NULL, /*"LAPB", */ ARPHRD_LAPB, 0, - NULL, NULL, NULL, NULL, + NULL, NULL, NULL, 0 }; #endif /* HAVE_HWHDLCLAPB */ diff --git a/lib/hippi.c b/lib/hippi.c index 5e9885a..308db00 100644 --- a/lib/hippi.c +++ b/lib/hippi.c @@ -58,18 +58,6 @@ static char *pr_hippi(unsigned char *ptr) } -/* Display an HIPPI socket address. */ -static char * - pr_shippi(struct sockaddr *sap) -{ - static char buf[64]; - - if (sap->sa_family == 0xFFFF || sap->sa_family == 0) - return (safe_strncpy(buf, _("[NONE SET]"), 64)); - return (pr_hippi(sap->sa_data)); -} - - /* Input an HIPPI address and convert to binary. */ static int in_hippi(char *bufp, struct sockaddr *sap) { @@ -147,7 +135,7 @@ static int in_hippi(char *bufp, struct sockaddr *sap) struct hwtype hippi_hwtype = { "hippi", NULL, /*"HIPPI", */ ARPHRD_HIPPI, HIPPI_ALEN, - pr_hippi, pr_shippi, in_hippi, NULL + pr_hippi, in_hippi, NULL, 0 }; diff --git a/lib/irda.c b/lib/irda.c index cebffb6..fa147fe 100644 --- a/lib/irda.c +++ b/lib/irda.c @@ -67,22 +67,10 @@ static char *irda_print(unsigned char *ptr) return (buff); } -/* - * Function irda_sprint (sap) - * - * Print IrDA socket address - * - */ -static char *irda_sprint(struct sockaddr *sap) -{ - /* NOP */ - return NULL; -} - struct hwtype irda_hwtype = { "irda", NULL, ARPHRD_IRDA, 2, - irda_print, irda_sprint, NULL, NULL + irda_print, NULL, NULL, 0 }; #endif /* HAVE_xxIRDA */ diff --git a/lib/netrom.c b/lib/netrom.c index 4f86b10..1de9dc3 100644 --- a/lib/netrom.c +++ b/lib/netrom.c @@ -2,7 +2,7 @@ * lib/netrom.c This file contains an implementation of the "NET/ROM" * support functions for the NET-2 base distribution. * - * Version: $Id: netrom.c,v 1.7 1998/11/19 13:02:03 philip Exp $ + * Version: $Id: netrom.c,v 1.8 2000/03/05 11:26:03 philip Exp $ * * NOTE: I will redo this module as soon as I got the libax25.a * library sorted out. This library contains some useful @@ -152,14 +152,6 @@ static void NETROM_herror(char *text) } -static char *NETROM_hprint(struct sockaddr *sap) -{ - if (sap->sa_family == 0xFFFF || sap->sa_family == 0) - return ("[NONE SET]"); - return (NETROM_print(((struct sockaddr_ax25 *) sap)->sax25_call.ax25_call)); -} - - static int NETROM_hinput(char *bufp, struct sockaddr *sap) { if (NETROM_input(0, bufp, sap) < 0) @@ -194,7 +186,7 @@ static int KISS_init(int fd) struct hwtype netrom_hwtype = { "netrom", NULL, /* "AMPR NET/ROM", */ ARPHRD_NETROM, 7, - NETROM_print, NETROM_hprint, NETROM_hinput, NULL + NETROM_print, NETROM_hinput, NULL, 0 }; struct aftype netrom_aftype = diff --git a/lib/ppp.c b/lib/ppp.c index c05d4b7..8bf1499 100644 --- a/lib/ppp.c +++ b/lib/ppp.c @@ -2,7 +2,7 @@ * lib/ppp.c This file contains the SLIP support for the NET-2 base * distribution. * - * Version: $Id: ppp.c,v 1.3 1998/11/15 20:11:45 freitag Exp $ + * Version: $Id: ppp.c,v 1.4 2000/03/05 11:26:03 philip Exp $ * * Author: Fred N. van Kempen, * Copyright 1993 MicroWalt Corporation @@ -46,12 +46,10 @@ static int do_ppp(int fd) } - - struct hwtype ppp_hwtype = { "ppp", NULL, /*"Point-Point Protocol", */ ARPHRD_PPP, 0, - NULL, NULL, NULL, do_ppp + NULL, NULL, do_ppp, 0 }; diff --git a/lib/rose.c b/lib/rose.c index e2ddbe9..381226b 100644 --- a/lib/rose.c +++ b/lib/rose.c @@ -2,7 +2,7 @@ * lib/rose.c This file contains an implementation of the "ROSE" * support functions for the NET-2 base distribution. * - * Version: $Id: rose.c,v 1.6 1999/01/05 20:54:04 philip Exp $ + * Version: $Id: rose.c,v 1.7 2000/03/05 11:26:03 philip Exp $ * * Author: Terry Dawson, VK2KTJ, * based on ax25.c by: @@ -119,16 +119,6 @@ static void ROSE_herror(char *text) } -static char * - ROSE_hprint(struct sockaddr *sap) -{ - if (sap->sa_family == 0xFFFF || sap->sa_family == 0) - return _("[NONE SET]"); - - return (ROSE_print(((struct sockaddr_rose *) sap)->srose_addr.rose_addr)); -} - - static int ROSE_hinput(char *bufp, struct sockaddr *sap) { if (ROSE_input(0, bufp, sap) < 0) @@ -140,7 +130,7 @@ static int ROSE_hinput(char *bufp, struct sockaddr *sap) struct hwtype rose_hwtype = { "rose", NULL, /*"AMPR ROSE", */ ARPHRD_ROSE, 10, - ROSE_print, ROSE_hprint, ROSE_hinput, NULL + ROSE_print, ROSE_hinput, NULL }; struct aftype rose_aftype = diff --git a/lib/tunnel.c b/lib/tunnel.c index 2e8cf4b..19606c1 100644 --- a/lib/tunnel.c +++ b/lib/tunnel.c @@ -27,12 +27,6 @@ static char *pr_tunnel(unsigned char *ptr) } -static char *pr_stunnel(struct sockaddr *sap) -{ - return (""); -} - - static int in_tunnel(char *bufp, struct sockaddr *sap) { return (-1); @@ -42,7 +36,7 @@ static int in_tunnel(char *bufp, struct sockaddr *sap) struct hwtype tunnel_hwtype = { "tunnel", NULL, /*"IPIP Tunnel", */ ARPHRD_TUNNEL, 0, - pr_tunnel, pr_stunnel, in_tunnel, NULL + pr_tunnel, in_tunnel, NULL, 0 };