Attention is currently required from: flichtenheld, plaisthos, stipa.
Hello plaisthos, stipa,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1610?usp=email
to look at the new patch set (#15).
Change subject: Remove various unused functions
......................................................................
Remove various unused functions
Change-Id: I82a4e82ff876fab715e052de1903c65b835360b5
Signed-off-by: Frank Lichtenheld <[email protected]>
---
M src/openvpn/buffer.h
M src/openvpn/crypto_backend.h
M src/openvpn/crypto_mbedtls.c
M src/openvpn/crypto_mbedtls_legacy.c
M src/openvpn/crypto_openssl.c
M src/openvpn/env_set.c
M src/openvpn/env_set.h
M src/openvpn/manage.h
M src/openvpn/multi_io.c
M src/openvpn/multi_io.h
M src/openvpn/openvpn.c
M src/openvpn/plugin.c
M src/openvpn/plugin.h
13 files changed, 0 insertions(+), 128 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/10/1610/15
diff --git a/src/openvpn/buffer.h b/src/openvpn/buffer.h
index 651aaed..e48a793 100644
--- a/src/openvpn/buffer.h
+++ b/src/openvpn/buffer.h
@@ -1851,17 +1851,6 @@
void x_gc_freespecial(struct gc_arena *a);
/**
- * Return true iff the arena contains at least one allocation.
- *
- * @param a The arena to test.
- */
-static inline bool
-gc_defined(struct gc_arena *a)
-{
- return a->list != NULL;
-}
-
-/**
* Initialise a garbage collection arena to an empty state.
*
* @param a The arena to initialise.
diff --git a/src/openvpn/crypto_backend.h b/src/openvpn/crypto_backend.h
index 17085d6..b7f820d 100644
--- a/src/openvpn/crypto_backend.h
+++ b/src/openvpn/crypto_backend.h
@@ -569,15 +569,6 @@
void md_ctx_cleanup(md_ctx_t *ctx);
/*
- * Returns the size of the message digest output by the given context
- *
- * @param ctx Message digest context.
- *
- * @return Size of the message digest, or \0 if ctx is NULL.
- */
-int md_ctx_size(const md_ctx_t *ctx);
-
-/*
* Process the given data for use in the message digest.
*
* @param ctx Message digest context. May not be NULL.
diff --git a/src/openvpn/crypto_mbedtls.c b/src/openvpn/crypto_mbedtls.c
index 6662def..665257c0 100644
--- a/src/openvpn/crypto_mbedtls.c
+++ b/src/openvpn/crypto_mbedtls.c
@@ -718,16 +718,6 @@
ASSERT(psa_hash_abort(&ctx->operation) == PSA_SUCCESS);
}
-int
-md_ctx_size(const md_ctx_t *ctx)
-{
- if (ctx == NULL)
- {
- return 0;
- }
- return (int)PSA_HASH_LENGTH(ctx->md_info->psa_alg);
-}
-
void
md_ctx_update(md_ctx_t *ctx, const uint8_t *src, size_t src_len)
{
diff --git a/src/openvpn/crypto_mbedtls_legacy.c
b/src/openvpn/crypto_mbedtls_legacy.c
index 9e47c26..8b187bf 100644
--- a/src/openvpn/crypto_mbedtls_legacy.c
+++ b/src/openvpn/crypto_mbedtls_legacy.c
@@ -848,16 +848,6 @@
mbedtls_md_free(ctx);
}
-int
-md_ctx_size(const mbedtls_md_context_t *ctx)
-{
- if (NULL == ctx)
- {
- return 0;
- }
- return (int)mbedtls_md_get_size(mbedtls_md_info_from_ctx(ctx));
-}
-
void
md_ctx_update(mbedtls_md_context_t *ctx, const uint8_t *src, size_t src_len)
{
diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c
index 2019280..0be87e4 100644
--- a/src/openvpn/crypto_openssl.c
+++ b/src/openvpn/crypto_openssl.c
@@ -1108,12 +1108,6 @@
EVP_MD_CTX_reset(ctx);
}
-int
-md_ctx_size(const EVP_MD_CTX *ctx)
-{
- return (int)EVP_MD_CTX_size(ctx);
-}
-
void
md_ctx_update(EVP_MD_CTX *ctx, const uint8_t *src, size_t src_len)
{
diff --git a/src/openvpn/env_set.c b/src/openvpn/env_set.c
index d992097..e147913 100644
--- a/src/openvpn/env_set.c
+++ b/src/openvpn/env_set.c
@@ -209,32 +209,6 @@
}
void
-env_set_print(msglvl_t msglevel, const struct env_set *es)
-{
- if (check_debug_level(msglevel))
- {
- const struct env_item *e;
- int i;
-
- if (es)
- {
- e = es->list;
- i = 0;
-
- while (e)
- {
- if (env_safe_to_print(e->string))
- {
- msg(msglevel, "ENV [%d] '%s'", i, e->string);
- }
- ++i;
- e = e->next;
- }
- }
- }
-}
-
-void
env_set_write_file(const char *path, const struct env_set *es)
{
FILE *fp = platform_fopen(path, "w");
@@ -411,15 +385,6 @@
}
void
-setenv_int_i(struct env_set *es, const char *name, const int value, const int
i)
-{
- struct gc_arena gc = gc_new();
- const char *name_str = setenv_format_indexed_name(name, i, &gc);
- setenv_int(es, name_str, value);
- gc_free(&gc);
-}
-
-void
setenv_str_i(struct env_set *es, const char *name, const char *value, const
int i)
{
struct gc_arena gc = gc_new();
diff --git a/src/openvpn/env_set.h b/src/openvpn/env_set.h
index fcfc3ca..9b4a1e7 100644
--- a/src/openvpn/env_set.h
+++ b/src/openvpn/env_set.h
@@ -69,8 +69,6 @@
*/
void setenv_str_incr(struct env_set *es, const char *name, const char *value);
-void setenv_int_i(struct env_set *es, const char *name, const int value, const
int i);
-
void setenv_str_i(struct env_set *es, const char *name, const char *value,
const int i);
/* struct env_set functions */
@@ -85,8 +83,6 @@
const char *env_set_get(const struct env_set *es, const char *name);
-void env_set_print(msglvl_t msglevel, const struct env_set *es);
-
/**
* Write a struct env_set to a file. Each item on one line.
*
diff --git a/src/openvpn/manage.h b/src/openvpn/manage.h
index 27d3b60..1be3549 100644
--- a/src/openvpn/manage.h
+++ b/src/openvpn/manage.h
@@ -158,12 +158,6 @@
return h->size;
}
-static inline int
-log_history_capacity(const struct log_history *h)
-{
- return h->capacity;
-}
-
/*
* Callbacks for 'status' and 'kill' commands.
* Also for management-based deferred authentication and packet filter.
diff --git a/src/openvpn/multi_io.c b/src/openvpn/multi_io.c
index d8cc708..bb1fbce 100644
--- a/src/openvpn/multi_io.c
+++ b/src/openvpn/multi_io.c
@@ -661,12 +661,3 @@
} while (action != TA_UNDEF);
}
-
-void
-multi_io_delete_event(struct multi_io *multi_io, event_t event)
-{
- if (multi_io && multi_io->es)
- {
- event_del(multi_io->es, event);
- }
-}
diff --git a/src/openvpn/multi_io.h b/src/openvpn/multi_io.h
index d6734bd..38825ab 100644
--- a/src/openvpn/multi_io.h
+++ b/src/openvpn/multi_io.h
@@ -72,6 +72,4 @@
void multi_io_action(struct multi_context *m, struct multi_instance *mi, int
action, bool poll);
-void multi_io_delete_event(struct multi_io *multi_io, event_t event);
-
#endif /* ifndef MULTI_IO_H */
diff --git a/src/openvpn/openvpn.c b/src/openvpn/openvpn.c
index 7d35195..24d6bb6 100644
--- a/src/openvpn/openvpn.c
+++ b/src/openvpn/openvpn.c
@@ -32,7 +32,6 @@
#include "win32.h"
#include "options_show.h"
#include "platform.h"
-#include "string.h"
#include "memdbg.h"
diff --git a/src/openvpn/plugin.c b/src/openvpn/plugin.c
index f8adde5..29f9327 100644
--- a/src/openvpn/plugin.c
+++ b/src/openvpn/plugin.c
@@ -993,24 +993,4 @@
pr->n = 0;
}
-#ifdef ENABLE_DEBUG
-void
-plugin_return_print(const msglvl_t msglevel, const char *prefix, const struct
plugin_return *pr)
-{
- int i;
- msg(msglevel, "PLUGIN_RETURN_PRINT %s", prefix);
- for (i = 0; i < pr->n; ++i)
- {
- struct openvpn_plugin_string_list *l = pr->list[i];
- int count = 0;
-
- msg(msglevel, "PLUGIN #%d (%s)", i, prefix);
- while (l)
- {
- msg(msglevel, "[%d] '%s' -> '%s'", ++count, l->name, l->value);
- l = l->next;
- }
- }
-}
-#endif /* ifdef ENABLE_DEBUG */
#endif /* ENABLE_PLUGIN */
diff --git a/src/openvpn/plugin.h b/src/openvpn/plugin.h
index 7e9faf3..f5c0f85 100644
--- a/src/openvpn/plugin.h
+++ b/src/openvpn/plugin.h
@@ -135,11 +135,6 @@
void plugin_return_free(struct plugin_return *pr);
-#ifdef ENABLE_DEBUG
-void plugin_return_print(const msglvl_t msglevel, const char *prefix, const
struct plugin_return *pr);
-
-#endif
-
static inline int
plugin_n(const struct plugin_list *pl)
{
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1610?usp=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I82a4e82ff876fab715e052de1903c65b835360b5
Gerrit-Change-Number: 1610
Gerrit-PatchSet: 15
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-Reviewer: stipa <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: razvanc <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
Gerrit-Attention: stipa <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel