summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-12 18:18:26 +0000
committerpfg <pfg@FreeBSD.org>2016-04-12 18:18:26 +0000
commita1311f3a3f2816ce39dd54076aade180cdc29d40 (patch)
tree690cf5e9a3348058271e63fa10e01b22c4610056
parent611644daf2cc6d8dd85237406c15e73876658754 (diff)
downloadFreeBSD-src-a1311f3a3f2816ce39dd54076aade180cdc29d40.zip
FreeBSD-src-a1311f3a3f2816ce39dd54076aade180cdc29d40.tar.gz
bootpd(8): De-register and minor cleanups.
For bootptest(8) also remuve an unused variable and replace 0 with a NULL for a pointer.
-rw-r--r--libexec/bootpd/getether.c4
-rw-r--r--libexec/bootpd/hash.c14
-rw-r--r--libexec/bootpd/hwaddr.c2
-rw-r--r--libexec/bootpd/readfile.c16
-rw-r--r--libexec/bootpd/rtmsg.c12
-rw-r--r--libexec/bootpd/tools/bootptest/bootptest.c4
-rw-r--r--libexec/bootpd/tools/bootptest/print-bootp.c19
7 files changed, 34 insertions, 37 deletions
diff --git a/libexec/bootpd/getether.c b/libexec/bootpd/getether.c
index e4dc1b6..56b7c8e 100644
--- a/libexec/bootpd/getether.c
+++ b/libexec/bootpd/getether.c
@@ -124,10 +124,10 @@ getether(ifname, eap)
char *eap; /* Ether address (output) */
{
int fd, rc = -1;
- register int n;
+ int n;
struct ifreq ibuf[16];
struct ifconf ifc;
- register struct ifreq *ifrp, *ifend;
+ struct ifreq *ifrp, *ifend;
/* Fetch the interface configuration */
fd = socket(AF_INET, SOCK_DGRAM, 0);
diff --git a/libexec/bootpd/hash.c b/libexec/bootpd/hash.c
index 146e87e..64f49d3 100644
--- a/libexec/bootpd/hash.c
+++ b/libexec/bootpd/hash.c
@@ -79,8 +79,8 @@ hash_tbl *
hash_Init(tablesize)
unsigned tablesize;
{
- register hash_tbl *hashtblptr;
- register unsigned totalsize;
+ hash_tbl *hashtblptr;
+ unsigned totalsize;
if (tablesize > 0) {
totalsize = sizeof(hash_tbl)
@@ -169,9 +169,9 @@ hash_Reset(hashtable, free_data)
unsigned
hash_HashFunction(string, len)
unsigned char *string;
- register unsigned len;
+ unsigned len;
{
- register unsigned accum;
+ unsigned accum;
accum = 0;
for (; len > 0; len--) {
@@ -195,7 +195,7 @@ hash_Exists(hashtable, hashcode, compare, key)
hash_cmpfp compare;
hash_datum *key;
{
- register hash_member *memberptr;
+ hash_member *memberptr;
memberptr = (hashtable->table)[hashcode % (hashtable->size)];
while (memberptr) {
@@ -345,8 +345,8 @@ hash_datum *
hash_NextEntry(hashtable)
hash_tbl *hashtable;
{
- register unsigned bucket;
- register hash_member *memberptr;
+ unsigned bucket;
+ hash_member *memberptr;
/*
* First try to pick up where we left off.
diff --git a/libexec/bootpd/hwaddr.c b/libexec/bootpd/hwaddr.c
index de264cc..ff99615 100644
--- a/libexec/bootpd/hwaddr.c
+++ b/libexec/bootpd/hwaddr.c
@@ -295,7 +295,7 @@ static u_char conv802table[256] =
void
haddr_conv802(addr_in, addr_out, len)
- register u_char *addr_in, *addr_out;
+ u_char *addr_in, *addr_out;
int len;
{
u_char *lim;
diff --git a/libexec/bootpd/readfile.c b/libexec/bootpd/readfile.c
index ab583d4..3c151be 100644
--- a/libexec/bootpd/readfile.c
+++ b/libexec/bootpd/readfile.c
@@ -428,7 +428,7 @@ readtab(force)
if (hp->flags.iaddr) {
nhosts++;
}
- /* Register by HW addr if known. */
+ /* by HW addr if known. */
if (hp->flags.htype && hp->flags.haddr) {
/* We will either insert it or free it. */
hp->linkcount++;
@@ -441,7 +441,7 @@ readtab(force)
continue;
}
}
- /* Register by IP addr if known. */
+ /* by IP addr if known. */
if (hp->flags.iaddr) {
hashcode = hash_HashFunction((u_char *) & (hp->iaddr.s_addr), 4);
if (hash_Insert(iphashtable, hashcode, nullcmp, hp, hp) < 0) {
@@ -452,7 +452,7 @@ readtab(force)
hp->linkcount++;
}
}
- /* Register by Name (always known) */
+ /* by Name (always known) */
hashcode = hash_HashFunction((u_char *) hp->hostname->string,
strlen(hp->hostname->string));
if (hash_Insert(nmhashtable, hashcode, nullcmp,
@@ -1305,7 +1305,7 @@ process_generic(src, dest, tagvalue)
PRIVATE boolean
goodname(hostname)
- register char *hostname;
+ char *hostname;
{
do {
if (!isalpha(*hostname++)) { /* First character must be a letter */
@@ -1524,7 +1524,7 @@ PRIVATE void
adjust(s)
char **s;
{
- register char *t;
+ char *t;
t = *s;
while (*t && (*t != ':')) {
@@ -1549,7 +1549,7 @@ PRIVATE void
eat_whitespace(s)
char **s;
{
- register char *t;
+ char *t;
t = *s;
while (*t && isspace(*t)) {
@@ -1668,7 +1668,7 @@ prs_inetaddr(src, result)
u_int32 *result;
{
char tmpstr[MAXSTRINGLEN];
- register u_int32 value;
+ u_int32 value;
u_int32 parts[4], *pp;
int n;
char *s, *t;
@@ -1853,7 +1853,7 @@ PRIVATE u_int32
get_u_long(src)
char **src;
{
- register u_int32 value, base;
+ u_int32 value, base;
char c;
/*
diff --git a/libexec/bootpd/rtmsg.c b/libexec/bootpd/rtmsg.c
index 09886fd..a3dbb8e 100644
--- a/libexec/bootpd/rtmsg.c
+++ b/libexec/bootpd/rtmsg.c
@@ -118,9 +118,9 @@ int bsd_arp_set(ia, eaddr, len)
char *eaddr;
int len;
{
- register struct sockaddr_in *sin = &sin_m;
- register struct sockaddr_dl *sdl;
- register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm);
+ struct sockaddr_in *sin = &sin_m;
+ struct sockaddr_dl *sdl;
+ struct rt_msghdr *rtm = &(m_rtmsg.m_rtm);
u_char *ea;
struct timespec tp;
int op = RTM_ADD;
@@ -179,9 +179,9 @@ static int rtmsg(cmd)
{
static int seq;
int rlen;
- register struct rt_msghdr *rtm = &m_rtmsg.m_rtm;
- register char *cp = m_rtmsg.m_space;
- register int l;
+ struct rt_msghdr *rtm = &m_rtmsg.m_rtm;
+ char *cp = m_rtmsg.m_space;
+ int l;
errno = 0;
bzero((char *)&m_rtmsg, sizeof(m_rtmsg));
diff --git a/libexec/bootpd/tools/bootptest/bootptest.c b/libexec/bootpd/tools/bootptest/bootptest.c
index bf27470..e25c1f0 100644
--- a/libexec/bootpd/tools/bootptest/bootptest.c
+++ b/libexec/bootpd/tools/bootptest/bootptest.c
@@ -466,9 +466,9 @@ send_request(s)
*/
int
printfn(s, ep)
- register u_char *s, *ep;
+ u_char *s, *ep;
{
- register u_char c;
+ u_char c;
putchar('"');
while ((c = *s++) != '\0') {
diff --git a/libexec/bootpd/tools/bootptest/print-bootp.c b/libexec/bootpd/tools/bootptest/print-bootp.c
index 3cdb65a..fddc4fb 100644
--- a/libexec/bootpd/tools/bootptest/print-bootp.c
+++ b/libexec/bootpd/tools/bootptest/print-bootp.c
@@ -100,8 +100,8 @@ bootp_print(bp, length, sport, dport)
/* Client's Hardware address */
if (bp->bp_hlen) {
- register struct ether_header *eh;
- register char *e;
+ struct ether_header *eh;
+ char *e;
TCHECK(bp->bp_chaddr[0], 6);
eh = (struct ether_header *) packetp;
@@ -110,8 +110,8 @@ bootp_print(bp, length, sport, dport)
else if (bp->bp_op == BOOTREPLY)
e = (char *) EDST(eh);
else
- e = 0;
- if (e == 0 || bcmp((char *) bp->bp_chaddr, e, 6))
+ e = NULL;
+ if (e == NULL || bcmp((char *) bp->bp_chaddr, e, 6))
dump_hex(bp->bp_chaddr, bp->bp_hlen);
}
/* Only print interesting fields */
@@ -274,12 +274,12 @@ rfc1048_opts[] = {
static void
rfc1048_print(bp, length)
- register u_char *bp;
+ u_char *bp;
int length;
{
u_char tag;
u_char *ep;
- register int len;
+ int len;
u_int32 ul;
u_short us;
struct in_addr ia;
@@ -376,11 +376,10 @@ rfc1048_print(bp, length)
static void
cmu_print(bp, length)
- register u_char *bp;
+ u_char *bp;
int length;
{
struct cmu_vend *v;
- u_char *ep;
printf("-cmu");
@@ -389,8 +388,6 @@ cmu_print(bp, length)
printf(" |L=%d", length);
return;
}
- /* Setup end pointer */
- ep = bp + length;
/* Subnet mask */
if (v->v_flags & VF_SMASK) {
@@ -427,7 +424,7 @@ cmu_print(bp, length)
static void
other_print(bp, length)
- register u_char *bp;
+ u_char *bp;
int length;
{
u_char *ep; /* end pointer */
OpenPOWER on IntegriCloud