@@ -33,7 +33,12 @@ struct context;
/* define mock types to ensure code builds on any platform */
typedef void *openvpn_net_ctx_t;
typedef void *openvpn_net_iface_t;
+#endif /* ifdef ENABLE_SITNL */
+/* Only the iproute2 backend implements these functions,
+ * the rest can rely on these stubs
+ */
+#if !defined(ENABLE_IPROUTE)
static inline int
net_ctx_init(struct context *c, openvpn_net_ctx_t *ctx)
{
@@ -51,7 +56,7 @@ net_ctx_free(openvpn_net_ctx_t *ctx)
{
(void)ctx;
}
-#endif /* ifdef ENABLE_SITNL */
+#endif /* !defined(ENABLE_IPROUTE) */
#if defined(ENABLE_SITNL) || defined(ENABLE_IPROUTE)
@@ -595,28 +595,6 @@ net_route_v6_best_gw(openvpn_net_ctx_t *ctx, const struct in6_addr *dst,
}
#ifdef ENABLE_SITNL
-
-int
-net_ctx_init(struct context *c, openvpn_net_ctx_t *ctx)
-{
- (void)c;
- (void)ctx;
-
- return 0;
-}
-
-void
-net_ctx_reset(openvpn_net_ctx_t *ctx)
-{
- (void)ctx;
-}
-
-void
-net_ctx_free(openvpn_net_ctx_t *ctx)
-{
- (void)ctx;
-}
-
int
net_route_v4_best_gw(openvpn_net_ctx_t *ctx, const in_addr_t *dst,
in_addr_t *best_gw, char *best_iface)