Change in openvpn[master]: Remove various unused functions
A message that is not in the archive (sent off-list or not yet received): gerrit.1775343746000.I82a4e82ff876fab715e052de1903c65b835360b5@...2715...
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1610?usp=email
to review the following change.
Change subject: Remove various unused functions
......................................................................
Remove various unused functions
---
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/dco_win.h
M src/openvpn/env_set.c
M src/openvpn/env_set.h
M src/openvpn/event.h
M src/openvpn/interval.h
M src/openvpn/manage.h
M src/openvpn/mroute.h
M src/openvpn/multi_io.c
M src/openvpn/openvpn.c
M src/openvpn/plugin.c
M src/openvpn/plugin.h
M src/openvpn/route.c
M src/openvpn/route.h
18 files changed, 0 insertions(+), 271 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/10/1610/1
src/openvpn/buffer.h +0 -28
@@ -805,28 +805,6 @@return ntohs (ret); } -static inline uint32_t -buf_read_u32 (struct buffer *buf,bool *good) -{ -uint32_t ret; -if (!buf_read (buf, &ret,sizeof (uint32_t ))) - { -if (good) - { - *good = false; - } -return 0 ; - } -else - { -if (good) - { - *good = true; - } -return ntohl (ret); - } -} -/** Return true if buffer contents are equal */ static inline bool buf_equal (const struct buffer *a,const struct buffer *b)
@@ -1018,12 +996,6 @@void x_gc_freespecial (struct gc_arena *a); -static inline bool -gc_defined (struct gc_arena *a) -{ -return a->list !=NULL ; -} -static inline void gc_init (struct gc_arena *a) {
src/openvpn/crypto_backend.h +0 -9
@@ -591,15 +591,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.
src/openvpn/crypto_mbedtls.c +0 -10
@@ -740,16 +740,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) {
src/openvpn/crypto_mbedtls_legacy.c +0 -10
@@ -863,16 +863,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) {
src/openvpn/crypto_openssl.c +0 -6
@@ -1152,12 +1152,6 @@EVP_MD_CTX_reset (ctx); } -int -md_ctx_size (const EVP_MD_CTX *ctx) -{ -return EVP_MD_CTX_size (ctx); -} -void md_ctx_update (EVP_MD_CTX *ctx,const uint8_t *src,size_t src_len) {
src/openvpn/dco_win.h +0 -10
@@ -65,8 +65,6 @@void dco_p2p_new_peer (HANDLE handle,OVERLAPPED *ov,struct link_socket *sock,struct signal_info *sig_info); -void dco_start_tun (struct tuntap *tt); -bool dco_win_supports_multipeer (void ); void dco_win_add_iroute_ipv4(dco_context_t *dco, in_addr_t dst, unsigned int netbits,
@@ -79,13 +77,5 @@void dco_win_del_iroute_ipv6 (dco_context_t *dco,struct in6_addr dst,unsigned int netbits); -#else /* if defined(ENABLE_DCO) && defined(_WIN32) */ - -static inline void -dco_start_tun (struct tuntap *tt) -{ -ASSERT (false); -} -#endif /* defined(_WIN32) */ #endif /* ifndef DCO_H */
src/openvpn/env_set.c +0 -35
@@ -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 ();
src/openvpn/env_set.h +0 -4
@@ -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. *
src/openvpn/event.h +0 -7
@@ -190,13 +190,6 @@return ret; } -static inline void -event_set_return_init (struct event_set_return *esr) -{ - esr->rwflags =0 ; - esr->arg =NULL ; -} -#ifdef _WIN32 static inline void
src/openvpn/interval.h +0 -43
47 lines not on this page · raw message
src/openvpn/manage.h +0 -6
@@ -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.
src/openvpn/mroute.h +0 -20
@@ -249,24 +249,4 @@ dest->v4.addr = htonl(src); } -static inline in_addr_t -in_addr_t_from_mroute_addr (const struct mroute_addr *addr) -{ -if ((addr->type &MR_ADDR_MASK ) ==MR_ADDR_IPV4 && addr->netbits ==0 && addr->len ==4 ) - { -return ntohl (addr->v4.addr); - } -else - { -return 0 ; - } -} - -static inline void -mroute_addr_reset (struct mroute_addr *ma) -{ - ma->len =0 ; - ma->type =MR_ADDR_NONE ; -} -#endif /* MROUTE_H */
src/openvpn/multi_io.c +0 -9
@@ -617,12 +617,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); - } -}
src/openvpn/openvpn.c +0 -1
@@ -31,7 +31,6 @@#include "multi.h" #include "win32.h" #include "platform.h" -#include "string.h" #include "memdbg.h"
src/openvpn/plugin.c +0 -20
@@ -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 */
src/openvpn/plugin.h +0 -4
@@ -135,10 +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)
src/openvpn/route.c +0 -34
@@ -185,19 +185,6 @@ dest->gc = a; } -static const char * -route_string (const struct route_ipv4 *r,struct gc_arena *gc) -{ -struct buffer out =alloc_buf_gc (256 , gc); -buf_printf (&out,"ROUTE network %s netmask %s gateway %s" ,print_in_addr_t (r->network,0 , gc), -print_in_addr_t (r->netmask,0 , gc),print_in_addr_t (r->gateway,0 , gc)); -if (r->flags &RT_METRIC_DEFINED ) - { -buf_printf (&out," metric %d" , r->metric); - } -return BSTR (&out); -} -static bool is_route_parm_defined (const char *parm) {
@@ -1325,27 +1312,6 @@#endif /* ifndef ENABLE_SMALL */ static void -print_route (const struct route_ipv4 *r,msglvl_t msglevel) -{ -struct gc_arena gc =gc_new (); -if (r->flags &RT_DEFINED ) - { -msg (msglevel,"%s" ,route_string (r, &gc)); - } -gc_free (&gc); -} - -void -print_routes (const struct route_list *rl,msglvl_t msglevel) -{ -struct route_ipv4 *r; -for (r = rl->routes; r; r = r->next) - { -print_route (r, msglevel); - } -} - -static void setenv_route (struct env_set *es,const struct route_ipv4 *r,int i) {struct gc_arena gc =gc_new ();
src/openvpn/route.h +0 -15
@@ -377,8 +377,6 @@#endif -void print_routes (const struct route_list *rl,msglvl_t msglevel); -#ifdef _WIN32void show_routes (msglvl_t msglevel);
@@ -409,19 +407,6 @@return mask; } -static inline bool -route_list_vpn_gateway_needed (const struct route_list *rl) -{ -if (!rl) - { -return false; - } -else - { -return !(rl->spec.flags &RTSA_REMOTE_ENDPOINT ); - } -} -static inline int route_did_redirect_default_gateway (const struct route_list *rl) {
--
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: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I82a4e82ff876fab715e052de1903c65b835360b5
Gerrit-Change-Number: 1610
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>