const'ify afswtch
This commit is contained in:
parent
1a5470cfdd
commit
c6266968d5
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: extern.h,v 1.4 2005/03/19 23:13:42 thorpej Exp $ */
|
/* $NetBSD: extern.h,v 1.5 2005/03/19 23:16:55 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1983, 1993
|
* Copyright (c) 1983, 1993
|
||||||
@ -42,14 +42,14 @@ struct afswtch {
|
|||||||
void *af_addreq;
|
void *af_addreq;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct afswtch *afp;
|
extern const struct afswtch *afp;
|
||||||
extern struct ifreq ifr;
|
extern struct ifreq ifr;
|
||||||
extern int s;
|
extern int s;
|
||||||
extern char name[30];
|
extern char name[30];
|
||||||
|
|
||||||
extern int zflag;
|
extern int zflag;
|
||||||
|
|
||||||
struct afswtch *lookup_af_byname(const char *);
|
const struct afswtch *lookup_af_byname(const char *);
|
||||||
struct afswtch *lookup_af_bynum(int);
|
const struct afswtch *lookup_af_bynum(int);
|
||||||
const char *get_string(const char *, const char *, u_int8_t *, int *);
|
const char *get_string(const char *, const char *, u_int8_t *, int *);
|
||||||
void print_string(const u_int8_t *, int);
|
void print_string(const u_int8_t *, int);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: ifconfig.c,v 1.159 2005/03/19 23:13:42 thorpej Exp $ */
|
/* $NetBSD: ifconfig.c,v 1.160 2005/03/19 23:16:55 thorpej Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
|
* Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
|
||||||
@ -76,7 +76,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
|
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: ifconfig.c,v 1.159 2005/03/19 23:13:42 thorpej Exp $");
|
__RCSID("$NetBSD: ifconfig.c,v 1.160 2005/03/19 23:16:55 thorpej Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ void iso_status(int);
|
|||||||
void iso_getaddr(const char *, int);
|
void iso_getaddr(const char *, int);
|
||||||
|
|
||||||
/* Known address families */
|
/* Known address families */
|
||||||
struct afswtch afs[] = {
|
const struct afswtch afs[] = {
|
||||||
{ "inet", AF_INET, in_status, in_getaddr, in_getprefix,
|
{ "inet", AF_INET, in_status, in_getaddr, in_getprefix,
|
||||||
SIOCDIFADDR, SIOCAIFADDR, SIOCGIFADDR, &ridreq, &in_addreq },
|
SIOCDIFADDR, SIOCAIFADDR, SIOCGIFADDR, &ridreq, &in_addreq },
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
@ -377,7 +377,7 @@ struct afswtch afs[] = {
|
|||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct afswtch *afp; /*the address family being set or asked about*/
|
const struct afswtch *afp; /*the address family being set or asked about*/
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
@ -653,10 +653,10 @@ main(int argc, char *argv[])
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct afswtch *
|
const struct afswtch *
|
||||||
lookup_af_byname(const char *cp)
|
lookup_af_byname(const char *cp)
|
||||||
{
|
{
|
||||||
struct afswtch *a;
|
const struct afswtch *a;
|
||||||
|
|
||||||
for (a = afs; a->af_name != NULL; a++)
|
for (a = afs; a->af_name != NULL; a++)
|
||||||
if (strcmp(a->af_name, cp) == 0)
|
if (strcmp(a->af_name, cp) == 0)
|
||||||
@ -664,10 +664,10 @@ lookup_af_byname(const char *cp)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct afswtch *
|
const struct afswtch *
|
||||||
lookup_af_bynum(int afnum)
|
lookup_af_bynum(int afnum)
|
||||||
{
|
{
|
||||||
struct afswtch *a;
|
const struct afswtch *a;
|
||||||
|
|
||||||
for (a = afs; a->af_name != NULL; a++)
|
for (a = afs; a->af_name != NULL; a++)
|
||||||
if (a->af_af == afnum)
|
if (a->af_af == afnum)
|
||||||
@ -1423,7 +1423,7 @@ const struct ifmedia_status_description ifm_status_descriptions[] =
|
|||||||
void
|
void
|
||||||
status(const struct sockaddr_dl *sdl)
|
status(const struct sockaddr_dl *sdl)
|
||||||
{
|
{
|
||||||
struct afswtch *p = afp;
|
const struct afswtch *p = afp;
|
||||||
struct ifmediareq ifmr;
|
struct ifmediareq ifmr;
|
||||||
struct ifdatareq ifdr;
|
struct ifdatareq ifdr;
|
||||||
int *media_list, i;
|
int *media_list, i;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: tunnel.c,v 1.3 2005/03/19 22:57:06 thorpej Exp $ */
|
/* $NetBSD: tunnel.c,v 1.4 2005/03/19 23:16:55 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1983, 1993
|
* Copyright (c) 1983, 1993
|
||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
__RCSID("$NetBSD: tunnel.c,v 1.3 2005/03/19 22:57:06 thorpej Exp $");
|
__RCSID("$NetBSD: tunnel.c,v 1.4 2005/03/19 23:16:55 thorpej Exp $");
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -141,7 +141,7 @@ tunnel_status(void)
|
|||||||
char pdstaddr[NI_MAXHOST];
|
char pdstaddr[NI_MAXHOST];
|
||||||
const int niflag = NI_NUMERICHOST;
|
const int niflag = NI_NUMERICHOST;
|
||||||
struct if_laddrreq req;
|
struct if_laddrreq req;
|
||||||
struct afswtch *lafp;
|
const struct afswtch *lafp;
|
||||||
|
|
||||||
psrcaddr[0] = pdstaddr[0] = '\0';
|
psrcaddr[0] = pdstaddr[0] = '\0';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user