diff --git a/contrib/tcp_wrappers/clean_exit.c b/contrib/tcp_wrappers/clean_exit.c --- a/contrib/tcp_wrappers/clean_exit.c +++ b/contrib/tcp_wrappers/clean_exit.c @@ -21,8 +21,7 @@ /* clean_exit - clean up and exit */ -void clean_exit(request) -struct request_info *request; +void clean_exit(struct request_info *request) { /* diff --git a/contrib/tcp_wrappers/diag.c b/contrib/tcp_wrappers/diag.c --- a/contrib/tcp_wrappers/diag.c +++ b/contrib/tcp_wrappers/diag.c @@ -29,11 +29,7 @@ /* tcpd_diag - centralize error reporter */ -static void tcpd_diag(severity, tag, format, ap) -int severity; -char *tag; -char *format; -va_list ap; +static void tcpd_diag(int severity, char *tag, char *format, va_list ap) { char fmt[BUFSIZ]; diff --git a/contrib/tcp_wrappers/environ.c b/contrib/tcp_wrappers/environ.c --- a/contrib/tcp_wrappers/environ.c +++ b/contrib/tcp_wrappers/environ.c @@ -37,8 +37,7 @@ /* namelength - determine length of name in "name=whatever" */ -static int namelength(name) -char *name; +static int namelength(char *name) { char *equal; @@ -48,9 +47,7 @@ /* findenv - given name, locate name=value */ -static char **findenv(name, len) -char *name; -int len; +static char **findenv(char *name, int len) { char **envp; @@ -62,8 +59,7 @@ /* getenv - given name, locate value */ -char *getenv(name) -char *name; +char *getenv(char *name) { int len = namelength(name); char **envp = findenv(name, len); @@ -73,8 +69,7 @@ /* putenv - update or append environment (name,value) pair */ -int putenv(nameval) -char *nameval; +int putenv(char *nameval) { char *equal = strchr(nameval, '='); char *value = (equal ? equal : ""); @@ -84,8 +79,7 @@ /* unsetenv - remove variable from environment */ -void unsetenv(name) -char *name; +void unsetenv(char *name) { char **envp; @@ -96,10 +90,7 @@ /* setenv - update or append environment (name,value) pair */ -int setenv(name, value, clobber) -char *name; -char *value; -int clobber; +int setenv(char *name, char *value, int clobber) { char *destination; char **envp; @@ -133,9 +124,7 @@ /* cmalloc - malloc and copy block of memory */ -static char *cmalloc(new_len, old, old_len) -char *old; -int old_len; +static char *cmalloc(int new_len, char *old, int old_len) { char *new = malloc(new_len); @@ -146,8 +135,7 @@ /* addenv - append environment entry */ -static int addenv(nameval) -char *nameval; +static int addenv(char *nameval) { char **envp; int n_used; /* number of environment entries */ @@ -190,9 +178,7 @@ printf("%s\n", *envp); } -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { char *cp; int changed = 0; diff --git a/contrib/tcp_wrappers/eval.c b/contrib/tcp_wrappers/eval.c --- a/contrib/tcp_wrappers/eval.c +++ b/contrib/tcp_wrappers/eval.c @@ -42,8 +42,7 @@ /* eval_user - look up user name */ -char *eval_user(request) -struct request_info *request; +char *eval_user(struct request_info *request) { if (request->user[0] == 0) { strcpy(request->user, unknown); @@ -55,8 +54,7 @@ /* eval_hostaddr - look up printable address */ -char *eval_hostaddr(host) -struct host_info *host; +char *eval_hostaddr(struct host_info *host) { if (host->addr[0] == 0) { strcpy(host->addr, unknown); @@ -68,8 +66,7 @@ /* eval_hostname - look up host name */ -char *eval_hostname(host) -struct host_info *host; +char *eval_hostname(struct host_info *host) { if (host->name[0] == 0) { strcpy(host->name, unknown); @@ -81,8 +78,7 @@ /* eval_hostinfo - return string with host name (preferred) or address */ -char *eval_hostinfo(host) -struct host_info *host; +char *eval_hostinfo(struct host_info *host) { char *hostname; @@ -100,8 +96,7 @@ /* eval_client - return string with as much about the client as we know */ -char *eval_client(request) -struct request_info *request; +char *eval_client(struct request_info *request) { static char both[2 * STRING_LENGTH]; char *hostinfo = eval_hostinfo(request->client); @@ -120,8 +115,7 @@ /* eval_server - return string with as much about the server as we know */ -char *eval_server(request) -struct request_info *request; +char *eval_server(struct request_info *request) { static char both[2 * STRING_LENGTH]; char *host = eval_hostinfo(request->server); diff --git a/contrib/tcp_wrappers/fakelog.c b/contrib/tcp_wrappers/fakelog.c --- a/contrib/tcp_wrappers/fakelog.c +++ b/contrib/tcp_wrappers/fakelog.c @@ -17,20 +17,14 @@ /* ARGSUSED */ -void openlog(name, logopt, facility) -char *name; -int logopt; -int facility; +void openlog(char *name, int logopt, int facility) { /* void */ } /* vsyslog - format one record */ -void vsyslog(severity, fmt, ap) -int severity; -char *fmt; -va_list ap; +void vsyslog(int severity, char *fmt, va_list ap) { char buf[BUFSIZ]; diff --git a/contrib/tcp_wrappers/fix_options.c b/contrib/tcp_wrappers/fix_options.c --- a/contrib/tcp_wrappers/fix_options.c +++ b/contrib/tcp_wrappers/fix_options.c @@ -35,8 +35,7 @@ /* fix_options - get rid of IP-level socket options */ void -fix_options(request) -struct request_info *request; +fix_options(struct request_info *request) { #ifdef IP_OPTIONS unsigned char optbuf[BUFFER_SIZE / 3], *cp; diff --git a/contrib/tcp_wrappers/fromhost.c b/contrib/tcp_wrappers/fromhost.c --- a/contrib/tcp_wrappers/fromhost.c +++ b/contrib/tcp_wrappers/fromhost.c @@ -28,8 +28,7 @@ /* fromhost - find out what network API we should use */ -void fromhost(request) -struct request_info *request; +void fromhost(struct request_info *request) { /* diff --git a/contrib/tcp_wrappers/hosts_access.c b/contrib/tcp_wrappers/hosts_access.c --- a/contrib/tcp_wrappers/hosts_access.c +++ b/contrib/tcp_wrappers/hosts_access.c @@ -108,8 +108,7 @@ /* hosts_access - host access control facility */ -int hosts_access(request) -struct request_info *request; +int hosts_access(struct request_info *request) { int verdict; @@ -142,9 +141,7 @@ /* table_match - match table entries with (daemon, client) pair */ -static int table_match(table, request) -char *table; -struct request_info *request; +static int table_match(char *table, struct request_info *request) { FILE *fp; char sv_list[BUFLEN]; /* becomes list of daemons */ @@ -237,9 +234,7 @@ /* server_match - match server information */ -static int server_match(tok, request) -char *tok; -struct request_info *request; +static int server_match(char *tok, struct request_info *request) { char *host; @@ -253,9 +248,7 @@ /* client_match - match client information */ -static int client_match(tok, request) -char *tok; -struct request_info *request; +static int client_match(char *tok, struct request_info *request) { char *host; @@ -269,9 +262,7 @@ /* hostfile_match - look up host patterns from file */ -static int hostfile_match(path, host) -char *path; -struct host_info *host; +static int hostfile_match(char *path, struct host_info *host) { char tok[BUFSIZ]; int match = NO; @@ -289,9 +280,7 @@ /* host_match - match host name and/or address against pattern */ -static int host_match(tok, host) -char *tok; -struct host_info *host; +static int host_match(char *tok, struct host_info *host) { char *mask; @@ -332,9 +321,7 @@ /* string_match - match string against pattern */ -static int string_match(tok, string) -char *tok; -char *string; +static int string_match(char *tok, char *string) { int n; @@ -393,22 +380,16 @@ /* masked_match - match address against netnumber/netmask */ #ifdef INET6 -static int masked_match(net_tok, mask_tok, string) -char *net_tok; -char *mask_tok; -char *string; +static int masked_match(char *net_tok, char *mask_tok, char *string) { return (masked_match4(net_tok, mask_tok, string) || masked_match6(net_tok, mask_tok, string)); } -static int masked_match4(net_tok, mask_tok, string) +static int masked_match4(char *net_tok, char *mask_tok, char *string) #else -static int masked_match(net_tok, mask_tok, string) +static int masked_match(char *net_tok, char *mask_tok, char *string) #endif -char *net_tok; -char *mask_tok; -char *string; { #ifdef INET6 u_int32_t net; @@ -439,10 +420,7 @@ } #ifdef INET6 -static int masked_match6(net_tok, mask_tok, string) -char *net_tok; -char *mask_tok; -char *string; +static int masked_match6(char *net_tok, char *mask_tok, char *string) { struct addrinfo hints, *res; struct sockaddr_in6 net, addr; diff --git a/contrib/tcp_wrappers/hosts_ctl.c b/contrib/tcp_wrappers/hosts_ctl.c --- a/contrib/tcp_wrappers/hosts_ctl.c +++ b/contrib/tcp_wrappers/hosts_ctl.c @@ -21,11 +21,7 @@ /* hosts_ctl - limited interface to the hosts_access() routine */ -int hosts_ctl(daemon, name, addr, user) -char *daemon; -char *name; -char *addr; -char *user; +int hosts_ctl(char *daemon, char *name, char *addr, char *user) { struct request_info request; diff --git a/contrib/tcp_wrappers/inetcf.c b/contrib/tcp_wrappers/inetcf.c --- a/contrib/tcp_wrappers/inetcf.c +++ b/contrib/tcp_wrappers/inetcf.c @@ -55,8 +55,7 @@ /* inet_conf - read in and examine inetd.conf (or tlid.conf) entries */ -char *inet_cfg(conf) -char *conf; +char *inet_cfg(char *conf) { char buf[BUFSIZ]; FILE *fp; @@ -159,11 +158,7 @@ /* inet_chk - examine one inetd.conf (tlid.conf?) entry */ -static void inet_chk(protocol, path, arg0, arg1) -char *protocol; -char *path; -char *arg0; -char *arg1; +static void inet_chk(char *protocol, char *path, char *arg0, char *arg1) { char daemon[BUFSIZ]; struct stat st; @@ -274,9 +269,7 @@ /* inet_set - remember service status */ -void inet_set(name, type) -char *name; -int type; +void inet_set(char *name, int type) { struct inet_ent *ip = (struct inet_ent *) malloc(sizeof(struct inet_ent) + strlen(name)); @@ -293,8 +286,7 @@ /* inet_get - look up service status */ -int inet_get(name) -char *name; +int inet_get(char *name) { struct inet_ent *ip; @@ -310,8 +302,7 @@ /* base_name - compute last pathname component */ -static char *base_name(path) -char *path; +static char *base_name(char *path) { char *cp; diff --git a/contrib/tcp_wrappers/misc.c b/contrib/tcp_wrappers/misc.c --- a/contrib/tcp_wrappers/misc.c +++ b/contrib/tcp_wrappers/misc.c @@ -25,10 +25,7 @@ /* xgets - fgets() with backslash-newline stripping */ -char *xgets(ptr, len, fp) -char *ptr; -int len; -FILE *fp; +char *xgets(char *ptr, int len, FILE *fp) { int got; char *start = ptr; @@ -52,9 +49,7 @@ /* split_at - break string at delimiter or return NULL */ -char *split_at(string, delimiter) -char *string; -int delimiter; +char *split_at(char *string, int delimiter) { char *cp; @@ -87,8 +82,7 @@ /* dot_quad_addr - convert dotted quad to internal form */ -unsigned long dot_quad_addr(str) -char *str; +unsigned long dot_quad_addr(char *str) { int in_run = 0; int runs = 0; diff --git a/contrib/tcp_wrappers/miscd.c b/contrib/tcp_wrappers/miscd.c --- a/contrib/tcp_wrappers/miscd.c +++ b/contrib/tcp_wrappers/miscd.c @@ -43,9 +43,7 @@ int allow_severity = SEVERITY; /* run-time adjustable */ int deny_severity = LOG_WARNING; /* ditto */ -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { struct request_info request; char path[MAXPATHNAMELEN]; diff --git a/contrib/tcp_wrappers/myvsyslog.c b/contrib/tcp_wrappers/myvsyslog.c --- a/contrib/tcp_wrappers/myvsyslog.c +++ b/contrib/tcp_wrappers/myvsyslog.c @@ -18,10 +18,7 @@ #include "tcpd.h" #include "mystdarg.h" -myvsyslog(severity, format, ap) -int severity; -char *format; -va_list ap; +myvsyslog(int severity, char *format, va_list ap) { char fbuf[BUFSIZ]; char obuf[3 * STRING_LENGTH]; diff --git a/contrib/tcp_wrappers/ncr.c b/contrib/tcp_wrappers/ncr.c --- a/contrib/tcp_wrappers/ncr.c +++ b/contrib/tcp_wrappers/ncr.c @@ -24,8 +24,7 @@ /* fromhost - tear down the streams stack then rebuild it */ -void fromhost(request) -struct request_info *request; +void fromhost(struct request_info *request) { int i; int num_mod; diff --git a/contrib/tcp_wrappers/options.c b/contrib/tcp_wrappers/options.c --- a/contrib/tcp_wrappers/options.c +++ b/contrib/tcp_wrappers/options.c @@ -95,7 +95,8 @@ struct option { char *name; /* keyword name, case is ignored */ - void (*func) (); /* function that does the real work */ + void (*func) (char *value, struct request_info *request); + /* function that does the real work */ int flags; /* see below... */ }; @@ -132,9 +133,7 @@ /* process_options - process access control options */ -void process_options(options, request) -char *options; -struct request_info *request; +void process_options(char *options, struct request_info *request) { char *key; char *value; @@ -218,9 +217,7 @@ /* banners_option - expand %, terminate each line with CRLF */ -static void banners_option(value, request) -char *value; -struct request_info *request; +static void banners_option(char *value, struct request_info *request) { char path[MAXPATHNAMELEN]; char ibuf[BUFSIZ]; @@ -250,9 +247,7 @@ /* ARGSUSED */ -static void group_option(value, request) -char *value; -struct request_info *request; +static void group_option(char *value, struct request_info *request) { struct group *grp; struct group *getgrnam(); @@ -269,9 +264,7 @@ /* ARGSUSED */ -static void user_option(value, request) -char *value; -struct request_info *request; +static void user_option(char *value, struct request_info *request) { struct passwd *pwd; struct passwd *getpwnam(); @@ -291,9 +284,7 @@ /* ARGSUSED */ -static void umask_option(value, request) -char *value; -struct request_info *request; +static void umask_option(char *value, struct request_info *request) { unsigned mask; char junk; @@ -307,9 +298,7 @@ /* ARGSUSED */ -static void spawn_option(value, request) -char *value; -struct request_info *request; +static void spawn_option(char *value, struct request_info *request) { if (dry_run == 0) shell_cmd(value); @@ -319,9 +308,7 @@ /* ARGSUSED */ -static void linger_option(value, request) -char *value; -struct request_info *request; +static void linger_option(char *value, struct request_info *request) { struct linger linger; char junk; @@ -341,9 +328,7 @@ /* ARGSUSED */ -static void keepalive_option(value, request) -char *value; -struct request_info *request; +static void keepalive_option(char *value, struct request_info *request) { static int on = 1; @@ -356,9 +341,7 @@ /* ARGSUSED */ -static void nice_option(value, request) -char *value; -struct request_info *request; +static void nice_option(char *value, struct request_info *request) { int niceval = 10; char junk; @@ -371,9 +354,7 @@ /* twist_option - replace process by shell command */ -static void twist_option(value, request) -char *value; -struct request_info *request; +static void twist_option(char *value, struct request_info *request) { char *error; @@ -409,9 +390,7 @@ /* rfc931_option - look up remote user name */ -static void rfc931_option(value, request) -char *value; -struct request_info *request; +static void rfc931_option(char *value, struct request_info *request) { int timeout; char junk; @@ -428,9 +407,7 @@ /* ARGSUSED */ -static void setenv_option(value, request) -char *value; -struct request_info *request; +static void setenv_option(char *value, struct request_info *request) { char *var_value; @@ -442,9 +419,7 @@ /* severity_map - lookup facility or severity value */ -static int severity_map(table, name) -const CODE *table; -char *name; +static int severity_map(const CODE *table, char *name) { const CODE *t; int ret = -1; @@ -464,9 +439,7 @@ /* ARGSUSED */ -static void severity_option(value, request) -char *value; -struct request_info *request; +static void severity_option(char *value, struct request_info *request) { char *level = split_at(value, '.'); @@ -477,8 +450,7 @@ /* get_field - return pointer to next field in string */ -static char *get_field(string) -char *string; +static char *get_field(char *string) { static char *last = ""; char *src; @@ -520,8 +492,7 @@ /* chop_string - strip leading and trailing blanks from string */ -static char *chop_string(string) -register char *string; +static char *chop_string(register char *string) { char *start = 0; char *end; diff --git a/contrib/tcp_wrappers/percent_m.c b/contrib/tcp_wrappers/percent_m.c --- a/contrib/tcp_wrappers/percent_m.c +++ b/contrib/tcp_wrappers/percent_m.c @@ -19,9 +19,7 @@ #include "mystdarg.h" -char *percent_m(obuf, ibuf) -char *obuf; -char *ibuf; +char *percent_m(char *obuf, char *ibuf) { char *bp = obuf; char *cp = ibuf; diff --git a/contrib/tcp_wrappers/percent_x.c b/contrib/tcp_wrappers/percent_x.c --- a/contrib/tcp_wrappers/percent_x.c +++ b/contrib/tcp_wrappers/percent_x.c @@ -29,11 +29,8 @@ /* percent_x - do % expansion, abort if result buffer is too small */ -char *percent_x(result, result_len, string, request) -char *result; -int result_len; -char *string; -struct request_info *request; +char *percent_x(char *result, int result_len, char *string, + struct request_info *request) { char *bp = result; char *end = result + result_len - 1; /* end of result buffer */ diff --git a/contrib/tcp_wrappers/ptx.c b/contrib/tcp_wrappers/ptx.c --- a/contrib/tcp_wrappers/ptx.c +++ b/contrib/tcp_wrappers/ptx.c @@ -35,8 +35,7 @@ /* tli_host - determine TLI endpoint info, PTX version */ -void tli_host(request) -struct request_info *request; +void tli_host(struct request_info *request) { static struct sockaddr_in client; static struct sockaddr_in server; @@ -81,8 +80,7 @@ /* ptx_sink - absorb unreceived IP datagram */ -static void ptx_sink(fd) -int fd; +static void ptx_sink(int fd) { char buf[BUFSIZ]; struct sockaddr sa; diff --git a/contrib/tcp_wrappers/refuse.c b/contrib/tcp_wrappers/refuse.c --- a/contrib/tcp_wrappers/refuse.c +++ b/contrib/tcp_wrappers/refuse.c @@ -24,8 +24,7 @@ /* refuse - refuse request */ -void refuse(request) -struct request_info *request; +void refuse(struct request_info *request) { #ifdef INET6 syslog(deny_severity, "refused connect from %s (%s)", diff --git a/contrib/tcp_wrappers/rfc931.c b/contrib/tcp_wrappers/rfc931.c --- a/contrib/tcp_wrappers/rfc931.c +++ b/contrib/tcp_wrappers/rfc931.c @@ -44,10 +44,7 @@ /* fsocket - open stdio stream on top of socket */ -static FILE *fsocket(domain, type, protocol) -int domain; -int type; -int protocol; +static FILE *fsocket(int domain, int type, int protocol) { int s; FILE *fp; @@ -73,15 +70,12 @@ /* rfc931 - return remote user name, given socket structures */ -void rfc931(rmt_sin, our_sin, dest) #ifdef INET6 -struct sockaddr *rmt_sin; -struct sockaddr *our_sin; +void rfc931(struct sockaddr *rmt_sin, struct sockaddr *our_sin, char *dest) #else -struct sockaddr_in *rmt_sin; -struct sockaddr_in *our_sin; +void rfc931(struct sockaddr_in *rmt_sin, struct sockaddr_in *our_sin, + char *dest) #endif -char *dest; { unsigned rmt_port; unsigned our_port; diff --git a/contrib/tcp_wrappers/safe_finger.c b/contrib/tcp_wrappers/safe_finger.c --- a/contrib/tcp_wrappers/safe_finger.c +++ b/contrib/tcp_wrappers/safe_finger.c @@ -49,9 +49,7 @@ exit(0); } -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { int c; int line_length = 0; @@ -135,8 +133,7 @@ /* perror_exit - report system error text and terminate */ -void perror_exit(text) -char *text; +void perror_exit(char *text) { perror(text); exit(1); @@ -144,8 +141,7 @@ /* pipe_stdin - pipe stdin through program (from my ANSI to OLD C converter) */ -int pipe_stdin(argv) -char **argv; +int pipe_stdin(char **argv) { int pipefds[2]; int pid; diff --git a/contrib/tcp_wrappers/scaffold.c b/contrib/tcp_wrappers/scaffold.c --- a/contrib/tcp_wrappers/scaffold.c +++ b/contrib/tcp_wrappers/scaffold.c @@ -43,8 +43,7 @@ #ifndef INET6 /* dup_hostent - create hostent in one memory block */ -static struct hostent *dup_hostent(hp) -struct hostent *hp; +static struct hostent *dup_hostent(struct hostent *hp) { struct hostent_block { struct hostent host; @@ -80,8 +79,7 @@ /* find_inet_addr - find all addresses for this host, result to free() */ #ifdef INET6 -struct addrinfo *find_inet_addr(host) -char *host; +struct addrinfo *find_inet_addr(char *host) { struct addrinfo hints, *res; @@ -115,8 +113,7 @@ return (res); } #else -struct hostent *find_inet_addr(host) -char *host; +struct hostent *find_inet_addr(char *host) { struct in_addr addr; struct hostent *hp; @@ -161,8 +158,7 @@ /* check_dns - give each address thorough workout, return address count */ -int check_dns(host) -char *host; +int check_dns(char *host) { struct request_info request; #ifdef INET6 @@ -215,8 +211,7 @@ /* ARGSUSED */ -void shell_cmd(command) -char *command; +void shell_cmd(char *command) { if (hosts_access_verbose) printf("command: %s", command); @@ -226,17 +221,14 @@ /* ARGSUSED */ -void clean_exit(request) -struct request_info *request; +void clean_exit(struct request_info *request) { exit(0); } /* check_path - examine accessibility */ -int check_path(path, st) -char *path; -struct stat *st; +int check_path(char *path, struct stat *st) { struct stat stbuf; char buf[BUFSIZ]; diff --git a/contrib/tcp_wrappers/setenv.c b/contrib/tcp_wrappers/setenv.c --- a/contrib/tcp_wrappers/setenv.c +++ b/contrib/tcp_wrappers/setenv.c @@ -16,10 +16,7 @@ /* setenv - update or insert environment (name,value) pair */ -int setenv(name, value, clobber) -char *name; -char *value; -int clobber; +int setenv(char *name, char *value, int clobber) { char *malloc(); char *getenv(); diff --git a/contrib/tcp_wrappers/shell_cmd.c b/contrib/tcp_wrappers/shell_cmd.c --- a/contrib/tcp_wrappers/shell_cmd.c +++ b/contrib/tcp_wrappers/shell_cmd.c @@ -36,8 +36,7 @@ /* shell_cmd - execute shell command */ -void shell_cmd(command) -char *command; +void shell_cmd(char *command) { int child_pid; int wait_pid; diff --git a/contrib/tcp_wrappers/socket.c b/contrib/tcp_wrappers/socket.c --- a/contrib/tcp_wrappers/socket.c +++ b/contrib/tcp_wrappers/socket.c @@ -52,8 +52,7 @@ * that lack DNS-style trailing dot magic, such as local files or NIS maps. */ -static struct hostent *gethostbyname_dot(name) -char *name; +static struct hostent *gethostbyname_dot(char *name) { char dot_name[MAXHOSTNAMELEN + 1]; @@ -75,8 +74,7 @@ /* sock_host - look up endpoint addresses and install conversion methods */ -void sock_host(request) -struct request_info *request; +void sock_host(struct request_info *request) { #ifdef INET6 static struct sockaddr_storage client; @@ -139,8 +137,7 @@ /* sock_hostaddr - map endpoint address to printable form */ -void sock_hostaddr(host) -struct host_info *host; +void sock_hostaddr(struct host_info *host) { #ifdef INET6 struct sockaddr *sin = host->sin; @@ -166,8 +163,7 @@ /* sock_hostname - map endpoint address to host name */ -void sock_hostname(host) -struct host_info *host; +void sock_hostname(struct host_info *host) { #ifdef INET6 struct sockaddr *sin = host->sin; diff --git a/contrib/tcp_wrappers/strcasecmp.c b/contrib/tcp_wrappers/strcasecmp.c --- a/contrib/tcp_wrappers/strcasecmp.c +++ b/contrib/tcp_wrappers/strcasecmp.c @@ -66,8 +66,7 @@ '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', }; -strcasecmp(s1, s2) - char *s1, *s2; +strcasecmp(char *s1, char *s2) { register u_char *cm = charmap, *us1 = (u_char *)s1, @@ -79,9 +78,7 @@ return(cm[*us1] - cm[*--us2]); } -strncasecmp(s1, s2, n) - char *s1, *s2; - register int n; +strncasecmp(char *s1, char *s2, register int n) { register u_char *cm = charmap, *us1 = (u_char *)s1, diff --git a/contrib/tcp_wrappers/tcpd.c b/contrib/tcp_wrappers/tcpd.c --- a/contrib/tcp_wrappers/tcpd.c +++ b/contrib/tcp_wrappers/tcpd.c @@ -44,9 +44,7 @@ int allow_severity = SEVERITY; /* run-time adjustable */ int deny_severity = LOG_WARNING; /* ditto */ -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { struct request_info request; char path[MAXPATHNAMELEN]; diff --git a/contrib/tcp_wrappers/tcpdchk.c b/contrib/tcp_wrappers/tcpdchk.c --- a/contrib/tcp_wrappers/tcpdchk.c +++ b/contrib/tcp_wrappers/tcpdchk.c @@ -89,9 +89,7 @@ static int allow_check; static char *inetcf; -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { struct request_info request; struct stat st; @@ -192,9 +190,7 @@ /* parse_table - like table_match(), but examines _all_ entries */ -static void parse_table(table, request) -char *table; -struct request_info *request; +static void parse_table(char *table, struct request_info *request) { FILE *fp; int real_verdict; @@ -268,9 +264,7 @@ /* print_list - pretty-print a list */ -static void print_list(title, list) -char *title; -char *list; +static void print_list(char *title, char *list) { char buf[BUFLEN]; char *cp; @@ -290,8 +284,7 @@ /* check_daemon_list - criticize daemon list */ -static void check_daemon_list(list) -char *list; +static void check_daemon_list(char *list) { char buf[BUFLEN]; char *cp; @@ -318,8 +311,7 @@ /* check_client_list - criticize client list */ -static void check_client_list(list) -char *list; +static void check_client_list(char *list) { char buf[BUFLEN]; char *cp; @@ -347,8 +339,7 @@ /* check_daemon - criticize daemon pattern */ -static void check_daemon(pat) -char *pat; +static void check_daemon(char *pat) { if (pat[0] == '@') { tcpd_warn("%s: daemon name begins with \"@\"", pat); @@ -381,8 +372,7 @@ /* check_user - criticize user pattern */ -static void check_user(pat) -char *pat; +static void check_user(char *pat) { if (pat[0] == '@') { /* @netgroup */ tcpd_warn("%s: user name begins with \"@\"", pat); @@ -404,8 +394,7 @@ } #ifdef INET6 -static int is_inet6_addr(pat) - char *pat; +static int is_inet6_addr(char *pat) { struct addrinfo hints, *res; int len, ret; @@ -430,8 +419,7 @@ /* check_host - criticize host pattern */ -static int check_host(pat) -char *pat; +static int check_host(char *pat) { char buf[BUFSIZ]; char *mask; @@ -515,8 +503,7 @@ /* reserved_name - determine if name is reserved */ -static int reserved_name(pat) -char *pat; +static int reserved_name(char *pat) { return (STR_EQ(pat, unknown) || STR_EQ(pat, "KNOWN") diff --git a/contrib/tcp_wrappers/tcpdmatch.c b/contrib/tcp_wrappers/tcpdmatch.c --- a/contrib/tcp_wrappers/tcpdmatch.c +++ b/contrib/tcp_wrappers/tcpdmatch.c @@ -53,9 +53,7 @@ /* The main program */ -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { #ifdef INET6 struct addrinfo hints, *hp, *res; @@ -316,8 +314,7 @@ /* Explain how to use this program */ -static void usage(myname) -char *myname; +static void usage(char *myname) { fprintf(stderr, "usage: %s [-d] [-i inet_conf] daemon[@host] [user@]host\n", myname); @@ -328,10 +325,7 @@ /* Print interesting expansions */ -static void expand(text, pattern, request) -char *text; -char *pattern; -struct request_info *request; +static void expand(char *text, char *pattern, struct request_info *request) { char buf[BUFSIZ]; @@ -341,8 +335,7 @@ /* Try out a (server,client) pair */ -static void tcpdmatch(request) -struct request_info *request; +static void tcpdmatch(struct request_info *request) { int verdict; diff --git a/contrib/tcp_wrappers/tli-sequent.c b/contrib/tcp_wrappers/tli-sequent.c --- a/contrib/tcp_wrappers/tli-sequent.c +++ b/contrib/tcp_wrappers/tli-sequent.c @@ -48,8 +48,7 @@ /* tli_host - determine endpoint info */ -int tli_host(request) -struct request_info *request; +int tli_host(struct request_info *request) { static struct sockaddr_in client; static struct sockaddr_in server; @@ -144,7 +143,7 @@ /* tli_error - convert tli error number to text */ -static char *tli_error() +static char *tli_error(void) { static char buf[40]; @@ -167,8 +166,7 @@ /* tli_sink - absorb unreceived datagram */ -static void tli_sink(fd) -int fd; +static void tli_sink(int fd) { struct t_unitdata *unit; int flags; diff --git a/contrib/tcp_wrappers/tli.c b/contrib/tcp_wrappers/tli.c --- a/contrib/tcp_wrappers/tli.c +++ b/contrib/tcp_wrappers/tli.c @@ -63,8 +63,7 @@ /* tli_host - look up endpoint addresses and install conversion methods */ -void tli_host(request) -struct request_info *request; +void tli_host(struct request_info *request) { #ifdef INET6 static struct sockaddr_storage client; @@ -118,8 +117,7 @@ /* tli_cleanup - cleanup some dynamically-allocated data structures */ -static void tli_cleanup(request) -struct request_info *request; +static void tli_cleanup(struct request_info *request) { if (request->config != 0) freenetconfigent(request->config); @@ -131,8 +129,7 @@ /* tli_endpoints - determine TLI client and server endpoint information */ -static void tli_endpoints(request) -struct request_info *request; +static void tli_endpoints(struct request_info *request) { struct t_unitdata *server; struct t_unitdata *client; @@ -240,8 +237,7 @@ /* tli_hostaddr - map TLI transport address to printable address */ -static void tli_hostaddr(host) -struct host_info *host; +static void tli_hostaddr(struct host_info *host) { struct request_info *request = host->request; struct netconfig *config = request->config; @@ -257,8 +253,7 @@ /* tli_hostname - map TLI transport address to hostname */ -static void tli_hostname(host) -struct host_info *host; +static void tli_hostname(struct host_info *host) { struct request_info *request = host->request; struct netconfig *config = request->config; @@ -346,8 +341,7 @@ /* tli_sink - absorb unreceived datagram */ -static void tli_sink(fd) -int fd; +static void tli_sink(int fd) { struct t_unitdata *unit; int flags; diff --git a/contrib/tcp_wrappers/try-from.c b/contrib/tcp_wrappers/try-from.c --- a/contrib/tcp_wrappers/try-from.c +++ b/contrib/tcp_wrappers/try-from.c @@ -37,9 +37,7 @@ int allow_severity = SEVERITY; /* run-time adjustable */ int deny_severity = LOG_WARNING; /* ditto */ -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { struct request_info request; char buf[BUFSIZ]; diff --git a/contrib/tcp_wrappers/update.c b/contrib/tcp_wrappers/update.c --- a/contrib/tcp_wrappers/update.c +++ b/contrib/tcp_wrappers/update.c @@ -33,9 +33,8 @@ /* request_fill - request update engine */ -static struct request_info *request_fill(request, ap) -struct request_info *request; -va_list ap; +static struct request_info *request_fill(struct request_info *request, + va_list ap) { int key; char *ptr; diff --git a/contrib/tcp_wrappers/vfprintf.c b/contrib/tcp_wrappers/vfprintf.c --- a/contrib/tcp_wrappers/vfprintf.c +++ b/contrib/tcp_wrappers/vfprintf.c @@ -20,10 +20,7 @@ /* vfprintf - print variable-length argument list to stream */ -int vfprintf(fp, format, ap) -FILE *fp; -char *format; -va_list ap; +int vfprintf(FILE *fp, char *format, va_list ap) { char fmt[BUFSIZ]; /* format specifier */ register char *fmtp; @@ -117,9 +114,7 @@ /* vprintf - print variable-length argument list to stdout */ -vprintf(format, ap) -char *format; -va_list ap; +vprintf(char *format, va_list ap) { return (vfprintf(stdout, format, ap)); } diff --git a/contrib/tcp_wrappers/workarounds.c b/contrib/tcp_wrappers/workarounds.c --- a/contrib/tcp_wrappers/workarounds.c +++ b/contrib/tcp_wrappers/workarounds.c @@ -59,8 +59,7 @@ #undef inet_addr -long fix_inet_addr(string) -char *string; +long fix_inet_addr(char *string) { return (inet_addr(string).s_addr); } @@ -80,10 +79,7 @@ #undef fgets -char *fix_fgets(buf, len, fp) -char *buf; -int len; -FILE *fp; +char *fix_fgets(char *buf, int len, FILE *fp) { char *cp = buf; int c; @@ -123,13 +119,8 @@ #undef recvfrom -int fix_recvfrom(sock, buf, buflen, flags, from, fromlen) -int sock; -char *buf; -int buflen; -int flags; -struct sockaddr *from; -int *fromlen; +int fix_recvfrom(int sock, char *buf, int buflen, int flags, + struct sockaddr *from, int *fromlen) { int ret; @@ -163,10 +154,7 @@ #undef getpeername -int fix_getpeername(sock, sa, len) -int sock; -struct sockaddr *sa; -int *len; +int fix_getpeername(int sock, struct sockaddr *sa, int *len) { int ret; #ifdef INET6 @@ -202,8 +190,7 @@ #ifdef USE_GETDOMAIN -int yp_get_default_domain(ptr) -char **ptr; +int yp_get_default_domain(char **ptr) { static char mydomain[MAXHOSTNAMELEN]; @@ -231,8 +218,7 @@ #undef gethostbyname -struct hostent *fix_gethostbyname(name) -char *name; +struct hostent *fix_gethostbyname(char *name) { struct hostent *hp; struct in_addr addr; @@ -269,9 +255,7 @@ #ifdef USE_STRSEP -char *fix_strtok(buf, sep) -char *buf; -char *sep; +char *fix_strtok(char *buf, char *sep) { static char *state; char *result; @@ -294,9 +278,7 @@ #ifdef LIBC_CALLS_STRTOK -char *my_strtok(buf, sep) -char *buf; -char *sep; +char *my_strtok(char *buf, char *sep) { static char *state; char *result;