From nobody Thu Mar 16 19:19:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pcxsb0Tgfz3yV08; Thu, 16 Mar 2023 19:19:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PcxsZ7364z46b0; Thu, 16 Mar 2023 19:19:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678994387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KdqVxaEVmu9x2DePdm8ajg2tEG3irGC/SJzP3qAHmSg=; b=quwHrEPHAov5JV5gTxK8IokdyWpl/iVxdw3g+FAKmNBqMvD85gcqeS5ueUZW0IoQPrSAJx uV4a4aJHc8pKBuDOPXg7lVSWDNf3pbQZJUw99agiRwnteaQ7RMsvWSgDK5h/aqh/c7bBLe ofb58WA/QxVxAWehfT3E8Hxjh5uBL/hXlzhCTrlh8pWsAiiP7R6r5xR+cgy69hy+IM42jf cfBUyvfl5WdCxbo0rdRasc1yZtfDrnbGxDg6cxRw7KDQ+mFOJhU9kJeTGrdxJwoqVx8QYB RCOOFIFez6+AwnZcqjrN4CiSS+BTbmfN87FROvhqAeHNybcyRyuHtO8zNl46fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678994387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KdqVxaEVmu9x2DePdm8ajg2tEG3irGC/SJzP3qAHmSg=; b=ASjKPsg1qM206TSWfUn2bqL5j99zP0VrMv5TU6IFX/1Jqs73s+eksanWb+mOhkv7FFekfP ubpHwu0LvSHdD5va7jIKN2xxiO1KxnFDp047phzAtY4FKDJKmbAfnVjShu26f8KEngjMW9 GuxImUQECrffKVgsjDuCH0S5MCSY58UJxC3ozohcYwyTd2rjkO5cQ7uETiBAnN/ZKy1ueC OIoalT47ej8eMXAD6WOs8mluDIEURGy13vA8/kGZV8OR4AZJHUSiGmh1hmzZLdi0vfrUBc PRWBfUT3iY8gO46rTY/HsEMLU1NOZyG44xoSILzpx1XzmBHpXGe5MEfvQH/oWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678994387; a=rsa-sha256; cv=none; b=NnkLTyPTX+VJPiLwfeZWSZpDsMovRxdVpPwy+SMfu/NtteYCz5S4iWGoqQn40+0DahXhp3 PKwBMOVB+KCpU/TR5TVOY7JjNXHpMmUfvzPa4Pjzrx3NvnPeiEoCGRao/orprWdBgYqtbG CC5F68jVfplA7C9qVCkREFafEbCd3cv1u8TKh0c4VrEIJ4CME37fX9J5wWnEpm8MKiroP/ yezR/yEQ9tDEw3aZwFX1oE26LeMG9Z2fwuh593infsdIHL0ULJBf2aFnBp+AjxY1PJecMm b8w5wi2KWtiS2F+gKJhgCbKPDtdwhprr2lSGE8HuoVAyCI/6lKJbbYjS58Hlpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcxsZ64lTzvYB; Thu, 16 Mar 2023 19:19:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GJJkqI070565; Thu, 16 Mar 2023 19:19:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GJJkrK070564; Thu, 16 Mar 2023 19:19:46 GMT (envelope-from git) Date: Thu, 16 Mar 2023 19:19:46 GMT Message-Id: <202303161919.32GJJkrK070564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 58436df347de - main - libipsec: ansify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58436df347de665f6bc635a0e3018fc6f3d0a656 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=58436df347de665f6bc635a0e3018fc6f3d0a656 commit 58436df347de665f6bc635a0e3018fc6f3d0a656 Author: Mateusz Guzik AuthorDate: 2023-03-16 19:19:35 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-16 19:19:35 +0000 libipsec: ansify Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libipsec/ipsec_dump_policy.c | 22 +++++----------------- lib/libipsec/ipsec_get_policylen.c | 3 +-- lib/libipsec/policy_parse.y | 26 +++++++++----------------- lib/libipsec/policy_token.l | 5 ++--- 4 files changed, 17 insertions(+), 39 deletions(-) diff --git a/lib/libipsec/ipsec_dump_policy.c b/lib/libipsec/ipsec_dump_policy.c index 76848f3cb0a5..46c370f4f158 100644 --- a/lib/libipsec/ipsec_dump_policy.c +++ b/lib/libipsec/ipsec_dump_policy.c @@ -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; diff --git a/lib/libipsec/ipsec_get_policylen.c b/lib/libipsec/ipsec_get_policylen.c index 37e02778ef51..04f6e3abba94 100644 --- a/lib/libipsec/ipsec_get_policylen.c +++ b/lib/libipsec/ipsec_get_policylen.c @@ -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; } diff --git a/lib/libipsec/policy_parse.y b/lib/libipsec/policy_parse.y index a9c45804ab0d..ca9c8d0431d2 100644 --- a/lib/libipsec/policy_parse.y +++ b/lib/libipsec/policy_parse.y @@ -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; diff --git a/lib/libipsec/policy_token.l b/lib/libipsec/policy_token.l index 81893912714d..c5e4d4765a5f 100644 --- a/lib/libipsec/policy_token.l +++ b/lib/libipsec/policy_token.l @@ -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);