setkey: ansify

This commit is contained in:
Mateusz Guzik 2021-07-08 11:28:34 +00:00
parent c0edde3021
commit e0c0612d9b

View File

@ -91,7 +91,7 @@ extern int lineno;
extern int parse(FILE **);
void
usage()
usage(void)
{
printf("usage: setkey [-v] -c\n");
@ -103,9 +103,7 @@ usage()
}
int
main(ac, av)
int ac;
char **av;
main(int ac, char **av)
{
FILE *fp = stdin;
int c;
@ -202,7 +200,7 @@ main(ac, av)
}
int
get_supported()
get_supported(void)
{
if (pfkey_send_register(so, SADB_SATYPE_UNSPEC) < 0)
@ -234,7 +232,7 @@ sendkeyshort(u_int type, uint8_t satype)
}
void
promisc()
promisc(void)
{
struct sadb_msg msg;
u_char rbuf[1024 * 32]; /* XXX: Enough ? Should I do MSG_PEEK ? */
@ -300,9 +298,7 @@ promisc()
}
int
sendkeymsg(buf, len)
char *buf;
size_t len;
sendkeymsg(char *buf, size_t len)
{
u_char rbuf[1024 * 32]; /* XXX: Enough ? Should I do MSG_PEEK ? */
ssize_t l;
@ -374,9 +370,7 @@ sendkeymsg(buf, len)
}
int
postproc(msg, len)
struct sadb_msg *msg;
int len;
postproc(struct sadb_msg *msg, int len)
{
if (msg->sadb_msg_errno != 0) {
@ -482,8 +476,7 @@ static const char *ipproto[] = {
(((x) < sizeof(tab)/sizeof(tab[0]) && tab[(x)]) ? tab[(x)] : numstr(x))
const char *
numstr(x)
int x;
numstr(int x)
{
static char buf[20];
snprintf(buf, sizeof(buf), "#%d", x);
@ -491,15 +484,14 @@ numstr(x)
}
void
shortdump_hdr()
shortdump_hdr(void)
{
printf("%-4s %-3s %-1s %-8s %-7s %s -> %s\n",
"time", "p", "s", "spi", "ltime", "src", "dst");
}
void
shortdump(msg)
struct sadb_msg *msg;
shortdump(struct sadb_msg *msg)
{
caddr_t mhp[SADB_EXT_MAX + 1];
char buf[NI_MAXHOST], pbuf[NI_MAXSERV];
@ -585,7 +577,7 @@ shortdump(msg)
* Print the timestamp
*/
static void
printdate()
printdate(void)
{
struct timeval tp;
int s;