Use ANSI C function definitions and declerations.

Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
This commit is contained in:
brooks 2019-07-17 23:09:40 +00:00
parent eb5503c168
commit 58d8ce329e
11 changed files with 42 additions and 46 deletions

View File

@ -87,16 +87,17 @@ int resident = (-1); /* -1, 0: unknown; +1: yes */
/* Forward declarations. */
static int table_match();
static int list_match();
static int server_match();
static int client_match();
static int host_match();
static int string_match();
static int masked_match();
static int table_match(char *table, struct request_info *request);
static int list_match(char *list, struct request_info *request,
int (*match_fn)(char *, struct request_info *));
static int server_match(char *tok, struct request_info *request);
static int client_match(char *tok, struct request_info *request);
static int host_match(char *tok, struct host_info *host);
static int string_match(char *tok, char *string);
static int masked_match(char *net_tok, char *mask_tok, char *string);
#ifdef INET6
static int masked_match4();
static int masked_match6();
static int masked_match4(char *net_tok, char *mask_tok, char *string);
static int masked_match6(char *net_tok, char *mask_tok, char *string);
#endif
/* Size of logical line buffer. */
@ -213,10 +214,8 @@ struct request_info *request;
/* list_match - match a request against a list of patterns with exceptions */
static int list_match(list, request, match_fn)
char *list;
struct request_info *request;
int (*match_fn) ();
static int list_match(char *list, struct request_info *request,
int (*match_fn)(char *, struct request_info *))
{
char *tok;

View File

@ -39,8 +39,9 @@ char *inet_files[] = {
0,
};
static void inet_chk();
static char *base_name();
static void inet_chk(char *protocol, char *path, char *arg0, char *arg1);
static char *base_name(char *path);
extern char *percent_m(char *obuf, char *ibuf);
/*
* Structure with everything we know about a service.
@ -69,7 +70,6 @@ char *conf;
char *arg0;
char *arg1;
struct tcpd_context saved_context;
char *percent_m();
int i;
struct stat st;

View File

@ -4,9 +4,9 @@
* Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
*/
extern char *inet_cfg(); /* read inetd.conf file */
extern void inet_set(); /* remember internet service */
extern int inet_get(); /* look up internet service */
extern char *inet_cfg(char *conf); /* read inetd.conf file */
extern void inet_set(char *name, int type); /* remember internet service */
extern int inet_get(char *name); /* look up internet service */
#define WR_UNKNOWN (-1) /* service unknown */
#define WR_NOT 1 /* may not be wrapped */

View File

@ -16,4 +16,4 @@
#define VAEND(ap) va_end(ap);}
#endif
extern char *percent_m();
extern char *percent_m(char *obuf, char *ibuf);

View File

@ -71,8 +71,8 @@ extern jmp_buf tcpd_buf; /* tcpd_jump() support */
static char whitespace_eq[] = "= \t\r\n";
#define whitespace (whitespace_eq + 1)
static char *get_field(); /* chew :-delimited field off string */
static char *chop_string(); /* strip leading and trailing blanks */
static char *get_field(char *string); /* chew :-delimited field off string */
static char *chop_string(char *string); /* strip leading and trailing blanks */
/* List of functions that implement the options. Add yours here. */

View File

@ -66,8 +66,7 @@ int protocol;
/* timeout - handle timeouts */
static void timeout(sig)
int sig;
static void timeout(int sig)
{
longjmp(timebuf, sig);
}

View File

@ -7,9 +7,9 @@
*/
#ifdef INET6
extern struct addrinfo *find_inet_addr();
extern struct addrinfo *find_inet_addr(char *host);
#else
extern struct hostent *find_inet_addr();
extern struct hostent *find_inet_addr(char *host);
#endif
extern int check_dns();
extern int check_path();
extern int check_dns(char *host);
extern int check_path(char *path, struct stat *st);

View File

@ -32,7 +32,7 @@ extern void exit();
/* Forward declarations. */
static void do_child();
static void do_child(char *command);
/* shell_cmd - execute shell command */
@ -62,8 +62,7 @@ char *command;
/* do_child - exec command with { stdin, stdout, stderr } to /dev/null */
static void do_child(command)
char *command;
static void do_child(char *command)
{
char *error;
int tmp_fd;

View File

@ -42,7 +42,7 @@ extern char *inet_ntoa();
/* Forward declarations. */
static void sock_sink();
static void sock_sink(int);
#ifdef APPEND_DOT
@ -406,8 +406,7 @@ struct host_info *host;
/* sock_sink - absorb unreceived IP datagram */
static void sock_sink(fd)
int fd;
static void sock_sink(int fd)
{
char buf[BUFSIZ];
#ifdef INET6

View File

@ -73,15 +73,15 @@ extern jmp_buf tcpd_buf;
/*
* Local stuff.
*/
static void usage();
static void parse_table();
static void print_list();
static void check_daemon_list();
static void check_client_list();
static void check_daemon();
static void check_user();
static int check_host();
static int reserved_name();
static void usage(void);
static void parse_table(char *table, struct request_info *request);
static void print_list(char *title, char *list);
static void check_daemon_list(char *list);
static void check_client_list(char *list);
static void check_daemon(char *pat);
static void check_user(char *pat);
static int check_host(char *pat);
static int reserved_name(char *pat);
#define PERMIT 1
#define DENY 0
@ -185,7 +185,7 @@ char **argv;
/* usage - explain */
static void usage()
static void usage(void)
{
fprintf(stderr, "usage: %s [-a] [-d] [-i inet_conf] [-v]\n", myname);
fprintf(stderr, " -a: report rules with implicit \"ALLOW\" at end\n");

View File

@ -51,8 +51,8 @@ extern char *optarg;
#include "inetcf.h"
#include "scaffold.h"
static void usage();
static void tcpdmatch();
static void usage(char *myname);
static void tcpdmatch(struct request_info *request);
/* The main program */