libipsec: ansify

Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Mateusz Guzik 2023-03-16 19:19:35 +00:00
parent b38688df1d
commit 58436df347
4 changed files with 17 additions and 39 deletions

View File

@ -70,9 +70,7 @@ static char *set_address(char *, size_t, struct sockaddr *);
* When delimiter == NULL, alternatively ' '(space) is applied.
*/
char *
ipsec_dump_policy(policy, delimiter)
caddr_t policy;
char *delimiter;
ipsec_dump_policy(caddr_t policy, char *delimiter)
{
struct sadb_x_policy *xpl = (struct sadb_x_policy *)policy;
struct sadb_x_ipsecrequest *xisr;
@ -175,11 +173,8 @@ ipsec_dump_policy(policy, delimiter)
}
static char *
ipsec_dump_ipsecrequest(buf, len, xisr, bound)
char *buf;
size_t len;
struct sadb_x_ipsecrequest *xisr;
size_t bound; /* boundary */
ipsec_dump_ipsecrequest(char *buf, size_t len, struct sadb_x_ipsecrequest *xisr,
size_t bound)
{
const char *proto, *mode, *level;
char abuf[NI_MAXHOST * 2 + 2];
@ -276,11 +271,7 @@ ipsec_dump_ipsecrequest(buf, len, xisr, bound)
}
static int
set_addresses(buf, len, sa1, sa2)
char *buf;
size_t len;
struct sockaddr *sa1;
struct sockaddr *sa2;
set_addresses(char *buf, size_t len, struct sockaddr *sa1, struct sockaddr *sa2)
{
char tmp1[NI_MAXHOST], tmp2[NI_MAXHOST];
@ -294,10 +285,7 @@ set_addresses(buf, len, sa1, sa2)
}
static char *
set_address(buf, len, sa)
char *buf;
size_t len;
struct sockaddr *sa;
set_address(char *buf, size_t len, struct sockaddr *sa)
{
const int niflags = NI_NUMERICHOST;

View File

@ -44,8 +44,7 @@ __FBSDID("$FreeBSD$");
#include "ipsec_strerror.h"
int
ipsec_get_policylen(policy)
caddr_t policy;
ipsec_get_policylen(caddr_t policy)
{
return policy ? PFKEY_EXTLEN(policy) : -1;
}

View File

@ -213,8 +213,7 @@ addresses
%%
void
yyerror(msg)
char *msg;
yyerror(char *msg)
{
fprintf(stderr, "libipsec: %s while parsing \"%s\"\n",
msg, __libipsecyytext);
@ -223,8 +222,7 @@ yyerror(msg)
}
static struct sockaddr *
parse_sockaddr(buf)
struct _val *buf;
parse_sockaddr(struct _val *buf)
{
struct addrinfo hints, *res;
char *serv = NULL;
@ -262,7 +260,7 @@ parse_sockaddr(buf)
}
static int
rule_check()
rule_check(void)
{
if (p_type == IPSEC_POLICY_IPSEC) {
if (p_protocol == IPPROTO_IP) {
@ -293,7 +291,7 @@ rule_check()
}
static int
init_x_policy()
init_x_policy(void)
{
struct sadb_x_policy *p;
@ -319,8 +317,7 @@ init_x_policy()
}
static int
set_x_request(src, dst)
struct sockaddr *src, *dst;
set_x_request(struct sockaddr *src, struct sockaddr *dst)
{
struct sadb_x_ipsecrequest *p;
int reqlen;
@ -351,8 +348,7 @@ set_x_request(src, dst)
}
static int
set_sockaddr(addr)
struct sockaddr *addr;
set_sockaddr(struct sockaddr *addr)
{
if (addr == NULL) {
__ipsec_errcode = EIPSEC_NO_ERROR;
@ -370,7 +366,7 @@ set_sockaddr(addr)
}
static void
policy_parse_request_init()
policy_parse_request_init(void)
{
p_protocol = IPPROTO_IP;
p_mode = IPSEC_MODE_ANY;
@ -389,9 +385,7 @@ policy_parse_request_init()
}
static caddr_t
policy_parse(msg, msglen)
char *msg;
int msglen;
policy_parse(char *msg, int msglen)
{
int error;
pbuf = NULL;
@ -421,9 +415,7 @@ policy_parse(msg, msglen)
}
caddr_t
ipsec_set_policy(msg, msglen)
char *msg;
int msglen;
ipsec_set_policy(char *msg, int msglen)
{
caddr_t policy;

View File

@ -138,8 +138,7 @@ void __policy__strbuffer__free__(void);
static YY_BUFFER_STATE strbuffer;
void
__policy__strbuffer__init__(msg)
char *msg;
__policy__strbuffer__init__(char *msg)
{
if (YY_CURRENT_BUFFER)
yy_delete_buffer(YY_CURRENT_BUFFER);
@ -150,7 +149,7 @@ __policy__strbuffer__init__(msg)
}
void
__policy__strbuffer__free__()
__policy__strbuffer__free__(void)
{
yy_delete_buffer(strbuffer);