diff options
author | mmcc <mmcc@cvs.openbsd.org> | 2015-11-16 00:16:40 +0000 |
---|---|---|
committer | mmcc <mmcc@cvs.openbsd.org> | 2015-11-16 00:16:40 +0000 |
commit | 0f68b27885cb5e3c1f31422aca81e64c44606c01 (patch) | |
tree | 9d002974a608151e86d04e20f4c9f4627444d7e4 | |
parent | fd9480bcad07aec3b821468b78bd02eeb7ba29e5 (diff) |
Remove remaining instances of the register keyword.
ok deraadt@
46 files changed, 404 insertions, 434 deletions
diff --git a/usr.sbin/tcpdump/print-decnet.c b/usr.sbin/tcpdump/print-decnet.c index ae3a856de6f..cfe32f79517 100644 --- a/usr.sbin/tcpdump/print-decnet.c +++ b/usr.sbin/tcpdump/print-decnet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-decnet.c,v 1.16 2015/11/07 21:58:05 mmcc Exp $ */ +/* $OpenBSD: print-decnet.c,v 1.17 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997 @@ -61,12 +61,11 @@ extern char *dnet_htoa(struct dn_naddr *); #endif void -decnet_print(register const u_char *ap, register u_int length, - register u_int caplen) +decnet_print(const u_char *ap, u_int length, u_int caplen) { static union routehdr rhcopy; - register union routehdr *rhp = &rhcopy; - register int mflags; + union routehdr *rhp = &rhcopy; + int mflags; int dst, src, hops; u_int rhlen, nsplen, pktlen; const u_char *nspp; @@ -178,11 +177,11 @@ trunc: } static int -print_decnet_ctlmsg(register const union routehdr *rhp, u_int length, +print_decnet_ctlmsg(const union routehdr *rhp, u_int length, u_int caplen) { int mflags = EXTRACT_LE_8BITS(rhp->rh_short.sh_flags); - register union controlmsg *cmp = (union controlmsg *)rhp; + union controlmsg *cmp = (union controlmsg *)rhp; int src, dst, info, blksize, eco, ueco, hello, other, vers; etheraddr srcea, rtea; int priority; @@ -850,7 +849,7 @@ static struct tok reason2str[] = { }; static void -print_reason(register int reason) +print_reason(int reason) { printf("%s ", tok2str(reason2str, "reason-%d", reason)); } diff --git a/usr.sbin/tcpdump/print-dhcp6.c b/usr.sbin/tcpdump/print-dhcp6.c index fd111244c17..08661d92c64 100644 --- a/usr.sbin/tcpdump/print-dhcp6.c +++ b/usr.sbin/tcpdump/print-dhcp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-dhcp6.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-dhcp6.c,v 1.9 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (C) 1998 and 1999 WIDE Project. @@ -223,7 +223,7 @@ trunc: * Print dhcp6 requests */ void -dhcp6_print(register const u_char *cp, u_int length, +dhcp6_print(const u_char *cp, u_int length, u_short sport, u_short dport) { union dhcp6 *dh6; diff --git a/usr.sbin/tcpdump/print-domain.c b/usr.sbin/tcpdump/print-domain.c index 211fc3a2b31..abebc29eb2e 100644 --- a/usr.sbin/tcpdump/print-domain.c +++ b/usr.sbin/tcpdump/print-domain.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-domain.c,v 1.21 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-domain.c,v 1.22 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -64,9 +64,9 @@ static const char *ns_resp[] = { /* skip over a domain name */ static const u_char * -ns_nskip(register const u_char *cp) +ns_nskip(const u_char *cp) { - register u_char i; + u_char i; if (!TTEST2(*cp, 1)) return (NULL); @@ -134,7 +134,7 @@ trunc: static int labellen(const u_char *cp) { - register u_int i; + u_int i; if (!TTEST2(*cp, 1)) return(-1); @@ -155,11 +155,11 @@ labellen(const u_char *cp) } static const u_char * -ns_nprint(register const u_char *cp, register const u_char *bp) +ns_nprint(const u_char *cp, const u_char *bp) { - register u_int i, l; - register const u_char *rp = NULL; - register int compress = 0; + u_int i, l; + const u_char *rp = NULL; + int compress = 0; int chars_processed; int elt; int data_size = snapend - bp; @@ -239,9 +239,9 @@ ns_nprint(register const u_char *cp, register const u_char *bp) /* print a <character-string> */ static const u_char * -ns_cprint(register const u_char *cp) +ns_cprint(const u_char *cp) { - register u_int i; + u_int i; if (!TTEST2(*cp, 1)) return (NULL); @@ -327,10 +327,10 @@ struct tok ns_class2str[] = { /* print a query */ static const u_char * -ns_qprint(register const u_char *cp, register const u_char *bp, int is_mdns) +ns_qprint(const u_char *cp, const u_char *bp, int is_mdns) { - register const u_char *np = cp; - register u_int i, class; + const u_char *np = cp; + u_int i, class; cp = ns_nskip(cp); @@ -360,11 +360,11 @@ ns_qprint(register const u_char *cp, register const u_char *bp, int is_mdns) /* print a reply */ static const u_char * -ns_rprint(register const u_char *cp, register const u_char *bp, int is_mdns) +ns_rprint(const u_char *cp, const u_char *bp, int is_mdns) { - register u_int i, class, opt_flags = 0; - register u_short typ, len; - register const u_char *rp; + u_int i, class, opt_flags = 0; + u_short typ, len; + const u_char *rp; if (vflag) { putchar(' '); @@ -572,11 +572,11 @@ ns_rprint(register const u_char *cp, register const u_char *bp, int is_mdns) } void -ns_print(register const u_char *bp, u_int length, int is_mdns) +ns_print(const u_char *bp, u_int length, int is_mdns) { - register const HEADER *np; - register int qdcount, ancount, nscount, arcount; - register const u_char *cp; + const HEADER *np; + int qdcount, ancount, nscount, arcount; + const u_char *cp; u_int16_t b2; np = (const HEADER *)bp; diff --git a/usr.sbin/tcpdump/print-dvmrp.c b/usr.sbin/tcpdump/print-dvmrp.c index 4d841278831..0573a7d4cee 100644 --- a/usr.sbin/tcpdump/print-dvmrp.c +++ b/usr.sbin/tcpdump/print-dvmrp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-dvmrp.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-dvmrp.c,v 1.9 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1995, 1996 @@ -76,10 +76,10 @@ static void print_graft_ack(const u_char *, const u_char *, u_int); static u_int32_t target_level; void -dvmrp_print(register const u_char *bp, register u_int len) +dvmrp_print(const u_char *bp, u_int len) { - register const u_char *ep; - register u_char type; + const u_char *ep; + u_char type; ep = (const u_char *)snapend; if (bp >= ep) @@ -155,11 +155,10 @@ dvmrp_print(register const u_char *bp, register u_int len) } static void -print_report(register const u_char *bp, register const u_char *ep, - register u_int len) +print_report(const u_char *bp, const u_char *ep, u_int len) { - register u_int32_t mask, origin; - register int metric, i, width, done; + u_int32_t mask, origin; + int metric, i, width, done; while (len > 0) { if (len < 3) { @@ -206,10 +205,9 @@ print_report(register const u_char *bp, register const u_char *ep, #define GET_ADDR(to) (memcpy((char *)to, (char *)bp, 4), bp += 4) static void -print_probe(register const u_char *bp, register const u_char *ep, - register u_int len) +print_probe(const u_char *bp, const u_char *ep, u_int len) { - register u_int32_t genid; + u_int32_t genid; u_char neighbor[4]; if ((len < 4) || ((bp + 4) > ep)) { @@ -234,13 +232,12 @@ print_probe(register const u_char *bp, register const u_char *ep, } static void -print_neighbors(register const u_char *bp, register const u_char *ep, - register u_int len) +print_neighbors(const u_char *bp, const u_char *ep, u_int len) { u_char laddr[4], neighbor[4]; - register u_char metric; - register u_char thresh; - register int ncount; + u_char metric; + u_char thresh; + int ncount; while (len > 0 && bp < ep) { if (len < 7 || (bp + 7) >= ep) { @@ -263,12 +260,11 @@ print_neighbors(register const u_char *bp, register const u_char *ep, } static void -print_neighbors2(register const u_char *bp, register const u_char *ep, - register u_int len) +print_neighbors2(const u_char *bp, const u_char *ep, u_int len) { u_char laddr[4], neighbor[4]; - register u_char metric, thresh, flags; - register int ncount; + u_char metric, thresh, flags; + int ncount; printf(" (v %d.%d):", (int)target_level & 0xff, @@ -311,8 +307,7 @@ print_neighbors2(register const u_char *bp, register const u_char *ep, } static void -print_prune(register const u_char *bp, register const u_char *ep, - register u_int len) +print_prune(const u_char *bp, const u_char *ep, u_int len) { union a { u_char b[4]; @@ -330,8 +325,7 @@ print_prune(register const u_char *bp, register const u_char *ep, } static void -print_graft(register const u_char *bp, register const u_char *ep, - register u_int len) +print_graft(const u_char *bp, const u_char *ep, u_int len) { if (len < 8 || (bp + 8) > ep) { @@ -342,8 +336,7 @@ print_graft(register const u_char *bp, register const u_char *ep, } static void -print_graft_ack(register const u_char *bp, register const u_char *ep, - register u_int len) +print_graft_ack(const u_char *bp, const u_char *ep, u_int len) { if (len < 8 || (bp + 8) > ep) { diff --git a/usr.sbin/tcpdump/print-ether.c b/usr.sbin/tcpdump/print-ether.c index cffb77562b7..0dc454802b0 100644 --- a/usr.sbin/tcpdump/print-ether.c +++ b/usr.sbin/tcpdump/print-ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ether.c,v 1.29 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-ether.c,v 1.30 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -54,9 +54,9 @@ const u_char *snapend; void ether_macctl(const u_char *, u_int); void -ether_print(register const u_char *bp, u_int length) +ether_print(const u_char *bp, u_int length) { - register const struct ether_header *ep; + const struct ether_header *ep; ep = (const struct ether_header *)bp; if (qflag) { diff --git a/usr.sbin/tcpdump/print-fddi.c b/usr.sbin/tcpdump/print-fddi.c index baa1597107a..f8681f243a0 100644 --- a/usr.sbin/tcpdump/print-fddi.c +++ b/usr.sbin/tcpdump/print-fddi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-fddi.c,v 1.16 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-fddi.c,v 1.17 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -198,7 +198,7 @@ print_fddi_fc(u_char fc) static inline void extract_fddi_addrs(const struct fddi_header *fddip, char *fsrc, char *fdst) { - register int i; + int i; if (fddi_bitswap) { /* @@ -220,8 +220,8 @@ extract_fddi_addrs(const struct fddi_header *fddip, char *fsrc, char *fdst) * Print the FDDI MAC header */ static inline void -fddi_print(register const struct fddi_header *fddip, register u_int length, - register const u_char *fsrc, register const u_char *fdst) +fddi_print(const struct fddi_header *fddip, u_int length, + const u_char *fsrc, const u_char *fdst) { char *srcname, *dstname; @@ -255,7 +255,7 @@ fddi_smt_print(const u_char *p, u_int length) */ void fddi_if_print(u_char *pcap, const struct pcap_pkthdr *h, - register const u_char *p) + const u_char *p) { u_int caplen = h->caplen; u_int length = h->len; @@ -338,7 +338,7 @@ out: #include "interface.h" void fddi_if_print(u_char *pcap, const struct pcap_pkthdr *h, - register const u_char *p) + const u_char *p) { error("not configured for fddi"); diff --git a/usr.sbin/tcpdump/print-frag6.c b/usr.sbin/tcpdump/print-frag6.c index be4c4a464d1..40a97f162d5 100644 --- a/usr.sbin/tcpdump/print-frag6.c +++ b/usr.sbin/tcpdump/print-frag6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-frag6.c,v 1.7 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-frag6.c,v 1.8 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994 @@ -46,11 +46,11 @@ #include "addrtoname.h" int -frag6_print(register const u_char *bp, register const u_char *bp2) +frag6_print(const u_char *bp, const u_char *bp2) { - register const struct ip6_frag *dp; - register const struct ip6_hdr *ip6; - register const u_char *ep; + const struct ip6_frag *dp; + const struct ip6_hdr *ip6; + const u_char *ep; #if 0 #define TCHECK(var) if ((u_char *)&(var) >= ep - sizeof(var)) goto trunc diff --git a/usr.sbin/tcpdump/print-gtp.c b/usr.sbin/tcpdump/print-gtp.c index e977719b849..444266bb52f 100644 --- a/usr.sbin/tcpdump/print-gtp.c +++ b/usr.sbin/tcpdump/print-gtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-gtp.c,v 1.7 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-gtp.c,v 1.8 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 2009, 2010 Joel Sing <jsing@openbsd.org> * @@ -57,24 +57,24 @@ #include "interface.h" #include "gtp.h" -void gtp_print(register const u_char *, u_int, u_short, u_short); -void gtp_decode_ie(register const u_char *, u_short, int); -void gtp_print_tbcd(register const u_char *, u_int); -void gtp_print_user_address(register const u_char *, u_int); -void gtp_print_apn(register const u_char *, u_int); +void gtp_print(const u_char *, u_int, u_short, u_short); +void gtp_decode_ie(const u_char *, u_short, int); +void gtp_print_tbcd(const u_char *, u_int); +void gtp_print_user_address(const u_char *, u_int); +void gtp_print_apn(const u_char *, u_int); void gtp_print_str(const char **, u_int); void gtp_v0_print(const u_char *, u_int, u_short, u_short); -void gtp_v0_print_prime(register const u_char *); -int gtp_v0_print_tv(register const u_char *, u_int); -int gtp_v0_print_tlv(register const u_char *, u_int); +void gtp_v0_print_prime(const u_char *); +int gtp_v0_print_tv(const u_char *, u_int); +int gtp_v0_print_tlv(const u_char *, u_int); void gtp_v1_print(const u_char *, u_int, u_short, u_short); -void gtp_v1_print_ctrl(register const u_char *, u_int, struct gtp_v1_hdr *); -void gtp_v1_print_user(register const u_char *, u_int, struct gtp_v1_hdr *); -void gtp_v1_print_prime(register const u_char *, struct gtp_v1_prime_hdr *); -int gtp_v1_print_tv(register const u_char *, u_int); -int gtp_v1_print_tlv(register const u_char *, u_int); +void gtp_v1_print_ctrl(const u_char *, u_int, struct gtp_v1_hdr *); +void gtp_v1_print_user(const u_char *, u_int, struct gtp_v1_hdr *); +void gtp_v1_print_prime(const u_char *, struct gtp_v1_prime_hdr *); +int gtp_v1_print_tv(const u_char *, u_int); +int gtp_v1_print_tlv(const u_char *, u_int); /* GTPv0 message types. */ static struct tok gtp_v0_msgtype[] = { @@ -291,7 +291,7 @@ static struct tok gtp_v1_cause[] = { static int gtp_proto = -1; void -gtp_print(register const u_char *cp, u_int length, u_short sport, u_short dport) +gtp_print(const u_char *cp, u_int length, u_short sport, u_short dport) { int version; @@ -318,7 +318,7 @@ trunc: * decoding routine. */ void -gtp_decode_ie(register const u_char *cp, u_short version, int len) +gtp_decode_ie(const u_char *cp, u_short version, int len) { int val, ielen, iecount = 0; @@ -382,7 +382,7 @@ trunc: * Decode and print telephony binary coded decimal. */ void -gtp_print_tbcd(register const u_char *cp, u_int len) +gtp_print_tbcd(const u_char *cp, u_int len) { u_int8_t *data, bcd; int i; @@ -404,7 +404,7 @@ gtp_print_tbcd(register const u_char *cp, u_int len) * GSM 09.60 section 7.9.18 and 3GPP 29.060 section 7.7.27. */ void -gtp_print_user_address(register const u_char *cp, u_int len) +gtp_print_user_address(const u_char *cp, u_int len) { u_int8_t org, type; @@ -439,7 +439,7 @@ gtp_print_user_address(register const u_char *cp, u_int len) * 3GPP 24.008 section 10.5.6.1 and 3GPP 23.003 section 9.1. */ void -gtp_print_apn(register const u_char *cp, u_int len) +gtp_print_apn(const u_char *cp, u_int len) { u_char label[100]; u_int8_t llen; @@ -539,7 +539,7 @@ trunc: } void -gtp_v0_print_prime(register const u_char *cp) +gtp_v0_print_prime(const u_char *cp) { struct gtp_v0_prime_hdr *gph = (struct gtp_v0_prime_hdr *)cp; int len; @@ -564,7 +564,7 @@ trunc: } int -gtp_v0_print_tv(register const u_char *cp, u_int value) +gtp_v0_print_tv(const u_char *cp, u_int value) { u_int32_t *dpl; u_int16_t *dps; @@ -753,7 +753,7 @@ trunc: } int -gtp_v0_print_tlv(register const u_char *cp, u_int value) +gtp_v0_print_tlv(const u_char *cp, u_int value) { u_int8_t data; u_int16_t *lenp, *seqno, len; @@ -980,7 +980,7 @@ trunc: } void -gtp_v1_print_ctrl(register const u_char *cp, u_int hlen, struct gtp_v1_hdr *gh) +gtp_v1_print_ctrl(const u_char *cp, u_int hlen, struct gtp_v1_hdr *gh) { int len; @@ -993,7 +993,7 @@ gtp_v1_print_ctrl(register const u_char *cp, u_int hlen, struct gtp_v1_hdr *gh) } void -gtp_v1_print_user(register const u_char *cp, u_int hlen, struct gtp_v1_hdr *gh) +gtp_v1_print_user(const u_char *cp, u_int hlen, struct gtp_v1_hdr *gh) { int len, version; @@ -1033,7 +1033,7 @@ trunc: } void -gtp_v1_print_prime(register const u_char *cp, struct gtp_v1_prime_hdr *gph) +gtp_v1_print_prime(const u_char *cp, struct gtp_v1_prime_hdr *gph) { int len; @@ -1057,7 +1057,7 @@ trunc: } int -gtp_v1_print_tv(register const u_char *cp, u_int value) +gtp_v1_print_tv(const u_char *cp, u_int value) { u_int32_t *dpl; u_int16_t *dps; @@ -1347,7 +1347,7 @@ trunc: } int -gtp_v1_print_tlv(register const u_char *cp, u_int value) +gtp_v1_print_tlv(const u_char *cp, u_int value) { u_int8_t data; u_int16_t *lenp, *seqno, len; diff --git a/usr.sbin/tcpdump/print-hsrp.c b/usr.sbin/tcpdump/print-hsrp.c index 523971d9bf1..4ac5b109e35 100644 --- a/usr.sbin/tcpdump/print-hsrp.c +++ b/usr.sbin/tcpdump/print-hsrp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-hsrp.c,v 1.4 2009/10/27 23:59:55 deraadt Exp $ */ +/* $OpenBSD: print-hsrp.c,v 1.5 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (C) 2001 Julian Cowley @@ -96,7 +96,7 @@ struct hsrp { }; void -hsrp_print(register const u_char *bp, register u_int len) +hsrp_print(const u_char *bp, u_int len) { struct hsrp *hp = (struct hsrp *) bp; diff --git a/usr.sbin/tcpdump/print-icmp6.c b/usr.sbin/tcpdump/print-icmp6.c index d6825f1e8db..969324fab0d 100644 --- a/usr.sbin/tcpdump/print-icmp6.c +++ b/usr.sbin/tcpdump/print-icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-icmp6.c,v 1.16 2015/11/02 17:48:33 sthen Exp $ */ +/* $OpenBSD: print-icmp6.c,v 1.17 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994 @@ -125,13 +125,13 @@ icmp6_cksum(const struct ip6_hdr *ip6, const struct icmp6_hdr *icmp6, void icmp6_print(const u_char *bp, u_int length, const u_char *bp2) { - register const struct icmp6_hdr *dp; - register const struct ip6_hdr *ip; - register const char *str; - register const struct ip6_hdr *oip; - register const struct udphdr *ouh; - register int hlen, dport; - register const u_char *ep; + const struct icmp6_hdr *dp; + const struct ip6_hdr *ip; + const char *str; + const struct ip6_hdr *oip; + const struct udphdr *ouh; + int hlen, dport; + const u_char *ep; char buf[256]; int icmp6len; @@ -504,22 +504,22 @@ trunc: } void -icmp6_opt_print(register const u_char *bp, int resid) +icmp6_opt_print(const u_char *bp, int resid) { - register const struct nd_opt_hdr *op; - register const struct nd_opt_hdr *opl; /* why there's no struct? */ - register const struct nd_opt_prefix_info *opp; - register const struct icmp6_opts_redirect *opr; - register const struct nd_opt_mtu *opm; - register const struct nd_opt_rdnss *oprd; - register const u_char *ep; + const struct nd_opt_hdr *op; + const struct nd_opt_hdr *opl; /* why there's no struct? */ + const struct nd_opt_prefix_info *opp; + const struct icmp6_opts_redirect *opr; + const struct nd_opt_mtu *opm; + const struct nd_opt_rdnss *oprd; + const u_char *ep; int i, opts_len; #if 0 - register const struct ip6_hdr *ip; - register const char *str; - register const struct ip6_hdr *oip; - register const struct udphdr *ouh; - register int hlen, dport; + const struct ip6_hdr *ip; + const char *str; + const struct ip6_hdr *oip; + const struct udphdr *ouh; + int hlen, dport; char buf[256]; #endif @@ -676,10 +676,10 @@ icmp6_opt_print(register const u_char *bp, int resid) } void -mld6_print(register const u_char *bp) +mld6_print(const u_char *bp) { - register struct mld_hdr *mp = (struct mld_hdr *)bp; - register const u_char *ep; + struct mld_hdr *mp = (struct mld_hdr *)bp; + const u_char *ep; /* 'ep' points to the end of avaible data. */ ep = snapend; diff --git a/usr.sbin/tcpdump/print-igrp.c b/usr.sbin/tcpdump/print-igrp.c index 636e3dafcd8..1baab1b3f4d 100644 --- a/usr.sbin/tcpdump/print-igrp.c +++ b/usr.sbin/tcpdump/print-igrp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-igrp.c,v 1.7 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-igrp.c,v 1.8 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1996, 1997 @@ -41,10 +41,9 @@ #include "extract.h" /* must come after interface.h */ static void -igrp_entry_print(register struct igrprte *igr, register int is_interior, - register int is_exterior) +igrp_entry_print(struct igrprte *igr, int is_interior, int is_exterior) { - register u_int delay, bandwidth; + u_int delay, bandwidth; u_int metric, mtu; if (is_interior) @@ -77,11 +76,11 @@ static struct tok op2str[] = { }; void -igrp_print(register const u_char *bp, u_int length, register const u_char *bp2) +igrp_print(const u_char *bp, u_int length, const u_char *bp2) { - register struct igrphdr *hdr; - register struct ip *ip; - register u_char *cp; + struct igrphdr *hdr; + struct ip *ip; + u_char *cp; u_int nint, nsys, next; hdr = (struct igrphdr *)bp; diff --git a/usr.sbin/tcpdump/print-ip.c b/usr.sbin/tcpdump/print-ip.c index 1920ab64111..a5475941479 100644 --- a/usr.sbin/tcpdump/print-ip.c +++ b/usr.sbin/tcpdump/print-ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ip.c,v 1.44 2015/08/21 02:07:32 deraadt Exp $ */ +/* $OpenBSD: print-ip.c,v 1.45 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -123,9 +123,9 @@ struct tr_resp { #define TR_PROTO_PIM 3 #define TR_PROTO_CBT 4 -static void print_mtrace(register const u_char *bp, register u_int len) +static void print_mtrace(const u_char *bp, u_int len) { - register struct tr_query *tr = (struct tr_query *)(bp + 8); + struct tr_query *tr = (struct tr_query *)(bp + 8); printf("mtrace %d: %s to %s reply-to %s", tr->tr_qid, ipaddr_string(&tr->tr_src), ipaddr_string(&tr->tr_dst), @@ -134,9 +134,9 @@ static void print_mtrace(register const u_char *bp, register u_int len) printf(" with-ttl %d", tr->tr_rttl); } -static void print_mresp(register const u_char *bp, register u_int len) +static void print_mresp(const u_char *bp, u_int len) { - register struct tr_query *tr = (struct tr_query *)(bp + 8); + struct tr_query *tr = (struct tr_query *)(bp + 8); printf("mresp %d: %s to %s reply-to %s", tr->tr_qid, ipaddr_string(&tr->tr_src), ipaddr_string(&tr->tr_dst), @@ -146,10 +146,9 @@ static void print_mresp(register const u_char *bp, register u_int len) } static void -igmp_print(register const u_char *bp, register u_int len, - register const u_char *bp2) +igmp_print(const u_char *bp, u_int len, const u_char *bp2) { - register const struct ip *ip; + const struct ip *ip; ip = (const struct ip *)bp2; (void)printf("%s > %s: ", @@ -226,10 +225,10 @@ trunc: * print the recorded route in an IP RR, LSRR or SSRR option. */ static void -ip_printroute(const char *type, register const u_char *cp, u_int length) +ip_printroute(const char *type, const u_char *cp, u_int length) { - register u_int ptr = cp[2] - 1; - register u_int len; + u_int ptr = cp[2] - 1; + u_int len; printf(" %s{", type); if ((length + 1) & 3) @@ -251,9 +250,9 @@ ip_printroute(const char *type, register const u_char *cp, u_int length) * print IP options. */ static void -ip_optprint(register const u_char *cp, u_int length) +ip_optprint(const u_char *cp, u_int length) { - register u_int len; + u_int len; int tt; for (; length > 0; cp += len, length -= len) { @@ -317,7 +316,7 @@ trunc: * don't modifiy the packet. */ u_short -in_cksum(const u_short *addr, register int len, int csum) +in_cksum(const u_short *addr, int len, int csum) { int nleft = len; const u_short *w = addr; @@ -350,11 +349,11 @@ in_cksum(const u_short *addr, register int len, int csum) * print an IP datagram. */ void -ip_print(register const u_char *bp, register u_int length) +ip_print(const u_char *bp, u_int length) { - register const struct ip *ip; - register u_int hlen, len, off; - register const u_char *cp; + const struct ip *ip; + u_int hlen, len, off; + const u_char *cp; const u_char *pktp = packetp; const u_char *send = snapend; diff --git a/usr.sbin/tcpdump/print-ip6.c b/usr.sbin/tcpdump/print-ip6.c index 08c6e8b2bb7..0f4b0efc0ef 100644 --- a/usr.sbin/tcpdump/print-ip6.c +++ b/usr.sbin/tcpdump/print-ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ip6.c,v 1.22 2015/08/21 02:07:32 deraadt Exp $ */ +/* $OpenBSD: print-ip6.c,v 1.23 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 @@ -49,12 +49,12 @@ * print an IP6 datagram. */ void -ip6_print(register const u_char *bp, register u_int length) +ip6_print(const u_char *bp, u_int length) { - register const struct ip6_hdr *ip6; - register int hlen; - register int len; - register const u_char *cp; + const struct ip6_hdr *ip6; + int hlen; + int len; + const u_char *cp; const u_char *pktp = packetp; const u_char *send = snapend; int nh; diff --git a/usr.sbin/tcpdump/print-ip6opts.c b/usr.sbin/tcpdump/print-ip6opts.c index 9e7acf829a1..eb2e9c602ac 100644 --- a/usr.sbin/tcpdump/print-ip6opts.c +++ b/usr.sbin/tcpdump/print-ip6opts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ip6opts.c,v 1.4 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-ip6opts.c,v 1.5 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (C) 1998 WIDE Project. @@ -105,10 +105,10 @@ trunc: } int -hbhopt_print(register const u_char *bp) +hbhopt_print(const u_char *bp) { const struct ip6_hbh *dp = (struct ip6_hbh *)bp; - register const u_char *ep; + const u_char *ep; int hbhlen = 0; /* 'ep' points to the end of avaible data. */ @@ -128,10 +128,10 @@ hbhopt_print(register const u_char *bp) } int -dstopt_print(register const u_char *bp) +dstopt_print(const u_char *bp) { const struct ip6_dest *dp = (struct ip6_dest *)bp; - register const u_char *ep; + const u_char *ep; int dstoptlen = 0; /* 'ep' points to the end of avaible data. */ diff --git a/usr.sbin/tcpdump/print-ipsec.c b/usr.sbin/tcpdump/print-ipsec.c index 5ca7e6bd77c..32b9d177393 100644 --- a/usr.sbin/tcpdump/print-ipsec.c +++ b/usr.sbin/tcpdump/print-ipsec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ipsec.c,v 1.22 2015/10/11 03:23:28 guenther Exp $ */ +/* $OpenBSD: print-ipsec.c,v 1.23 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 @@ -199,8 +199,7 @@ esp_decrypt (const u_char *bp, u_int len, const u_char *bp2) } void -esp_print (register const u_char *bp, register u_int len, - register const u_char *bp2) +esp_print (const u_char *bp, u_int len, const u_char *bp2) { const struct ip *ip; const struct esp_hdr *esp; @@ -247,8 +246,7 @@ struct ah_hdr { }; void -ah_print (register const u_char *bp, register u_int len, - register const u_char *bp2) +ah_print (const u_char *bp, u_int len, const u_char *bp2) { const struct ip *ip; const struct ah_hdr *ah; @@ -342,8 +340,7 @@ struct ipcomp_hdr { }; void -ipcomp_print (register const u_char *bp, register u_int len, - register const u_char *bp2) +ipcomp_print (const u_char *bp, u_int len, const u_char *bp2) { const struct ip *ip; const struct ipcomp_hdr *ipc; diff --git a/usr.sbin/tcpdump/print-ipx.c b/usr.sbin/tcpdump/print-ipx.c index b72f5367cad..2a9f80449e7 100644 --- a/usr.sbin/tcpdump/print-ipx.c +++ b/usr.sbin/tcpdump/print-ipx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ipx.c,v 1.14 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-ipx.c,v 1.15 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1994, 1995, 1996 @@ -90,7 +90,7 @@ ipxaddr_string(u_int32_t net, const u_char *node) void ipx_decode(const struct ipxHdr *ipx, const u_char *datap, u_int length) { - register u_short dstSkt; + u_short dstSkt; dstSkt = EXTRACT_16BITS(&ipx->dstSkt); switch (dstSkt) { diff --git a/usr.sbin/tcpdump/print-isoclns.c b/usr.sbin/tcpdump/print-isoclns.c index 12df60a81d5..352508644d5 100644 --- a/usr.sbin/tcpdump/print-isoclns.c +++ b/usr.sbin/tcpdump/print-isoclns.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-isoclns.c,v 1.12 2009/10/27 23:59:55 deraadt Exp $ */ +/* $OpenBSD: print-isoclns.c,v 1.13 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1992, 1993, 1994, 1995, 1996 @@ -294,7 +294,7 @@ esis_print(const u_char *p, u_int length) } static int -osi_cksum(register const u_char *p, register u_int len, +osi_cksum(const u_char *p, u_int len, const u_char *toff, u_char *cksum, u_char *off) { const u_char *ep; diff --git a/usr.sbin/tcpdump/print-krb.c b/usr.sbin/tcpdump/print-krb.c index 7a27cba9702..c0e664df905 100644 --- a/usr.sbin/tcpdump/print-krb.c +++ b/usr.sbin/tcpdump/print-krb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-krb.c,v 1.10 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-krb.c,v 1.11 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1995, 1996, 1997 @@ -39,7 +39,7 @@ #include "interface.h" #include "addrtoname.h" -const u_char *c_print(register const u_char *, register const u_char *); +const u_char *c_print(const u_char *, const u_char *); const u_char *krb4_print_hdr(const u_char *); void krb4_print(const u_char *); void krb_print(const u_char *, u_int); @@ -122,10 +122,10 @@ static struct tok kerr2str[] = { const u_char * -c_print(register const u_char *s, register const u_char *ep) +c_print(const u_char *s, const u_char *ep) { - register u_char c; - register int flag; + u_char c; + int flag; flag = 1; while (ep == NULL || s < ep) { @@ -175,7 +175,7 @@ trunc: void krb4_print(const u_char *cp) { - register const struct krb *kp; + const struct krb *kp; u_char type; u_short len; @@ -257,7 +257,7 @@ trunc: void krb_print(const u_char *dat, u_int length) { - register const struct krb *kp; + const struct krb *kp; kp = (struct krb *)dat; diff --git a/usr.sbin/tcpdump/print-llc.c b/usr.sbin/tcpdump/print-llc.c index 28eda54c6e7..f613f582f51 100644 --- a/usr.sbin/tcpdump/print-llc.c +++ b/usr.sbin/tcpdump/print-llc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-llc.c,v 1.19 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-llc.c,v 1.20 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997 @@ -61,11 +61,11 @@ llc_print(const u_char *p, u_int length, u_int caplen, const u_char *esrc, const u_char *edst) { struct llc llc; - register u_short et; + u_short et; #if 0 u_short control; #endif - register int ret; + int ret; if (caplen < 3) { (void)printf("[|llc]"); diff --git a/usr.sbin/tcpdump/print-lwres.c b/usr.sbin/tcpdump/print-lwres.c index d4f77505214..4405c3612f6 100644 --- a/usr.sbin/tcpdump/print-lwres.c +++ b/usr.sbin/tcpdump/print-lwres.c @@ -342,7 +342,7 @@ lwres_printaddr(lwres_addr_t *ap) } void -lwres_print(register const u_char *bp, u_int length) +lwres_print(const u_char *bp, u_int length) { const struct lwres_lwpacket *np; u_int32_t v; diff --git a/usr.sbin/tcpdump/print-nfs.c b/usr.sbin/tcpdump/print-nfs.c index 3697e9938f3..b3741808409 100644 --- a/usr.sbin/tcpdump/print-nfs.c +++ b/usr.sbin/tcpdump/print-nfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-nfs.c,v 1.20 2015/10/15 02:33:25 lteo Exp $ */ +/* $OpenBSD: print-nfs.c,v 1.21 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -289,10 +289,9 @@ print_sattr3(const struct nfsv3_sattr *sa3, int verbose) } void -nfsreply_print(register const u_char *bp, u_int length, - register const u_char *bp2) +nfsreply_print(const u_char *bp, u_int length, const u_char *bp2) { - register const struct rpc_msg *rp; + const struct rpc_msg *rp; u_int32_t proc, vers; nfserr = 0; /* assume no error */ @@ -310,10 +309,10 @@ nfsreply_print(register const u_char *bp, u_int length, * If the packet was truncated, return 0. */ static const u_int32_t * -parsereq(register const struct rpc_msg *rp, register u_int length) +parsereq(const struct rpc_msg *rp, u_int length) { - register const u_int32_t *dp; - register u_int len; + const u_int32_t *dp; + u_int len; /* * find the start of the req data (if we captured it) @@ -340,7 +339,7 @@ trunc: * If packet was truncated, return 0. */ static const u_int32_t * -parsefh(register const u_int32_t *dp, int v3) +parsefh(const u_int32_t *dp, int v3) { int len; @@ -364,10 +363,10 @@ trunc: * If packet was truncated, return 0. */ static const u_int32_t * -parsefn(register const u_int32_t *dp) +parsefn(const u_int32_t *dp) { - register u_int32_t len; - register const u_char *cp; + u_int32_t len; + const u_char *cp; /* Bail if we don't have the string length */ TCHECK(*dp); @@ -399,7 +398,7 @@ trunc: * If packet was truncated (or there was some other error), return 0. */ static const u_int32_t * -parsefhn(register const u_int32_t *dp, int v3) +parsefhn(const u_int32_t *dp, int v3) { dp = parsefh(dp, v3); if (dp == NULL) @@ -409,11 +408,10 @@ parsefhn(register const u_int32_t *dp, int v3) } void -nfsreq_print(register const u_char *bp, u_int length, - register const u_char *bp2) +nfsreq_print(const u_char *bp, u_int length, const u_char *bp2) { - register const struct rpc_msg *rp; - register const u_int32_t *dp; + const struct rpc_msg *rp; + const u_int32_t *dp; nfstype type; int vers; int v3 = 0; @@ -715,7 +713,7 @@ trunc: * additional hacking on the parser code. */ static void -nfs_printfh(register const u_int32_t *dp, const u_int len) +nfs_printfh(const u_int32_t *dp, const u_int len) { my_fsid fsid; ino_t ino; @@ -884,9 +882,9 @@ xid_map_find(const struct rpc_msg *rp, const u_char *bp, u_int32_t *proc, * If the packet was truncated, return 0. */ static const u_int32_t * -parserep(register const struct rpc_msg *rp, register u_int length) +parserep(const struct rpc_msg *rp, u_int length) { - register const u_int32_t *dp; + const u_int32_t *dp; u_int len; enum accept_stat astat; @@ -1379,8 +1377,8 @@ trunc: static void interp_reply(const struct rpc_msg *rp, u_int32_t proc, u_int32_t vers, int length) { - register const u_int32_t *dp; - register int v3; + const u_int32_t *dp; + int v3; int er; v3 = (vers == NFS_VER3); diff --git a/usr.sbin/tcpdump/print-ntp.c b/usr.sbin/tcpdump/print-ntp.c index b67116183e5..7a75c82de83 100644 --- a/usr.sbin/tcpdump/print-ntp.c +++ b/usr.sbin/tcpdump/print-ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ntp.c,v 1.16 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-ntp.c,v 1.17 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -54,9 +54,9 @@ static void p_ntp_delta(const struct l_fixedpt *, const struct l_fixedpt *); * Print ntp requests */ void -ntp_print(register const u_char *cp, u_int length) +ntp_print(const u_char *cp, u_int length) { - register const struct ntpdata *bp; + const struct ntpdata *bp; int mode, version, leapind; bp = (struct ntpdata *)cp; @@ -197,11 +197,11 @@ trunc: } static void -p_sfix(register const struct s_fixedpt *sfp) +p_sfix(const struct s_fixedpt *sfp) { - register int i; - register int f; - register float ff; + int i; + int f; + float ff; i = ntohs(sfp->int_part); f = ntohs(sfp->fraction); @@ -213,12 +213,12 @@ p_sfix(register const struct s_fixedpt *sfp) #define FMAXINT (4294967296.0) /* floating point rep. of MAXINT */ static void -p_ntp_time(register const struct l_fixedpt *lfp) +p_ntp_time(const struct l_fixedpt *lfp) { - register int32_t i; - register u_int32_t uf; - register u_int32_t f; - register float ff; + int32_t i; + u_int32_t uf; + u_int32_t f; + float ff; i = ntohl(lfp->int_part); uf = ntohl(lfp->fraction); @@ -232,14 +232,13 @@ p_ntp_time(register const struct l_fixedpt *lfp) /* Prints time difference between *lfp and *olfp */ static void -p_ntp_delta(register const struct l_fixedpt *olfp, - register const struct l_fixedpt *lfp) +p_ntp_delta(const struct l_fixedpt *olfp, const struct l_fixedpt *lfp) { - register int32_t i; - register u_int32_t uf; - register u_int32_t ouf; - register u_int32_t f; - register float ff; + int32_t i; + u_int32_t uf; + u_int32_t ouf; + u_int32_t f; + float ff; int signbit; i = ntohl(lfp->int_part) - ntohl(olfp->int_part); diff --git a/usr.sbin/tcpdump/print-ospf.c b/usr.sbin/tcpdump/print-ospf.c index 0730171314a..deb5a7fa56b 100644 --- a/usr.sbin/tcpdump/print-ospf.c +++ b/usr.sbin/tcpdump/print-ospf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ospf.c,v 1.19 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-ospf.c,v 1.20 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997 @@ -80,11 +80,11 @@ static int ospf_print_lsa(const struct lsa *); static int ospf_decode_v2(const struct ospfhdr *, const u_char *); static inline void -ospf_print_seqage(register u_int32_t seq, register time_t us) +ospf_print_seqage(u_int32_t seq, time_t us) { - register time_t sec = us % 60; - register time_t mins = (us / 60) % 60; - register time_t hour = us / 3600; + time_t sec = us % 60; + time_t mins = (us / 60) % 60; + time_t hour = us / 3600; printf(" S %X age ", seq); if (hour) @@ -98,9 +98,9 @@ ospf_print_seqage(register u_int32_t seq, register time_t us) static inline void -ospf_print_bits(register const struct bits *bp, register u_char options) +ospf_print_bits(const struct bits *bp, u_char options) { - register char sep = ' '; + char sep = ' '; do { if (options & bp->bit) { @@ -111,9 +111,8 @@ ospf_print_bits(register const struct bits *bp, register u_char options) } static void -ospf_print_ls_type(register u_int ls_type, - register const struct in_addr *ls_stateid, - register const struct in_addr *ls_router, register const char *fmt) +ospf_print_ls_type(u_int ls_type, const struct in_addr *ls_stateid, + const struct in_addr *ls_router, const char *fmt) { switch (ls_type) { @@ -160,7 +159,7 @@ ospf_print_ls_type(register u_int ls_type, } static int -ospf_print_lshdr(register const struct lsa_hdr *lshp) +ospf_print_lshdr(const struct lsa_hdr *lshp) { TCHECK(lshp->ls_type); @@ -183,16 +182,16 @@ trunc: * Print a single link state advertisement. If truncated return 1, else 0. */ static int -ospf_print_lsa(register const struct lsa *lsap) +ospf_print_lsa(const struct lsa *lsap) { - register const u_char *ls_end; - register const struct rlalink *rlp; - register const struct tos_metric *tosp; - register const struct in_addr *ap; - register const struct aslametric *almp; - register const struct mcla *mcp; - register const u_int32_t *lp; - register int j, k; + const u_char *ls_end; + const struct rlalink *rlp; + const struct tos_metric *tosp; + const struct in_addr *ap; + const struct aslametric *almp; + const struct mcla *mcp; + const u_int32_t *lp; + int j, k; if (ospf_print_lshdr(&lsap->ls_hdr)) return (1); @@ -280,7 +279,7 @@ ospf_print_lsa(register const struct lsa *lsap) TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); lp = lsap->lsa_un.un_sla.sla_tosmetric; while ((u_char *)lp < ls_end) { - register u_int32_t ul; + u_int32_t ul; TCHECK(*lp); ul = ntohl(*lp); @@ -299,7 +298,7 @@ ospf_print_lsa(register const struct lsa *lsap) TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); almp = lsap->lsa_un.un_asla.asla_metric; while ((u_char *)almp < ls_end) { - register u_int32_t ul; + u_int32_t ul; TCHECK(almp->asla_tosmetric); ul = ntohl(almp->asla_tosmetric); @@ -356,15 +355,14 @@ trunc: } static int -ospf_decode_v2(register const struct ospfhdr *op, - register const u_char *dataend) +ospf_decode_v2(const struct ospfhdr *op, const u_char *dataend) { - register const struct in_addr *ap; - register const struct lsr *lsrp; - register const struct lsa_hdr *lshp; - register const struct lsa *lsap; - register char sep; - register int i; + const struct in_addr *ap; + const struct lsr *lsrp; + const struct lsa_hdr *lshp; + const struct lsa *lsap; + char sep; + int i; switch (op->ospf_type) { @@ -492,13 +490,12 @@ trunc: } void -ospf_print(register const u_char *bp, register u_int length, - register const u_char *bp2) +ospf_print(const u_char *bp, u_int length, const u_char *bp2) { - register const struct ospfhdr *op; - register const struct ip *ip; - register const u_char *dataend; - register const char *cp; + const struct ospfhdr *op; + const struct ip *ip; + const u_char *dataend; + const char *cp; op = (struct ospfhdr *)bp; ip = (struct ip *)bp2; diff --git a/usr.sbin/tcpdump/print-ospf6.c b/usr.sbin/tcpdump/print-ospf6.c index fa60d90285b..6cf665bb3b3 100644 --- a/usr.sbin/tcpdump/print-ospf6.c +++ b/usr.sbin/tcpdump/print-ospf6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ospf6.c,v 1.8 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-ospf6.c,v 1.9 2015/11/16 00:16:39 mmcc Exp $ */ /* @@ -87,11 +87,11 @@ static int ospf6_print_lsa(const struct lsa *); static int ospf6_decode_v3(const struct ospf6hdr *, const u_char *); static inline void -ospf6_print_seqage(register u_int32_t seq, register time_t us) +ospf6_print_seqage(u_int32_t seq, time_t us) { - register time_t sec = us % 60; - register time_t mins = (us / 60) % 60; - register time_t hour = us / 3600; + time_t sec = us % 60; + time_t mins = (us / 60) % 60; + time_t hour = us / 3600; printf(" S %X age ", seq); if (hour) @@ -105,9 +105,9 @@ ospf6_print_seqage(register u_int32_t seq, register time_t us) static inline void -ospf6_print_bits(register const struct bits *bp, register u_char options) +ospf6_print_bits(const struct bits *bp, u_char options) { - register char sep = ' '; + char sep = ' '; do { if (options & bp->bit) { @@ -118,9 +118,8 @@ ospf6_print_bits(register const struct bits *bp, register u_char options) } static void -ospf6_print_ls_type(register u_int ls_type, - register const rtrid_t *ls_stateid, - register const rtrid_t *ls_router, register const char *fmt) +ospf6_print_ls_type(u_int ls_type, const rtrid_t *ls_stateid, + const rtrid_t *ls_router, const char *fmt) { char *scope; @@ -201,7 +200,7 @@ ospf6_print_ls_type(register u_int ls_type, } static int -ospf6_print_lshdr(register const struct lsa_hdr *lshp) +ospf6_print_lshdr(const struct lsa_hdr *lshp) { TCHECK(lshp->ls_type); @@ -218,7 +217,7 @@ trunc: } static int -ospf6_print_lsaprefix(register const struct lsa_prefix *lsapp) +ospf6_print_lsaprefix(const struct lsa_prefix *lsapp) { int k; struct in6_addr prefix; @@ -246,24 +245,24 @@ trunc: * Print a single link state advertisement. If truncated return 1, else 0. */ static int -ospf6_print_lsa(register const struct lsa *lsap) +ospf6_print_lsa(const struct lsa *lsap) { - register const u_char *ls_end; - register const struct rlalink *rlp; + const u_char *ls_end; + const struct rlalink *rlp; #if 0 - register const struct tos_metric *tosp; + const struct tos_metric *tosp; #endif - register const rtrid_t *ap; + const rtrid_t *ap; #if 0 - register const struct aslametric *almp; - register const struct mcla *mcp; + const struct aslametric *almp; + const struct mcla *mcp; #endif - register const struct llsa *llsap; - register const struct lsa_prefix *lsapp; + const struct llsa *llsap; + const struct lsa_prefix *lsapp; #if 0 - register const u_int32_t *lp; + const u_int32_t *lp; #endif - register int j, k; + int j, k; if (ospf6_print_lshdr(&lsap->ls_hdr)) return (1); @@ -347,7 +346,7 @@ ospf6_print_lsa(register const struct lsa *lsap) TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); lp = lsap->lsa_un.un_sla.sla_tosmetric; while ((u_char *)lp < ls_end) { - register u_int32_t ul; + u_int32_t ul; TCHECK(*lp); ul = ntohl(*lp); @@ -366,7 +365,7 @@ ospf6_print_lsa(register const struct lsa *lsap) TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); almp = lsap->lsa_un.un_asla.asla_metric; while ((u_char *)almp < ls_end) { - register u_int32_t ul; + u_int32_t ul; TCHECK(almp->asla_tosmetric); ul = ntohl(almp->asla_tosmetric); @@ -469,15 +468,14 @@ trunc: } static int -ospf6_decode_v3(register const struct ospf6hdr *op, - register const u_char *dataend) +ospf6_decode_v3(const struct ospf6hdr *op, const u_char *dataend) { - register const rtrid_t *ap; - register const struct lsr *lsrp; - register const struct lsa_hdr *lshp; - register const struct lsa *lsap; - register char sep; - register int i; + const rtrid_t *ap; + const struct lsr *lsrp; + const struct lsa_hdr *lshp; + const struct lsa *lsap; + char sep; + int i; switch (op->ospf6_type) { @@ -606,11 +604,11 @@ trunc: } void -ospf6_print(register const u_char *bp, register u_int length) +ospf6_print(const u_char *bp, u_int length) { - register const struct ospf6hdr *op; - register const u_char *dataend; - register const char *cp; + const struct ospf6hdr *op; + const u_char *dataend; + const char *cp; op = (struct ospf6hdr *)bp; diff --git a/usr.sbin/tcpdump/print-pflog.c b/usr.sbin/tcpdump/print-pflog.c index 3b29501841e..7d510dcf012 100644 --- a/usr.sbin/tcpdump/print-pflog.c +++ b/usr.sbin/tcpdump/print-pflog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-pflog.c,v 1.27 2015/01/20 18:26:58 deraadt Exp $ */ +/* $OpenBSD: print-pflog.c,v 1.28 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996 @@ -56,7 +56,7 @@ char *pf_reasons[PFRES_MAX+2] = PFRES_NAMES; void pflog_if_print(u_char *user, const struct pcap_pkthdr *h, - register const u_char *p) + const u_char *p) { u_int length = h->len; u_int hdrlen; diff --git a/usr.sbin/tcpdump/print-pfsync.c b/usr.sbin/tcpdump/print-pfsync.c index a418b98d967..9ed093b92c4 100644 --- a/usr.sbin/tcpdump/print-pfsync.c +++ b/usr.sbin/tcpdump/print-pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-pfsync.c,v 1.40 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-pfsync.c,v 1.41 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -58,7 +58,7 @@ void pfsync_print(struct pfsync_header *, const u_char *, int); void pfsync_if_print(u_char *user, const struct pcap_pkthdr *h, - register const u_char *p) + const u_char *p) { u_int caplen = h->caplen; diff --git a/usr.sbin/tcpdump/print-pim.c b/usr.sbin/tcpdump/print-pim.c index cb73669a82b..27d1cae6794 100644 --- a/usr.sbin/tcpdump/print-pim.c +++ b/usr.sbin/tcpdump/print-pim.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-pim.c,v 1.7 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-pim.c,v 1.8 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1995, 1996 @@ -39,10 +39,10 @@ #include "addrtoname.h" void -pim_print(register const u_char *bp, register u_int len) +pim_print(const u_char *bp, u_int len) { - register const u_char *ep; - register u_char type; + const u_char *ep; + u_char type; ep = (const u_char *)snapend; if (bp >= ep) diff --git a/usr.sbin/tcpdump/print-ppp.c b/usr.sbin/tcpdump/print-ppp.c index 63c57f3ffdd..797f70dd651 100644 --- a/usr.sbin/tcpdump/print-ppp.c +++ b/usr.sbin/tcpdump/print-ppp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ppp.c,v 1.28 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-ppp.c,v 1.29 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 @@ -612,10 +612,10 @@ void ppp_if_print(user, h, p) u_char *user; const struct pcap_pkthdr *h; - register const u_char *p; + const u_char *p; { - register u_int length = h->len; - register u_int caplen = h->caplen; + u_int length = h->len; + u_int caplen = h->caplen; ts_print(&h->ts); @@ -677,7 +677,7 @@ void ppp_ether_if_print(user, h, p) u_char *user; const struct pcap_pkthdr *h; - register const u_char *p; + const u_char *p; { u_int16_t pppoe_sid, pppoe_len; u_int caplen = h->caplen; diff --git a/usr.sbin/tcpdump/print-radius.c b/usr.sbin/tcpdump/print-radius.c index d4c74399e7f..ba6d65f058b 100644 --- a/usr.sbin/tcpdump/print-radius.c +++ b/usr.sbin/tcpdump/print-radius.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-radius.c,v 1.10 2015/09/06 17:29:33 deraadt Exp $ */ +/* $OpenBSD: print-radius.c,v 1.11 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1997 Thomas H. Ptacek. All rights reserved. @@ -235,7 +235,7 @@ static void r_print_hex(int code, int len, const u_char *data) { fputc(']', stdout); } -void radius_print(register const u_char *data, u_int len) { +void radius_print(const u_char *data, u_int len) { const struct radius_header *rhp; const u_char *pp; int first, l, ac, al; diff --git a/usr.sbin/tcpdump/print-rip.c b/usr.sbin/tcpdump/print-rip.c index 9cd6631f9b5..44e9301296f 100644 --- a/usr.sbin/tcpdump/print-rip.c +++ b/usr.sbin/tcpdump/print-rip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-rip.c,v 1.15 2015/03/29 14:09:29 bluhm Exp $ */ +/* $OpenBSD: print-rip.c,v 1.16 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1989, 1990, 1991, 1993, 1994, 1996 @@ -70,9 +70,9 @@ rip_printblk(const u_char *cp, const u_char *ep) } static void -rip_entry_print_v1(register int vers, register const struct rip_netinfo *ni) +rip_entry_print_v1(int vers, const struct rip_netinfo *ni) { - register u_short family; + u_short family; /* RFC 1058 */ family = EXTRACT_16BITS(&ni->rip_family); @@ -98,10 +98,10 @@ rip_entry_print_v1(register int vers, register const struct rip_netinfo *ni) } static void -rip_entry_print_v2(register int vers, register const struct rip_netinfo *ni) +rip_entry_print_v2(int vers, const struct rip_netinfo *ni) { - register u_char *p; - register u_short family; + u_char *p; + u_short family; char buf[RIP_AUTHLEN]; /* RFC 1723 */ @@ -153,9 +153,9 @@ rip_entry_print_v2(register int vers, register const struct rip_netinfo *ni) void rip_print(const u_char *dat, u_int length) { - register const struct rip *rp; - register const struct rip_netinfo *ni; - register int i, j, trunc; + const struct rip *rp; + const struct rip_netinfo *ni; + int i, j, trunc; i = min(length, snapend - dat) - sizeof(*rp); if (i < 0) { diff --git a/usr.sbin/tcpdump/print-ripng.c b/usr.sbin/tcpdump/print-ripng.c index 9337cd9f61b..78987943888 100644 --- a/usr.sbin/tcpdump/print-ripng.c +++ b/usr.sbin/tcpdump/print-ripng.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ripng.c,v 1.4 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-ripng.c,v 1.5 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1989, 1990, 1991, 1993, 1994 @@ -43,7 +43,7 @@ #include "addrtoname.h" static int -rip6_entry_print(register const struct netinfo6 *ni, int metric) +rip6_entry_print(const struct netinfo6 *ni, int metric) { int l; l = printf("%s/%d", ip6addr_string(&ni->rip6_dest), ni->rip6_plen); @@ -57,10 +57,10 @@ rip6_entry_print(register const struct netinfo6 *ni, int metric) void ripng_print(const u_char *dat, int length) { - register const struct rip6 *rp = (struct rip6 *)dat; - register const struct netinfo6 *ni; - register int amt = snapend - dat; - register int i = min(length, amt) - + const struct rip6 *rp = (struct rip6 *)dat; + const struct netinfo6 *ni; + int amt = snapend - dat; + int i = min(length, amt) - (sizeof(struct rip6) - sizeof(struct netinfo6)); int j; int trunc; diff --git a/usr.sbin/tcpdump/print-rt6.c b/usr.sbin/tcpdump/print-rt6.c index 27e741284f1..1928cec7f7a 100644 --- a/usr.sbin/tcpdump/print-rt6.c +++ b/usr.sbin/tcpdump/print-rt6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-rt6.c,v 1.5 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-rt6.c,v 1.6 2015/11/16 00:16:39 mmcc Exp $ */ /* @@ -47,12 +47,12 @@ #include "addrtoname.h" int -rt6_print(register const u_char *bp, register const u_char *bp2) +rt6_print(const u_char *bp, const u_char *bp2) { - register const struct ip6_rthdr *dp; - register const struct ip6_rthdr0 *dp0; - register const struct ip6_hdr *ip; - register const u_char *ep; + const struct ip6_rthdr *dp; + const struct ip6_rthdr0 *dp0; + const struct ip6_hdr *ip; + const u_char *ep; int i, len; dp = (struct ip6_rthdr *)bp; diff --git a/usr.sbin/tcpdump/print-skip.c b/usr.sbin/tcpdump/print-skip.c index 8c123dd729d..ef9261aaedf 100644 --- a/usr.sbin/tcpdump/print-skip.c +++ b/usr.sbin/tcpdump/print-skip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-skip.c,v 1.5 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-skip.c,v 1.6 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1995 Sun Microsystems, Inc. @@ -161,8 +161,7 @@ unsigned char old_skip_mid_sizes[MAX_ALGS] = { 8, /* simplecrypt */ }; -void skip_print_old(register const u_char *bp, register int length, - const u_char *bp2) +void skip_print_old(const u_char *bp, int length, const u_char *bp2) { struct ip *ip; const u_char *end; @@ -589,8 +588,7 @@ void skip_print_next(u_char nxt, const u_char *p, int len, const u_char *bp2) } } -void skip_print(register const u_char *bp, register int length, - const u_char *bp2) +void skip_print(const u_char *bp, int length, const u_char *bp2) { struct ip *ip; const u_char *end; @@ -753,8 +751,7 @@ void skip_print(register const u_char *bp, register int length, -void ah_print(register const u_char *bp, register int length, - const u_char *bp2) +void ah_print(const u_char *bp, int length, const u_char *bp2) { struct ip *ip; const u_char *end; @@ -845,8 +842,7 @@ void ah_print(register const u_char *bp, register int length, } -void esp_print(register const u_char *bp, register int length, - const u_char *bp2) +void esp_print(const u_char *bp, int length, const u_char *bp2) { struct ip *ip; const u_char *end; diff --git a/usr.sbin/tcpdump/print-sl.c b/usr.sbin/tcpdump/print-sl.c index a2a25298392..366ede2336e 100644 --- a/usr.sbin/tcpdump/print-sl.c +++ b/usr.sbin/tcpdump/print-sl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-sl.c,v 1.18 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-sl.c,v 1.19 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997 @@ -68,9 +68,9 @@ static void compressed_sl_print(const u_char *, const struct ip *, u_int, int); void sl_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) { - register u_int caplen = h->caplen; - register u_int length = h->len; - register const struct ip *ip; + u_int caplen = h->caplen; + u_int length = h->len; + const struct ip *ip; ts_print(&h->ts); @@ -116,9 +116,9 @@ sl_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) void sl_bsdos_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) { - register u_int caplen = h->caplen; - register u_int length = h->len; - register const struct ip *ip; + u_int caplen = h->caplen; + u_int length = h->len; + const struct ip *ip; ts_print(&h->ts); @@ -152,8 +152,7 @@ sl_bsdos_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) } static void -sliplink_print(register const u_char *p, register const struct ip *ip, - register u_int length) +sliplink_print(const u_char *p, const struct ip *ip, u_int length) { int dir; u_int hlen; @@ -164,7 +163,7 @@ sliplink_print(register const u_char *p, register const struct ip *ip, if (nflag) { /* XXX just dump the header */ - register int i; + int i; for (i = SLX_CHDR; i < SLX_CHDR + CHDR_LEN - 1; ++i) printf("%02x.", p[i]); @@ -201,9 +200,9 @@ sliplink_print(register const u_char *p, register const struct ip *ip, } static const u_char * -print_sl_change(const char *str, register const u_char *cp) +print_sl_change(const char *str, const u_char *cp) { - register u_int i; + u_int i; if ((i = *cp++) == 0) { i = EXTRACT_16BITS(cp); @@ -214,9 +213,9 @@ print_sl_change(const char *str, register const u_char *cp) } static const u_char * -print_sl_winchange(register const u_char *cp) +print_sl_winchange(const u_char *cp) { - register short i; + short i; if ((i = *cp++) == 0) { i = EXTRACT_16BITS(cp); @@ -233,8 +232,8 @@ static void compressed_sl_print(const u_char *chdr, const struct ip *ip, u_int length, int dir) { - register const u_char *cp = chdr; - register u_int flags, hlen; + const u_char *cp = chdr; + u_int flags, hlen; flags = *cp++; if (flags & NEW_C) { diff --git a/usr.sbin/tcpdump/print-slow.c b/usr.sbin/tcpdump/print-slow.c index 493927425ba..d05117b7f82 100644 --- a/usr.sbin/tcpdump/print-slow.c +++ b/usr.sbin/tcpdump/print-slow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-slow.c,v 1.3 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-slow.c,v 1.4 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1998-2005 The TCPDUMP project @@ -116,7 +116,7 @@ struct lacp_marker_tlv_terminator_t { }; void -slow_print(register const u_char *pptr, register u_int len) +slow_print(const u_char *pptr, u_int len) { const struct slow_common_header *slow_com_header; diff --git a/usr.sbin/tcpdump/print-snmp.c b/usr.sbin/tcpdump/print-snmp.c index d0bdb853f5d..03da4781971 100644 --- a/usr.sbin/tcpdump/print-snmp.c +++ b/usr.sbin/tcpdump/print-snmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-snmp.c,v 1.18 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-snmp.c,v 1.19 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 @@ -360,7 +360,7 @@ static int truncated; * O/w, this returns the number of bytes parsed from "p". */ static int -asn1_parse(register const u_char *p, u_int len, struct be *elem) +asn1_parse(const u_char *p, u_int len, struct be *elem) { u_char form, class, id; int i, hdr; @@ -464,7 +464,7 @@ asn1_parse(register const u_char *p, u_int len, struct be *elem) break; case INTEGER: { - register int32_t data; + int32_t data; elem->type = BE_INT; data = 0; @@ -508,7 +508,7 @@ asn1_parse(register const u_char *p, u_int len, struct be *elem) case OPAQUE: case NSAPADDR: case UINTEGER32: { - register u_int32_t data; + u_int32_t data; elem->type = BE_UNS; data = 0; for (i = elem->asnlen; i-- > 0; p++) @@ -518,7 +518,7 @@ asn1_parse(register const u_char *p, u_int len, struct be *elem) } case COUNTER64: { - register u_int64_t data; + u_int64_t data; elem->type = BE_UNS64; data = 0; for (i = elem->asnlen; i-- > 0; p++) @@ -656,7 +656,7 @@ asn1_print(struct be *elem) break; case BE_STR: { - register int printable = 1, first = 1; + int printable = 1, first = 1; const u_char *p = elem->data.str; for (i = asnlen; printable && i-- > 0; p++) printable = isprint(*p) || isspace(*p); diff --git a/usr.sbin/tcpdump/print-sunrpc.c b/usr.sbin/tcpdump/print-sunrpc.c index d1be6d540f6..2bea7421aa1 100644 --- a/usr.sbin/tcpdump/print-sunrpc.c +++ b/usr.sbin/tcpdump/print-sunrpc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-sunrpc.c,v 1.19 2015/01/16 06:40:21 deraadt Exp $ */ +/* $OpenBSD: print-sunrpc.c,v 1.20 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1992, 1993, 1994, 1995, 1996 @@ -62,11 +62,10 @@ static struct tok proc2str[] = { static char *progstr(u_int32_t); void -sunrpcrequest_print(register const u_char *bp, register u_int length, - register const u_char *bp2) +sunrpcrequest_print(const u_char *bp, u_int length, const u_char *bp2) { - register const struct rpc_msg *rp; - register const struct ip *ip; + const struct rpc_msg *rp; + const struct ip *ip; u_int32_t x; rp = (struct rpc_msg *)bp; diff --git a/usr.sbin/tcpdump/print-tcp.c b/usr.sbin/tcpdump/print-tcp.c index 63cd50c2032..8ebc1af3b76 100644 --- a/usr.sbin/tcpdump/print-tcp.c +++ b/usr.sbin/tcpdump/print-tcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-tcp.c,v 1.34 2015/11/05 11:57:31 jca Exp $ */ +/* $OpenBSD: print-tcp.c,v 1.35 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -48,7 +48,7 @@ #include "nfs.h" -static void print_tcp_rst_data(register const u_char *sp, u_int length); +static void print_tcp_rst_data(const u_char *sp, u_int length); #define MAX_RST_DATA_LEN 30 @@ -184,20 +184,19 @@ static int tcp6_cksum(const struct ip6_hdr *ip6, const struct tcphdr *tp, void -tcp_print(register const u_char *bp, register u_int length, - register const u_char *bp2) +tcp_print(const u_char *bp, u_int length, const u_char *bp2) { - register const struct tcphdr *tp; - register const struct ip *ip; - register u_char flags; - register int hlen; - register char ch; - register struct tcp_seq_hash *th = NULL; - register int rev = 0; + const struct tcphdr *tp; + const struct ip *ip; + u_char flags; + int hlen; + char ch; + struct tcp_seq_hash *th = NULL; + int rev = 0; u_int16_t sport, dport, win, urp; tcp_seq seq, ack; #ifdef INET6 - register const struct ip6_hdr *ip6; + const struct ip6_hdr *ip6; #endif tp = (struct tcphdr *)bp; @@ -488,8 +487,8 @@ tcp_print(register const u_char *bp, register u_int length, * Handle any options. */ if ((hlen -= sizeof(*tp)) > 0) { - register const u_char *cp; - register int i, opt, len, datalen; + const u_char *cp; + int i, opt, len, datalen; cp = (const u_char *)tp + sizeof(*tp); putchar(' '); @@ -700,7 +699,7 @@ trunc: */ static void -print_tcp_rst_data(register const u_char *sp, u_int length) +print_tcp_rst_data(const u_char *sp, u_int length) { int c; diff --git a/usr.sbin/tcpdump/print-tftp.c b/usr.sbin/tcpdump/print-tftp.c index 3e189a3058a..d43966bd9a3 100644 --- a/usr.sbin/tcpdump/print-tftp.c +++ b/usr.sbin/tcpdump/print-tftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-tftp.c,v 1.11 2015/01/16 06:40:22 deraadt Exp $ */ +/* $OpenBSD: print-tftp.c,v 1.12 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 @@ -66,12 +66,12 @@ static struct tok err2str[] = { * Print trivial file transfer program requests */ void -tftp_print(register const u_char *bp, u_int length) +tftp_print(const u_char *bp, u_int length) { - register const struct tftphdr *tp; - register const char *cp; - register const u_char *p; - register int opcode, i; + const struct tftphdr *tp; + const char *cp; + const u_char *p; + int opcode, i; static char tstr[] = " [|tftp]"; tp = (const struct tftphdr *)bp; diff --git a/usr.sbin/tcpdump/print-timed.c b/usr.sbin/tcpdump/print-timed.c index 3542e96239e..196a1e35216 100644 --- a/usr.sbin/tcpdump/print-timed.c +++ b/usr.sbin/tcpdump/print-timed.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-timed.c,v 1.6 2015/01/16 06:40:22 deraadt Exp $ */ +/* $OpenBSD: print-timed.c,v 1.7 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 2000 Ben Smithurst <ben@scientia.demon.co.uk> @@ -49,7 +49,7 @@ static const char *tsptype[TSPTYPENUMBER] = "TEST", "SETDATE", "SETDATEREQ", "LOOP" }; void -timed_print(register const u_char *bp, u_int length) +timed_print(const u_char *bp, u_int length) { #define endof(x) ((u_char *)&(x) + sizeof (x)) struct tsp *tsp = (struct tsp *)bp; diff --git a/usr.sbin/tcpdump/print-udp.c b/usr.sbin/tcpdump/print-udp.c index d179b3e04a6..0b18905defb 100644 --- a/usr.sbin/tcpdump/print-udp.c +++ b/usr.sbin/tcpdump/print-udp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-udp.c,v 1.38 2015/01/16 06:40:22 deraadt Exp $ */ +/* $OpenBSD: print-udp.c,v 1.39 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 @@ -112,7 +112,7 @@ struct rtcp_rr { #define RTCP_PT_APP 204 static void -vat_print(const void *hdr, u_int len, register const struct udphdr *up) +vat_print(const void *hdr, u_int len, const struct udphdr *up) { /* vat/vt audio */ u_int ts = *(u_short *)hdr; @@ -138,7 +138,7 @@ vat_print(const void *hdr, u_int len, register const struct udphdr *up) } static void -rtp_print(const void *hdr, u_int len, register const struct udphdr *up) +rtp_print(const void *hdr, u_int len, const struct udphdr *up) { /* rtp v1 or v2 */ u_int *ip = (u_int *)hdr; @@ -383,15 +383,15 @@ static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up, #endif void -udp_print(register const u_char *bp, u_int length, register const u_char *bp2) +udp_print(const u_char *bp, u_int length, const u_char *bp2) { - register const struct udphdr *up; - register const struct ip *ip; - register const u_char *cp; - register const u_char *ep = bp + length; + const struct udphdr *up; + const struct ip *ip; + const u_char *cp; + const u_char *ep = bp + length; u_int16_t sport, dport, ulen; #ifdef INET6 - register const struct ip6_hdr *ip6; + const struct ip6_hdr *ip6; #endif if (ep > snapend) @@ -419,7 +419,7 @@ udp_print(register const u_char *bp, u_int length, register const u_char *bp2) dport = ntohs(up->uh_dport); ulen = ntohs(up->uh_ulen); if (packettype) { - register struct rpc_msg *rp; + struct rpc_msg *rp; enum msg_type direction; switch (packettype) { @@ -484,7 +484,7 @@ udp_print(register const u_char *bp, u_int length, register const u_char *bp2) } if (!qflag) { - register struct rpc_msg *rp; + struct rpc_msg *rp; enum msg_type direction; rp = (struct rpc_msg *)(up + 1); diff --git a/usr.sbin/tcpdump/print-vrrp.c b/usr.sbin/tcpdump/print-vrrp.c index 226fceba8da..b0adaf0cf7f 100644 --- a/usr.sbin/tcpdump/print-vrrp.c +++ b/usr.sbin/tcpdump/print-vrrp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-vrrp.c,v 1.3 2009/10/27 23:59:57 deraadt Exp $ */ +/* $OpenBSD: print-vrrp.c,v 1.4 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 2000 William C. Fenner. @@ -65,7 +65,7 @@ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ void -vrrp_print(register const u_char *bp, register u_int len, int ttl) +vrrp_print(const u_char *bp, u_int len, int ttl) { int version, type, auth_type; char *type_s; diff --git a/usr.sbin/tcpdump/print-wb.c b/usr.sbin/tcpdump/print-wb.c index 304ad43542a..d43d8597d12 100644 --- a/usr.sbin/tcpdump/print-wb.c +++ b/usr.sbin/tcpdump/print-wb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-wb.c,v 1.8 2009/10/27 23:59:57 deraadt Exp $ */ +/* $OpenBSD: print-wb.c,v 1.9 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 @@ -302,7 +302,7 @@ wb_dops(const struct dophdr *dh, u_int32_t ss, u_int32_t es) { printf(" <"); for ( ; ss <= es; ++ss) { - register int t = dh->dh_type; + int t = dh->dh_type; if (t > DT_MAXTYPE) printf(" dop-%d!", t); @@ -376,9 +376,9 @@ wb_drawop(const struct pkt_dop *dop, u_int len) * Print whiteboard multicast packets. */ void -wb_print(register const void *hdr, register u_int len) +wb_print(const void *hdr, u_int len) { - register const struct pkt_hdr *ph; + const struct pkt_hdr *ph; ph = (const struct pkt_hdr *)hdr; len -= sizeof(*ph); diff --git a/usr.sbin/tcpdump/savestr.c b/usr.sbin/tcpdump/savestr.c index 2d8a253221f..eeb5b05178a 100644 --- a/usr.sbin/tcpdump/savestr.c +++ b/usr.sbin/tcpdump/savestr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: savestr.c,v 1.9 2015/08/21 02:07:32 deraadt Exp $ */ +/* $OpenBSD: savestr.c,v 1.10 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1997 @@ -35,10 +35,10 @@ /* A replacement for strdup() that cuts down on malloc() overhead */ char * -savestr(register const char *str) +savestr(const char *str) { - register size_t size; - register char *p; + size_t size; + char *p; static char *strptr = NULL; static size_t strsize = 0; diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c index 480ba7ecb51..8b9d5c18412 100644 --- a/usr.sbin/tcpdump/tcpdump.c +++ b/usr.sbin/tcpdump/tcpdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcpdump.c,v 1.76 2015/10/28 12:28:14 jca Exp $ */ +/* $OpenBSD: tcpdump.c,v 1.77 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -612,10 +612,10 @@ default_print_ascii(const u_char *cp, unsigned int length) /* Like default_print() but data need not be aligned */ void -default_print_unaligned(register const u_char *cp, register u_int length) +default_print_unaligned(const u_char *cp, u_int length) { - register u_int i, s; - register int nshorts; + u_int i, s; + int nshorts; if (Xflag) { /* dump the buffer in `emacs-hexl' style */ @@ -642,11 +642,11 @@ default_print_unaligned(register const u_char *cp, register u_int length) } void -default_print(register const u_char *bp, register u_int length) +default_print(const u_char *bp, u_int length) { - register const u_short *sp; - register u_int i; - register int nshorts; + const u_short *sp; + u_int i; + int nshorts; if (Xflag) { /* dump the buffer in `emacs-hexl' style */ diff --git a/usr.sbin/tcpdump/util.c b/usr.sbin/tcpdump/util.c index d227f078e59..cc384d18835 100644 --- a/usr.sbin/tcpdump/util.c +++ b/usr.sbin/tcpdump/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.26 2015/09/27 05:25:01 guenther Exp $ */ +/* $OpenBSD: util.c,v 1.27 2015/11/16 00:16:39 mmcc Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 @@ -51,10 +51,10 @@ * Return true if truncated. */ int -fn_print(register const u_char *s, register const u_char *ep) +fn_print(const u_char *s, const u_char *ep) { - register int ret; - register u_char c; + int ret; + u_char c; ret = 1; /* assume truncated */ while (ep == NULL || s < ep) { @@ -83,11 +83,10 @@ fn_print(register const u_char *s, register const u_char *ep) * Return true if truncated. */ int -fn_printn(register const u_char *s, register u_int n, - register const u_char *ep) +fn_printn(const u_char *s, u_int n, const u_char *ep) { - register int ret; - register u_char c; + int ret; + u_char c; ret = 1; /* assume truncated */ while (ep == NULL || s < ep) { @@ -114,9 +113,9 @@ fn_printn(register const u_char *s, register u_int n, * Print the timestamp */ void -ts_print(register const struct bpf_timeval *tvp) +ts_print(const struct bpf_timeval *tvp) { - register int s; + int s; #define TSBUFLEN 32 static char buf[TSBUFLEN]; static struct bpf_timeval last; @@ -187,8 +186,7 @@ relts_print(int secs) * Convert a token value to a string; use "fmt" if not found. */ const char * -tok2str(register const struct tok *lp, register const char *fmt, - register int v) +tok2str(const struct tok *lp, const char *fmt, int v) { static char buf[128]; |