Browse code

multi: make some multi_*() functions static

multi_process_float() and multi_print_status() are both invoked only
within multi.c, which is where they is defined.

For this reason we can make them static and drop their declaration
from multi.h.

Change-Id: Id5e06f0822a3e7e4ad1b6f93caaefdb6a8cfe547
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20250726135203.3452-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32356.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Antonio Quartulli authored on 2025/07/26 22:51:56
Showing 2 changed files
... ...
@@ -849,7 +849,7 @@ err:
849 849
  * If status file is defined, write to file.
850 850
  * If status file is NULL, write to syslog.
851 851
  */
852
-void
852
+static void
853 853
 multi_print_status(struct multi_context *m, struct status_output *so, const int version)
854 854
 {
855 855
     if (m->hash)
... ...
@@ -3210,7 +3210,15 @@ multi_process_post(struct multi_context *m, struct multi_instance *mi, const uns
3210 3210
     return ret;
3211 3211
 }
3212 3212
 
3213
-void
3213
+/**
3214
+ * Handles peer floating.
3215
+ *
3216
+ * If peer is floated to a taken address, either drops packet
3217
+ * (if peer that owns address has different CN) or disconnects
3218
+ * existing peer. Updates multi_instance with new address,
3219
+ * updates hashtables in multi_context.
3220
+ */
3221
+static void
3214 3222
 multi_process_float(struct multi_context *m, struct multi_instance *mi,
3215 3223
                     struct link_socket *sock)
3216 3224
 {
... ...
@@ -270,17 +270,6 @@ void multi_close_instance(struct multi_context *m, struct multi_instance *mi, bo
270 270
 
271 271
 bool multi_process_timeout(struct multi_context *m, const unsigned int mpp_flags);
272 272
 
273
-/**
274
- * Handles peer floating.
275
- *
276
- * If peer is floated to a taken address, either drops packet
277
- * (if peer that owns address has different CN) or disconnects
278
- * existing peer. Updates multi_instance with new address,
279
- * updates hashtables in multi_context.
280
- */
281
-void multi_process_float(struct multi_context *m, struct multi_instance *mi,
282
-                         struct link_socket *sock);
283
-
284 273
 #define MPP_PRE_SELECT             (1<<0)
285 274
 #define MPP_CONDITIONAL_PRE_SELECT (1<<1)
286 275
 #define MPP_CLOSE_ON_SIGNAL        (1<<2)
... ...
@@ -370,8 +359,6 @@ bool multi_process_incoming_tun(struct multi_context *m, const unsigned int mpp_
370 370
 
371 371
 void multi_process_drop_outgoing_tun(struct multi_context *m, const unsigned int mpp_flags);
372 372
 
373
-void multi_print_status(struct multi_context *m, struct status_output *so, const int version);
374
-
375 373
 struct multi_instance *multi_get_queue(struct mbuf_set *ms);
376 374
 
377 375
 void multi_add_mbuf(struct multi_context *m,