From patchwork Fri Oct 18 02:00:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3900 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:29d4:b0:5b9:581e:f939 with SMTP id g20csp611306max; Thu, 17 Oct 2024 19:01:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVyxUsbPrARJnqzvXjjrbAU6+j3bSk0TEbpUFNDya6WKmxuh6rnfdjHw4ul7nJpH7/ybxaJR3o8ks0=@openvpn.net X-Google-Smtp-Source: AGHT+IGthsGf5QrtEJKhQEHaEXvgd2RpjhS8BQ3BVg/yHG9fAUo4GUAS+jlN0u9OnaJpqG/VzCI9 X-Received: by 2002:a05:6e02:1a2a:b0:3a3:b1c4:8198 with SMTP id e9e14a558f8ab-3a3f40ab520mr6132255ab.20.1729216866077; Thu, 17 Oct 2024 19:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729216866; cv=none; d=google.com; s=arc-20240605; b=ifkyVjy2r/1BeMl2qG7vEw4IHhqy0HFuY6hVmfIWBwdXgYSDz0jFfqrTazF/z9uD7f ztICRPQ2s9gTqrOoMCQD5gWTlJOwagaHIKMotCoAgnPB7OmPUzv/jTA/uJoukf6YZZgK SNI7B30JaOLQJ3rA6hIqxSfmpdrb8iAHj6GMVYam5t/DWp1R4tsRRhp8ISVLPusISTV/ pwBbGDF0zgFQ1+4H97CmIMlnsTFuwPu69iX6z52dOaFpxStYojvfCbH1hJkPgIcrttDb 39CXnsoyIjJMyXxpIukLZ7LRdJCh77HIdPlPN+Wb1Qw2af1JTW5/hGI0UXEHQrfEwRXj 7eYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=qTQIFfXAtpA/2En4013Dwav+xD7BXiMl4aH0ATa4Hjg=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=FCXAt2pUd2LDjpKn6R0NnniEsDZuee3UZMJe0FQ0CPb0Lmt1wv0zPcIPFTcQ4A8JtU P7D5cxKcE949sqpLV+YEfs/rKAiRIMOa7Dq1IBkk1l4RorL5f9XlGvZvNf/Mq48QRJma JXALNClTb0Lfe6c8czvSUGqHJw4AfZsXPTQfD2qsX3F5c8Ly1YRSQ9Gs5Y5DSIkg8rsk O1F/BdhzMrXFGCg2XJDE494KcXjIxGwZny50Sm3LxW2QmBh01KOKxHFTA18OF3s5vYjL Lj+BHsGrrQtso9UByHvJPkddczVw1r8ljrt0TU9EgRJu6w8sEaLV/Ahdh+Qz1GCeWrfL tqqw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=WbVzYvBE; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=hI7z6sBJ; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=Z+xXDWFM; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id e9e14a558f8ab-3a3f3fe709dsi2608375ab.53.2024.10.17.19.01.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Oct 2024 19:01:06 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=WbVzYvBE; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=hI7z6sBJ; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=Z+xXDWFM; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t1cIO-0003RD-Sl; Fri, 18 Oct 2024 02:00:52 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t1cIO-0003R7-1Y for openvpn-devel@lists.sourceforge.net; Fri, 18 Oct 2024 02:00:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=a/xBZAcCARcEazX5U/uTepGpHRc5/9q2UNCdy5gJ2wo=; b=WbVzYvBEYkzAjTI2JuP+9WqyAY LZ9Oe5CALWJ45OnfUgVxoMWi0c4WVKzJAWEsggHRrf3O10gYiDSTOdEvMIr5MruAXV/yD45fzFyQt RjZ8O4B883Pj04cs3wCB3jyjCvecRyfBs8i6LAriZVSFUhITjmR76AOw2krzO29npfXw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=a/xBZAcCARcEazX5U/uTepGpHRc5/9q2UNCdy5gJ2wo=; b=h I7z6sBJd9gQPBLl71lGk5keNftG+RkkQ9/OdAPfDLFIEGAAwWZCFSycPSQgruoT4kq5ZRVx9SgcjX OJAsatb5APzxwRUvVrUpeGm3Ia9SciXyFeHtETYt48oFu1ni/SmGHFyU5fRqnDmQlGKtsufPoK4ls cVs1y5corvK77ZIM=; Received: from mail-wr1-f44.google.com ([209.85.221.44]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1t1cIL-0006Vj-Aw for openvpn-devel@lists.sourceforge.net; Fri, 18 Oct 2024 02:00:51 +0000 Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-37d47eff9acso983646f8f.3 for ; Thu, 17 Oct 2024 19:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1729216842; x=1729821642; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=a/xBZAcCARcEazX5U/uTepGpHRc5/9q2UNCdy5gJ2wo=; b=Z+xXDWFMYQSTjlI1xB+XaczfPZEbMP9d9OVVjnpfomaEO4HwDYFXnmFCQ05cBfQKUd jRd9wwtS+C+CHGZC3ycn6ttlvdjVHwVsLSEYB6vXEaSpiX9hwfrLVVz3XwynbZRtyXYv iJh4Rhn9CCeI1CNHxu3KVSt0NB5hWQUdUHUOtLsakOvFKeJY58oeS/n2EUiTwiZv6CH8 oFwNUTUQ/4cofqpSIspbYYl57d2WsUbq0BDf1p7y+bFVOhB9HekHG1njk2llQ7JaubYr uBIjgQkkPrYGxqdsKN4E5SrEwaw48KT5RgK/CeKPfODca9J6x4U0d23huEiAT+R0YIbA /ZPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729216842; x=1729821642; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a/xBZAcCARcEazX5U/uTepGpHRc5/9q2UNCdy5gJ2wo=; b=WKpc2ihP8uZa91Qh8jglqOzSaYnUpglYSqlEXE/s3Y0zHDOd+QxU2YjsLeL5V/EBO3 2sXKsW4KpNIysQ3waFo/ccBqI5/rAlKqm7lTOAzdK3nwLQ5BFeFrwQvVjY6tiRzU4kn/ eEkWhM5xkETw0O9Sudp//RgiTfCc+hQk27lqofZ+VjyZA9GvI+cf2bX4awi2Fv+uipr2 ZBDNTgtRMm6Mr6/hVCu4GUdVNyaIKWKoxQfRs5gmvRYLhF6mz6kw77H4HB0tbPvxLoky MtreDt9w5e9taVY7VuHES/SMY7endXTAAGiS6MA7r1XCJjKmQ1ZJ1+EhVdbHNRp6upYF ljvw== X-Gm-Message-State: AOJu0YxQf5mGYU3vzbz5TKgE7ObrvvO5Oz2sxPlQCDydeivcdtLYxiPX K3esotwES/24dOLxpry+ljJR+uwHdNcuaNRbZeVnGZIMbnxvp3AmBYJEM5iJXmSCrY8KNB3v23Q F X-Received: by 2002:a5d:58db:0:b0:37d:446b:7dfa with SMTP id ffacd0b85a97d-37eab6ee0edmr493821f8f.39.1729216842159; Thu, 17 Oct 2024 19:00:42 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ecf146a6asm513334f8f.117.2024.10.17.19.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 19:00:40 -0700 (PDT) From: "plaisthos (Code Review)" X-Google-Original-From: "plaisthos (Code Review)" X-Gerrit-PatchSet: 1 Date: Fri, 18 Oct 2024 02:00:39 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I0d96ee06c355c6a5ce082af23921e329d3efae33 X-Gerrit-Change-Number: 783 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: daf0952789006d1cde526e2452a0f2a13366b108 References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-1.5 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.3 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.44 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.44 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1t1cIL-0006Vj-Aw Subject: [Openvpn-devel] [M] Change in openvpn[master]: Remove a large number of unused structs and functions X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1813215304554770441?= X-GMAIL-MSGID: =?utf-8?q?1813215304554770441?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/783?usp=email to review the following change. Change subject: Remove a large number of unused structs and functions ...................................................................... Remove a large number of unused structs and functions These have been found by Clion's Inspect Code functionality and have been verified by hand. A few functions like buf_read_u32 have been kept since they still feel being useful while currently not being used. Change-Id: I0d96ee06c355c6a5ce082af23921e329d3efae33 Signed-off-by: Arne Schwabe --- M src/openvpn/buffer.c M src/openvpn/buffer.h M src/openvpn/crypto_mbedtls.h M src/openvpn/crypto_openssl.h M src/openvpn/error.h M src/openvpn/fragment.h M src/openvpn/init.c M src/openvpn/manage.c M src/openvpn/manage.h M src/openvpn/misc.h M src/openvpn/mtcp.c M src/openvpn/mtcp.h M src/openvpn/openvpn.h M src/openvpn/packet_id.h M src/openvpn/platform.c M src/openvpn/platform.h M src/openvpn/proto.h M src/openvpn/proxy.h M src/openvpn/ps.h M src/openvpn/shaper.h M src/openvpn/socket.h M tests/unit_tests/openvpn/test_buffer.c M tests/unit_tests/openvpn/test_pkt.c 23 files changed, 0 insertions(+), 162 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/83/783/1 diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c index 9ee76aa..b2a5bf5 100644 --- a/src/openvpn/buffer.c +++ b/src/openvpn/buffer.c @@ -296,24 +296,6 @@ } } -/* - * convert a multi-line output to one line - */ -void -convert_to_one_line(struct buffer *buf) -{ - uint8_t *cp = BPTR(buf); - int len = BLEN(buf); - while (len--) - { - if (*cp == '\n') - { - *cp = '|'; - } - ++cp; - } -} - bool buffer_write_file(const char *filename, const struct buffer *buf) { diff --git a/src/openvpn/buffer.h b/src/openvpn/buffer.h index 8a40010..2f804fb 100644 --- a/src/openvpn/buffer.h +++ b/src/openvpn/buffer.h @@ -487,11 +487,6 @@ void buf_catrunc(struct buffer *buf, const char *str); /* - * convert a multi-line output to one line - */ -void convert_to_one_line(struct buffer *buf); - -/* * Parse a string based on a given delimiter char */ bool buf_parse(struct buffer *buf, const int delim, char *line, const int size); diff --git a/src/openvpn/crypto_mbedtls.h b/src/openvpn/crypto_mbedtls.h index 48d1e20..a966a7a 100644 --- a/src/openvpn/crypto_mbedtls.h +++ b/src/openvpn/crypto_mbedtls.h @@ -75,7 +75,6 @@ #define MD5_DIGEST_LENGTH 16 #define SHA_DIGEST_LENGTH 20 #define SHA256_DIGEST_LENGTH 32 -#define DES_KEY_LENGTH 8 /** * Returns a singleton instance of the mbed TLS random number generator. diff --git a/src/openvpn/crypto_openssl.h b/src/openvpn/crypto_openssl.h index 4cd988a..288c2fa 100644 --- a/src/openvpn/crypto_openssl.h +++ b/src/openvpn/crypto_openssl.h @@ -93,7 +93,6 @@ /** Cipher should decrypt */ #define OPENVPN_OP_DECRYPT 0 -#define DES_KEY_LENGTH 8 #define MD4_DIGEST_LENGTH 16 /** diff --git a/src/openvpn/error.h b/src/openvpn/error.h index ab2872a..9a4577b 100644 --- a/src/openvpn/error.h +++ b/src/openvpn/error.h @@ -297,10 +297,6 @@ extern const char *x_msg_prefix; -void msg_thread_init(void); - -void msg_thread_uninit(void); - static inline void msg_set_prefix(const char *prefix) { diff --git a/src/openvpn/fragment.h b/src/openvpn/fragment.h index c3eb2ef..3cd0ee7 100644 --- a/src/openvpn/fragment.h +++ b/src/openvpn/fragment.h @@ -137,8 +137,6 @@ struct event_timeout wakeup; /**< Timeout structure used by the main * event loop to know when to do * fragmentation housekeeping. */ - bool received_os_mtu_hint; /**< Whether the operating system has - * explicitly recommended an MTU value. */ #define N_SEQ_ID 256 /**< One more than the maximum fragment * sequence ID, above which the IDs wrap diff --git a/src/openvpn/init.c b/src/openvpn/init.c index ae911a9..9371024 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -816,8 +816,6 @@ bool init_static(void) { - /* configure_path (); */ - #if defined(DMALLOC) crypto_init_dmalloc(); #endif diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index 05b5a1a..f296788 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -3797,16 +3797,6 @@ } /* - * Return true if (from the management interface's perspective) OpenVPN should - * daemonize. - */ -bool -management_should_daemonize(struct management *man) -{ - return management_would_hold(man) || (man->settings.flags & MF_QUERY_PASSWORDS); -} - -/* * If the hold flag is enabled, hibernate until a management client releases the hold. * Return true if the caller should not sleep for an additional time interval. */ diff --git a/src/openvpn/manage.h b/src/openvpn/manage.h index 1896510..f501543 100644 --- a/src/openvpn/manage.h +++ b/src/openvpn/manage.h @@ -390,8 +390,6 @@ #endif -bool management_should_daemonize(struct management *man); - bool management_would_hold(struct management *man); bool management_hold(struct management *man, int holdtime); diff --git a/src/openvpn/misc.h b/src/openvpn/misc.h index cdfb0de..3c46c02 100644 --- a/src/openvpn/misc.h +++ b/src/openvpn/misc.h @@ -186,9 +186,6 @@ */ const char *safe_print(const char *str, struct gc_arena *gc); - -void configure_path(void); - const char *sanitize_control_message(const char *str, struct gc_arena *gc); /* diff --git a/src/openvpn/mtcp.c b/src/openvpn/mtcp.c index 96408d1..3ae8be7 100644 --- a/src/openvpn/mtcp.c +++ b/src/openvpn/mtcp.c @@ -63,14 +63,6 @@ #define MTCP_N ((void *)16) /* upper bound on MTCP_x */ -struct ta_iow_flags -{ - unsigned int flags; - unsigned int ret; - unsigned int tun; - unsigned int sock; -}; - #ifdef ENABLE_DEBUG static const char * pract(int action) diff --git a/src/openvpn/mtcp.h b/src/openvpn/mtcp.h index 886d2cc..ab968e9 100644 --- a/src/openvpn/mtcp.h +++ b/src/openvpn/mtcp.h @@ -58,9 +58,6 @@ void multi_tcp_instance_specific_free(struct multi_instance *mi); -void multi_tcp_link_out_deferred(struct multi_context *m, struct multi_instance *mi); - - /**************************************************************************/ /** * Main event loop for OpenVPN in TCP server mode. diff --git a/src/openvpn/openvpn.h b/src/openvpn/openvpn.h index e98c93e..8dfcab4 100644 --- a/src/openvpn/openvpn.h +++ b/src/openvpn/openvpn.h @@ -200,10 +200,6 @@ /**< Hash of option strings received from the * remote OpenVPN server. Only used in * client-mode. */ - - struct user_pass *auth_user_pass; - /**< Username and password for - * authentication. */ }; diff --git a/src/openvpn/packet_id.h b/src/openvpn/packet_id.h index 558361a..3778d19 100644 --- a/src/openvpn/packet_id.h +++ b/src/openvpn/packet_id.h @@ -318,23 +318,6 @@ return p->id >= PACKET_ID_WRAP_TRIGGER; } -static inline bool -check_timestamp_delta(time_t remote, unsigned int max_delta) -{ - unsigned int abs; - const time_t local_now = now; - - if (local_now >= remote) - { - abs = local_now - remote; - } - else - { - abs = remote - local_now; - } - return abs <= max_delta; -} - static inline void packet_id_reap_test(struct packet_id_rec *p) { diff --git a/src/openvpn/platform.c b/src/openvpn/platform.c index 3d9d59e..d1cb7d1 100644 --- a/src/openvpn/platform.c +++ b/src/openvpn/platform.c @@ -483,19 +483,6 @@ #endif } -/* - * Go to sleep indefinitely. - */ -void -platform_sleep_until_signal(void) -{ -#ifdef _WIN32 - ASSERT(0); -#else - select(0, NULL, NULL, NULL, NULL); -#endif -} - /* delete a file, return true if succeeded */ bool platform_unlink(const char *filename) diff --git a/src/openvpn/platform.h b/src/openvpn/platform.h index 181cb71..81c222c 100644 --- a/src/openvpn/platform.h +++ b/src/openvpn/platform.h @@ -131,13 +131,9 @@ void platform_sleep_milliseconds(unsigned int n); -void platform_sleep_until_signal(void); - /* delete a file, return true if succeeded */ bool platform_unlink(const char *filename); -int platform_putenv(char *string); - FILE *platform_fopen(const char *path, const char *mode); int platform_open(const char *path, int flags, int mode); diff --git a/src/openvpn/proto.h b/src/openvpn/proto.h index a160fb6..7b94fbc 100644 --- a/src/openvpn/proto.h +++ b/src/openvpn/proto.h @@ -83,25 +83,6 @@ #define SIZE_ETH_TO_8021Q_HDR (sizeof(struct openvpn_8021qhdr) \ - sizeof(struct openvpn_ethhdr)) - -struct openvpn_arp { -#define ARP_MAC_ADDR_TYPE 0x0001 - uint16_t mac_addr_type; /* 0x0001 */ - - uint16_t proto_addr_type; /* 0x0800 */ - uint8_t mac_addr_size; /* 0x06 */ - uint8_t proto_addr_size; /* 0x04 */ - -#define ARP_REQUEST 0x0001 -#define ARP_REPLY 0x0002 - uint16_t arp_command; /* 0x0001 for ARP request, 0x0002 for ARP reply */ - - uint8_t mac_src[OPENVPN_ETH_ALEN]; - in_addr_t ip_src; - uint8_t mac_dest[OPENVPN_ETH_ALEN]; - in_addr_t ip_dest; -}; - struct openvpn_iphdr { #define OPENVPN_IPH_GET_VER(v) (((v) >> 4) & 0x0F) #define OPENVPN_IPH_GET_LEN(v) (((v) & 0x0F) << 2) diff --git a/src/openvpn/proxy.h b/src/openvpn/proxy.h index d9e598c..1475b87 100644 --- a/src/openvpn/proxy.h +++ b/src/openvpn/proxy.h @@ -61,12 +61,6 @@ bool nocache; }; -struct http_proxy_options_simple { - const char *server; - const char *port; - int auth_retry; -}; - struct http_proxy_info { bool defined; int auth_method; diff --git a/src/openvpn/ps.h b/src/openvpn/ps.h index f0d4d7d..1be29ae 100644 --- a/src/openvpn/ps.h +++ b/src/openvpn/ps.h @@ -30,8 +30,6 @@ #include "buffer.h" #include "ssl.h" -typedef void (*post_fork_cleanup_func_t)(void *arg); - struct port_share { /* Foreground's socket to background process */ socket_descriptor_t foreground_fd; diff --git a/src/openvpn/shaper.h b/src/openvpn/shaper.h index 8eb8db1..4783ebc 100644 --- a/src/openvpn/shaper.h +++ b/src/openvpn/shaper.h @@ -89,12 +89,6 @@ shaper_reset_wakeup(s); } -static inline int -shaper_current_bandwidth(struct shaper *s) -{ - return s->bytes_per_second; -} - /* * Returns traffic shaping delay in microseconds relative to current * time, or 0 if no delay. diff --git a/src/openvpn/socket.h b/src/openvpn/socket.h index 2e583af..04eb8a4 100644 --- a/src/openvpn/socket.h +++ b/src/openvpn/socket.h @@ -362,16 +362,6 @@ static inline const char * -print_openvpn_sockaddr_ex(const struct openvpn_sockaddr *addr, - const char *separator, - const unsigned int flags, - struct gc_arena *gc) -{ - return print_sockaddr_ex(&addr->addr.sa, separator, flags, gc); -} - -static inline -const char * print_openvpn_sockaddr(const struct openvpn_sockaddr *addr, struct gc_arena *gc) { @@ -771,22 +761,6 @@ return false; } -static inline in_addr_t -addr_host(const struct openvpn_sockaddr *addr) -{ - /* - * "public" addr returned is checked against ifconfig for - * possible clash: non sense for now given - * that we do ifconfig only IPv4 - */ - if (addr->addr.sa.sa_family != AF_INET) - { - return 0; - } - return ntohl(addr->addr.in4.sin_addr.s_addr); -} - - static inline bool addrlist_port_match(const struct openvpn_sockaddr *a1, const struct addrinfo *a2) { diff --git a/tests/unit_tests/openvpn/test_buffer.c b/tests/unit_tests/openvpn/test_buffer.c index 6b860b4..0fb4697 100644 --- a/tests/unit_tests/openvpn/test_buffer.c +++ b/tests/unit_tests/openvpn/test_buffer.c @@ -49,7 +49,6 @@ #define teststr1 "one" #define teststr2 "two" #define teststr3 "three" -#define teststr4 "four" #define assert_buf_equals_str(buf, str) \ assert_int_equal(BLEN(buf), strlen(str)); \ diff --git a/tests/unit_tests/openvpn/test_pkt.c b/tests/unit_tests/openvpn/test_pkt.c index 741c982..ebffabe 100644 --- a/tests/unit_tests/openvpn/test_pkt.c +++ b/tests/unit_tests/openvpn/test_pkt.c @@ -69,11 +69,6 @@ return "dummy print_link_socket_actual from unit test"; } -struct test_pkt_context { - struct tls_auth_standalone tas_tls_auth; - struct tls_auth_standalone tas_crypt; -}; - const char static_key[] = "\n" "-----BEGIN OpenVPN Static key V1-----\n" "37268ea8f95d7f71f9fb8fc03770c460\n"