Commit 97b31cee authored by Mike Frysinger's avatar Mike Frysinger

clean up const/unsigned pointers with aftype/hwtype structs

Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent 7ae4aa56
......@@ -434,7 +434,7 @@ static int arp_file(char *name)
/* Print the contents of an ARP request block. */
static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mask, char *dev)
static void arp_disp_2(const char *name, int type, int arp_flags, const char *hwa, const char *mask, const char *dev)
{
static int title = 0;
struct hwtype *xhw;
......@@ -484,7 +484,7 @@ static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mas
}
/* Print the contents of an ARP request block. */
static void arp_disp(char *name, char *ip, int type, int arp_flags, char *hwa, char *mask, char *dev)
static void arp_disp(const char *name, const char *ip, int type, int arp_flags, const char *hwa, const char *mask, const char *dev)
{
struct hwtype *xhw;
......@@ -538,7 +538,7 @@ static int arp_show(char *name)
char dev[100];
int type, flags;
FILE *fp;
char *hostname;
const char *hostname;
int num, entries = 0, showed = 0;
host[0] = '\0';
......
......@@ -35,7 +35,7 @@ extern struct hwtype arcnet_hwtype;
/* Display an ARCnet address in readable format. */
static char *pr_arcnet(unsigned char *ptr)
static const char *pr_arcnet(const char *ptr)
{
static char buff[64];
......
......@@ -31,8 +31,8 @@ static unsigned char hamming[16] =
};
/* Display an Ash address in readable format. */
static char *
pr_ash(unsigned char *ptr)
static const char *
pr_ash(const char *ptr)
{
static char buff[128];
char *p = buff;
......@@ -102,7 +102,7 @@ struct hwtype ash_hwtype =
#if HAVE_AFASH
/* Display an Ash socket address. */
static char *
static const char *
pr_sash(struct sockaddr *sap, int numeric)
{
static char buf[64];
......
......@@ -47,7 +47,7 @@ static char AX25_errmsg[128];
extern struct aftype ax25_aftype;
static char *AX25_print(unsigned char *ptr)
static const char *AX25_print(const char *ptr)
{
static char buff[8];
int i;
......@@ -66,7 +66,7 @@ static char *AX25_print(unsigned char *ptr)
/* Display an AX.25 socket address. */
static char *
static const char *
AX25_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
......
......@@ -32,7 +32,7 @@
#include "util.h"
/* Display a ddp domain address. */
static char *ddp_print(unsigned char *ptr)
static const char *ddp_print(const char *ptr)
{
static char buff[64];
struct sockaddr_at *sat = (struct sockaddr_at *) (ptr - 2);
......@@ -42,7 +42,7 @@ static char *ddp_print(unsigned char *ptr)
/* Display a ddp domain address. */
static char *ddp_sprint(struct sockaddr *sap, int numeric)
static const char *ddp_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
......
......@@ -32,8 +32,8 @@
/* Display an Econet address */
static char *
ec_print(unsigned char *ptr)
static const char *
ec_print(const char *ptr)
{
static char buff[64];
struct ec_addr *ec = (struct ec_addr *) ptr;
......@@ -43,7 +43,7 @@ ec_print(unsigned char *ptr)
/* Display an Econet socket address */
static char *
static const char *
ec_sprint(struct sockaddr *sap, int numeric)
{
struct sockaddr_ec *sec = (struct sockaddr_ec *) sap;
......@@ -51,7 +51,7 @@ ec_sprint(struct sockaddr *sap, int numeric)
if (sap->sa_family != AF_ECONET)
return _("[NONE SET]");
return ec_print((unsigned char *) &sec->addr);
return ec_print((const char *) &sec->addr);
}
static int
......
......@@ -35,7 +35,7 @@ extern struct hwtype ether_hwtype;
/* Display an Ethernet address in readable format. */
static char *pr_ether(unsigned char *ptr)
static const char *pr_ether(const char *ptr)
{
static char buff[64];
......
......@@ -49,7 +49,7 @@
struct hwtype eui64_hwtype;
/* Display an EUI-64 address in readable format. */
static char *pr_eui64( unsigned char *ptr )
static const char *pr_eui64(const char *ptr)
{
static char buff[64];
......
......@@ -46,7 +46,7 @@ extern struct hwtype fddi_hwtype;
/* Display an FDDI address in readable format. */
static char *pr_fddi(unsigned char *ptr)
static const char *pr_fddi(const char *ptr)
{
static char buff[64];
......
......@@ -37,7 +37,7 @@
#include "net-support.h"
#include "pathnames.h"
char *pr_dlci(unsigned char *ptr)
static const char *pr_dlci(const char *ptr)
{
static char buf[12];
......
......@@ -46,7 +46,7 @@ extern struct hwtype hippi_hwtype;
/* Display an HIPPI address in readable format. */
static char *pr_hippi(unsigned char *ptr)
static const char *pr_hippi(const char *ptr)
{
static char buff[64];
......
......@@ -36,7 +36,7 @@ extern struct hwtype ib_hwtype;
/* Display an InfiniBand address in readable format. */
static char *pr_ib(unsigned char *ptr)
static const char *pr_ib(const char *ptr)
{
static char buff[128];
char *pos;
......
......@@ -229,14 +229,14 @@ static void INET_reserror(char *text)
/* Display an Internet socket address. */
static char *INET_print(unsigned char *ptr)
static const char *INET_print(const char *ptr)
{
return (inet_ntoa((*(struct in_addr *) ptr)));
}
/* Display an Internet socket address. */
static char *INET_sprint(struct sockaddr *sap, int numeric)
static const char *INET_sprint(struct sockaddr *sap, int numeric)
{
static char buff[128];
......
......@@ -126,7 +126,7 @@ static void INET6_reserror(char *text)
/* Display an Internet socket address. */
static char *INET6_print(unsigned char *ptr)
static const char *INET6_print(const char *ptr)
{
static char name[80];
......@@ -137,7 +137,7 @@ static char *INET6_print(unsigned char *ptr)
/* Display an Internet socket address. */
/* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */
static char *INET6_sprint(struct sockaddr *sap, int numeric)
static const char *INET6_sprint(struct sockaddr *sap, int numeric)
{
static char buff[128];
......
......@@ -42,7 +42,7 @@
#endif
/* Display a ipx domain address. */
static char *IPX_print(unsigned char *ptr)
static const char *IPX_print(const char *ptr)
{
static char buff[64];
struct sockaddr_ipx *sipx = (struct sockaddr_ipx *) (ptr - 2);
......@@ -73,7 +73,7 @@ static char *IPX_print(unsigned char *ptr)
/* Display a ipx domain address. */
static char *IPX_sprint(struct sockaddr *sap, int numeric)
static const char *IPX_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
......
......@@ -59,7 +59,7 @@
* Print hardware address of interface
*
*/
static char *irda_print(unsigned char *ptr)
static const char *irda_print(const char *ptr)
{
static char buff[12];
......
......@@ -32,7 +32,7 @@
#include "util.h"
/* Display an UNSPEC address. */
static char *pr_unspec(unsigned char *ptr)
static const char *pr_unspec(const char *ptr)
{
static char buff[64];
char *pos;
......
......@@ -38,8 +38,8 @@ struct aftype {
char *title;
int af;
int alen;
char *(*print) (unsigned char *);
char *(*sprint) (struct sockaddr *, int numeric);
const char *(*print) (const char *);
const char *(*sprint) (struct sockaddr *, int numeric);
int (*input) (int type, char *bufp, struct sockaddr *);
void (*herror) (char *text);
int (*rprint) (int options);
......@@ -60,7 +60,7 @@ struct hwtype {
char *title;
int type;
int alen;
char *(*print) (unsigned char *);
const char *(*print) (const char *);
int (*input) (char *, struct sockaddr *);
int (*activate) (int fd);
int suppress_null_addr;
......
......@@ -52,7 +52,7 @@ static char netrom_errmsg[128];
extern struct aftype netrom_aftype;
static char *NETROM_print(unsigned char *ptr)
static const char *NETROM_print(const char *ptr)
{
static char buff[8];
int i;
......@@ -71,7 +71,7 @@ static char *NETROM_print(unsigned char *ptr)
/* Display an AX.25 socket address. */
static char *NETROM_sprint(struct sockaddr *sap, int numeric)
static const char *NETROM_sprint(struct sockaddr *sap, int numeric)
{
char buf[64];
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
......
......@@ -53,8 +53,8 @@ static char ROSE_errmsg[128];
extern struct aftype rose_aftype;
static char *
ROSE_print(unsigned char *ptr)
static const char *
ROSE_print(const char *ptr)
{
static char buff[12];
......@@ -64,7 +64,7 @@ static char *
}
/* Display a ROSE socket address. */
static char *
static const char *
ROSE_sprint(struct sockaddr *sap, int numeric)
{
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
......
......@@ -38,8 +38,8 @@
extern struct hwtype strip_hwtype;
static char *
pr_strip(unsigned char *ptr)
static const char *
pr_strip(const char *ptr)
{
static char buff[64];
if(ptr[1])
......
......@@ -39,7 +39,7 @@ extern struct hwtype tr_hwtype;
extern struct hwtype tr_hwtype1;
#endif
static char *pr_tr(unsigned char *ptr)
static const char *pr_tr(const char *ptr)
{
static char buff[64];
......
......@@ -21,7 +21,7 @@
extern struct hwtype ether_hwtype;
static char *pr_tunnel(unsigned char *ptr)
static const char *pr_tunnel(const char *ptr)
{
return ("");
}
......
......@@ -32,7 +32,7 @@
/* Display an UNSPEC address. */
static char *UNSPEC_print(unsigned char *ptr)
static const char *UNSPEC_print(const char *ptr)
{
static char buff[64];
char *pos;
......@@ -48,7 +48,7 @@ static char *UNSPEC_print(unsigned char *ptr)
/* Display an UNSPEC socket address. */
static char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
static const char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
......@@ -61,14 +61,14 @@ static char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
#if HAVE_AFUNIX
/* Display a UNIX domain address. */
static char *UNIX_print(unsigned char *ptr)
static const char *UNIX_print(const char *ptr)
{
return (ptr);
}
/* Display a UNIX domain address. */
static char *UNIX_sprint(struct sockaddr *sap, int numeric)
static const char *UNIX_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
......
......@@ -50,8 +50,8 @@ extern struct aftype x25_aftype;
#endif
static char *
X25_print(unsigned char *ptr)
static const char *
X25_print(const char *ptr)
{
static char buff[X25_ADDR_LEN+1];
......@@ -63,7 +63,7 @@ X25_print(unsigned char *ptr)
/* Display an X.25 socket address. */
static char *
static const char *
X25_sprint(struct sockaddr *sap, int numeric)
{
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment