[Openvpn-devel] remove unused sitnl.h file

Message ID 20220314162048.22955-1-a@unstable.cc
State Accepted
Headers show
Series [Openvpn-devel] remove unused sitnl.h file | expand

Commit Message

Antonio Quartulli March 14, 2022, 5:20 a.m. UTC
sitnl.h must have slipped in when implementing the networking AI and the
SITNL backend. However it is unused and should simply be removed.

Signed-off-by: Antonio Quartulli <a@unstable.cc>
---
 src/openvpn/sitnl.h | 217 --------------------------------------------
 1 file changed, 217 deletions(-)
 delete mode 100644 src/openvpn/sitnl.h

Comments

Lev Stipakov March 14, 2022, 5:48 a.m. UTC | #1
I checked that the file is indeed not used and successfully ran GitHub
Actions with this patch.

Acked-by: Lev Stipakov <lstipakov@gmail.com>

ma 14. maalisk. 2022 klo 18.21 Antonio Quartulli (a@unstable.cc) kirjoitti:

> sitnl.h must have slipped in when implementing the networking AI and the
> SITNL backend. However it is unused and should simply be removed.
>
> Signed-off-by: Antonio Quartulli <a@unstable.cc>
> ---
>  src/openvpn/sitnl.h | 217 --------------------------------------------
>  1 file changed, 217 deletions(-)
>  delete mode 100644 src/openvpn/sitnl.h
>
> diff --git a/src/openvpn/sitnl.h b/src/openvpn/sitnl.h
> deleted file mode 100644
> index 41a6a0b8..00000000
> --- a/src/openvpn/sitnl.h
> +++ /dev/null
> @@ -1,217 +0,0 @@
> -/*
> - *  Simplified Interface To NetLink
> - *
> - *  Copyright (C) 2016-2022 Antonio Quartulli <a@unstable.cc>
> - *
> - *  This program is free software; you can redistribute it and/or modify
> - *  it under the terms of the GNU General Public License version 2
> - *  as published by the Free Software Foundation.
> - *
> - *  This program is distributed in the hope that it will be useful,
> - *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> - *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - *  GNU General Public License for more details.
> - *
> - *  You should have received a copy of the GNU General Public License
> - *  along with this program (see the file COPYING included with this
> - *  distribution); if not, write to the Free Software Foundation, Inc.,
> - *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> - */
> -
> -#ifndef SITNL_H_
> -#define SITNL_H_
> -
> -#ifdef TARGET_LINUX
> -
> -#include <stdbool.h>
> -#include <netinet/in.h>
> -
> -/**
> - * Bring interface up or down.
> - *
> - * @param iface     the interface to modify
> - * @param up        true if the interface has to be brought up, false
> otherwise
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -int sitnl_iface_up(const char *iface, bool up);
> -
> -/**
> - * Set the MTU for an interface
> - *
> - * @param iface     the interface to modify
> - * @param mtru      the new MTU
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -int sitnl_iface_mtu_set(const char *iface, uint32_t mtu);
> -
> -/**
> - * Add an IPv4 address to an interface
> - *
> - * @param iface     the interface where the address has to be added
> - * @param addr      the address to add
> - * @param prefixlen the prefix length of the network associated with the
> address
> - * @param broadcast the broadcast address to configure on the interface
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -int sitnl_addr_v4_add(const char *iface, const in_addr_t *addr, int
> prefixlen,
> -                      const in_addr_t *broadcast);
> -
> -/**
> - * Add an IPv6 address to an interface
> - *
> - * @param iface     the interface where the address has to be added
> - * @param addr      the address to add
> - * @param prefixlen the prefix length of the network associated with the
> address
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -
> -int sitnl_addr_v6_add(const char *iface, const struct in6_addr *addr,
> -                      int prefixlen);
> -
> -/**
> - * Remove an IPv4 from an interface
> - *
> - * @param iface     the interface to remove the address from
> - * @param prefixlen the prefix length of the network associated with the
> address
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -int sitnl_addr_v4_del(const char *iface, const in_addr_t *addr, int
> prefixlen);
> -
> -/**
> - * Remove an IPv6 from an interface
> - *
> - * @param iface     the interface to remove the address from
> - * @param prefixlen the prefix length of the network associated with the
> address
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -int sitnl_addr_v6_del(const char *iface, const struct in6_addr *addr,
> -                      int prefixlen);
> -
> -/**
> - * Add a point-to-point IPv4 address to an interface
> - *
> - * @param iface     the interface where the address has to be added
> - * @param local     the address to add
> - * @param remote    the associated p-t-p remote address
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -int sitnl_addr_ptp_v4_add(const char *iface, const in_addr_t *local,
> -                          const in_addr_t *remote);
> -
> -/**
> - * Remove a point-to-point IPv4 address from an interface
> - *
> - * @param iface     the interface to remove the address from
> - * @param local     the address to remove
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -int sitnl_addr_ptp_v4_del(const char *iface, const in_addr_t *local);
> -
> -
> -/**
> - * Add a route for an IPv4 address/network
> - *
> - * @param dst       the destination of the route
> - * @param prefixlen the length of the prefix of the destination
> - * @param gw        the gateway for this route
> - * @param iface     the interface for this route (can be NULL)
> - * @param table     the table to add this route to (if 0, will be added
> to the
> - *                  main table)
> - * @param metric    the metric associated with the route
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -int sitnl_route_v4_add(const in_addr_t *dst, int prefixlen,
> -                       const in_addr_t *gw, const char *iface, uint32_t
> table,
> -                       int metric);
> -
> -/**
> - * Add a route for an IPv6 address/network
> - *
> - * @param dst       the destination of the route
> - * @param prefixlen the length of the prefix of the destination
> - * @param gw        the gateway for this route
> - * @param iface     the interface for this route (can be NULL)
> - * @param table     the table to add this route to (if 0, will be added
> to the
> - *                  main table)
> - * @param metric    the metric associated with the route
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -int sitnl_route_v6_add(const struct in6_addr *dst, int prefixlen,
> -                       const struct in6_addr *gw, const char *iface,
> -                       uint32_t table, int metric);
> -
> -/**
> - * Delete a route for an IPv4 address/network
> - *
> - * @param dst       the destination of the route
> - * @param prefixlen the length of the prefix of the destination
> - * @param gw        the gateway for this route
> - * @param iface     the interface for this route (can be NULL)
> - * @param table     the table to add this route to (if 0, will be added
> to the
> - *                  main table)
> - * @param metric    the metric associated with the route
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -int sitnl_route_v4_del(const in_addr_t *dst, int prefixlen,
> -                       const in_addr_t *gw, const char *iface, uint32_t
> table,
> -                       int metric);
> -
> -/**
> - * Delete a route for an IPv4 address/network
> - *
> - * @param dst       the destination of the route
> - * @param prefixlen the length of the prefix of the destination
> - * @param gw        the gateway for this route
> - * @param iface     the interface for this route (can be NULL)
> - * @param table     the table to add this route to (if 0, will be added
> to the
> - *                  main table)
> - * @param metric    the metric associated with the route
> - *
> - * @return          0 on success, a negative error code otherwise
> - */
> -int sitnl_route_v6_del(const struct in6_addr *dst, int prefixlen,
> -                       const struct in6_addr *gw, const char *iface,
> -                       uint32_t table, int metric);
> -
> -/**
> - * Retrieve the gateway and outgoing interface for the specified IPv4
> - * address/network
> - *
> - * @param dst           The destination to lookup
> - * @param prefixlen     The length of the prefix of the destination
> - * @param best_gw       Location where the retrieved GW has to be stored
> - * @param best_iface    Location where the retrieved interface has to be
> stored
> - *
> - * @return              0 on success, a negative error code otherwise
> - */
> -int sitnl_route_v4_best_gw(const in_addr_t *dst, int prefixlen,
> -                           in_addr_t *best_gw, char *best_iface);
> -
> -/**
> - * Retrieve the gateway and outgoing interface for the specified IPv6
> - * address/network
> - *
> - * @param dst           The destination to lookup
> - * @param prefixlen     The length of the prefix of the destination
> - * @param best_gw       Location where the retrieved GW has to be stored
> - * @param best_iface    Location where the retrieved interface has to be
> stored
> - *
> - * @return              0 on success, a negative error code otherwise
> - */
> -int sitnl_route_v6_best_gw(const struct in6_addr *dst, int prefixlen,
> -                           struct in6_addr *best_gw, char *best_iface);
> -
> -#endif /* TARGET_LINUX */
> -
> -#endif /* SITNL_H_ */
> --
> 2.34.1
>
>
>
> _______________________________________________
> Openvpn-devel mailing list
> Openvpn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
>
Frank Lichtenheld March 14, 2022, 5:54 a.m. UTC | #2
> Antonio Quartulli <a@unstable.cc> hat am 14.03.2022 17:20 geschrieben:
> 
>  
> sitnl.h must have slipped in when implementing the networking AI and the
> SITNL backend. However it is unused and should simply be removed.

We have an AI? ;)
(I assume this should read API?)

Regards,
--
Frank Lichtenheld
Antonio Quartulli March 14, 2022, 6:22 a.m. UTC | #3
Hi,

On 14/03/2022 17:54, Frank Lichtenheld wrote:
> 
> 
>> Antonio Quartulli <a@unstable.cc> hat am 14.03.2022 17:20 geschrieben:
>>
>>   
>> sitnl.h must have slipped in when implementing the networking AI and the
>> SITNL backend. However it is unused and should simply be removed.
> 
> We have an AI? ;)
> (I assume this should read API?)

Yes, indeed, it should be API.

Regards,
Gert Doering March 14, 2022, 6:25 a.m. UTC | #4
Hi,

On Mon, Mar 14, 2022 at 05:54:46PM +0100, Frank Lichtenheld wrote:
> > Antonio Quartulli <a@unstable.cc> hat am 14.03.2022 17:20 geschrieben:
> > sitnl.h must have slipped in when implementing the networking AI and the
> > SITNL backend. However it is unused and should simply be removed.
> 
> We have an AI? ;)
> (I assume this should read API?)

OpenVPN Code is full of industrial light and magic.

Might as well call the config parser an AI :-)

gert
Gert Doering March 14, 2022, 8:06 a.m. UTC | #5
Lev beat me to ACKing it :-) (I'm fairly sure I did notice sitnl.h and 
remark on this before, during the sitnl review, but it still slipped
through... sneaky AI!).

Did a "make distcheck" for good measure.  Disappearing files tend to
upset packaging - but it seems this was just there, not referenced from
anything, ever...

Your patch has been applied to the master and release/2.5 branch.

commit c697febbc2f445981a6042bb8deb9ed49beb5b73 (master)
commit 69138960d391565994200b24f36215cf3f143fd7 (release/2.5)
Author: Antonio Quartulli
Date:   Mon Mar 14 17:20:48 2022 +0100

     remove unused sitnl.h file

     Signed-off-by: Antonio Quartulli <a@unstable.cc>
     Acked-by: Lev Stipakov <lstipakov@gmail.com>
     Message-Id: <20220314162048.22955-1-a@unstable.cc>
     URL: https://www.mail-archive.com/search?l=mid&q=20220314162048.22955-1-a@unstable.cc
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/sitnl.h b/src/openvpn/sitnl.h
deleted file mode 100644
index 41a6a0b8..00000000
--- a/src/openvpn/sitnl.h
+++ /dev/null
@@ -1,217 +0,0 @@ 
-/*
- *  Simplified Interface To NetLink
- *
- *  Copyright (C) 2016-2022 Antonio Quartulli <a@unstable.cc>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2
- *  as published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program (see the file COPYING included with this
- *  distribution); if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef SITNL_H_
-#define SITNL_H_
-
-#ifdef TARGET_LINUX
-
-#include <stdbool.h>
-#include <netinet/in.h>
-
-/**
- * Bring interface up or down.
- *
- * @param iface     the interface to modify
- * @param up        true if the interface has to be brought up, false otherwise
- *
- * @return          0 on success, a negative error code otherwise
- */
-int sitnl_iface_up(const char *iface, bool up);
-
-/**
- * Set the MTU for an interface
- *
- * @param iface     the interface to modify
- * @param mtru      the new MTU
- *
- * @return          0 on success, a negative error code otherwise
- */
-int sitnl_iface_mtu_set(const char *iface, uint32_t mtu);
-
-/**
- * Add an IPv4 address to an interface
- *
- * @param iface     the interface where the address has to be added
- * @param addr      the address to add
- * @param prefixlen the prefix length of the network associated with the address
- * @param broadcast the broadcast address to configure on the interface
- *
- * @return          0 on success, a negative error code otherwise
- */
-int sitnl_addr_v4_add(const char *iface, const in_addr_t *addr, int prefixlen,
-                      const in_addr_t *broadcast);
-
-/**
- * Add an IPv6 address to an interface
- *
- * @param iface     the interface where the address has to be added
- * @param addr      the address to add
- * @param prefixlen the prefix length of the network associated with the address
- *
- * @return          0 on success, a negative error code otherwise
- */
-
-int sitnl_addr_v6_add(const char *iface, const struct in6_addr *addr,
-                      int prefixlen);
-
-/**
- * Remove an IPv4 from an interface
- *
- * @param iface     the interface to remove the address from
- * @param prefixlen the prefix length of the network associated with the address
- *
- * @return          0 on success, a negative error code otherwise
- */
-int sitnl_addr_v4_del(const char *iface, const in_addr_t *addr, int prefixlen);
-
-/**
- * Remove an IPv6 from an interface
- *
- * @param iface     the interface to remove the address from
- * @param prefixlen the prefix length of the network associated with the address
- *
- * @return          0 on success, a negative error code otherwise
- */
-int sitnl_addr_v6_del(const char *iface, const struct in6_addr *addr,
-                      int prefixlen);
-
-/**
- * Add a point-to-point IPv4 address to an interface
- *
- * @param iface     the interface where the address has to be added
- * @param local     the address to add
- * @param remote    the associated p-t-p remote address
- *
- * @return          0 on success, a negative error code otherwise
- */
-int sitnl_addr_ptp_v4_add(const char *iface, const in_addr_t *local,
-                          const in_addr_t *remote);
-
-/**
- * Remove a point-to-point IPv4 address from an interface
- *
- * @param iface     the interface to remove the address from
- * @param local     the address to remove
- *
- * @return          0 on success, a negative error code otherwise
- */
-int sitnl_addr_ptp_v4_del(const char *iface, const in_addr_t *local);
-
-
-/**
- * Add a route for an IPv4 address/network
- *
- * @param dst       the destination of the route
- * @param prefixlen the length of the prefix of the destination
- * @param gw        the gateway for this route
- * @param iface     the interface for this route (can be NULL)
- * @param table     the table to add this route to (if 0, will be added to the
- *                  main table)
- * @param metric    the metric associated with the route
- *
- * @return          0 on success, a negative error code otherwise
- */
-int sitnl_route_v4_add(const in_addr_t *dst, int prefixlen,
-                       const in_addr_t *gw, const char *iface, uint32_t table,
-                       int metric);
-
-/**
- * Add a route for an IPv6 address/network
- *
- * @param dst       the destination of the route
- * @param prefixlen the length of the prefix of the destination
- * @param gw        the gateway for this route
- * @param iface     the interface for this route (can be NULL)
- * @param table     the table to add this route to (if 0, will be added to the
- *                  main table)
- * @param metric    the metric associated with the route
- *
- * @return          0 on success, a negative error code otherwise
- */
-int sitnl_route_v6_add(const struct in6_addr *dst, int prefixlen,
-                       const struct in6_addr *gw, const char *iface,
-                       uint32_t table, int metric);
-
-/**
- * Delete a route for an IPv4 address/network
- *
- * @param dst       the destination of the route
- * @param prefixlen the length of the prefix of the destination
- * @param gw        the gateway for this route
- * @param iface     the interface for this route (can be NULL)
- * @param table     the table to add this route to (if 0, will be added to the
- *                  main table)
- * @param metric    the metric associated with the route
- *
- * @return          0 on success, a negative error code otherwise
- */
-int sitnl_route_v4_del(const in_addr_t *dst, int prefixlen,
-                       const in_addr_t *gw, const char *iface, uint32_t table,
-                       int metric);
-
-/**
- * Delete a route for an IPv4 address/network
- *
- * @param dst       the destination of the route
- * @param prefixlen the length of the prefix of the destination
- * @param gw        the gateway for this route
- * @param iface     the interface for this route (can be NULL)
- * @param table     the table to add this route to (if 0, will be added to the
- *                  main table)
- * @param metric    the metric associated with the route
- *
- * @return          0 on success, a negative error code otherwise
- */
-int sitnl_route_v6_del(const struct in6_addr *dst, int prefixlen,
-                       const struct in6_addr *gw, const char *iface,
-                       uint32_t table, int metric);
-
-/**
- * Retrieve the gateway and outgoing interface for the specified IPv4
- * address/network
- *
- * @param dst           The destination to lookup
- * @param prefixlen     The length of the prefix of the destination
- * @param best_gw       Location where the retrieved GW has to be stored
- * @param best_iface    Location where the retrieved interface has to be stored
- *
- * @return              0 on success, a negative error code otherwise
- */
-int sitnl_route_v4_best_gw(const in_addr_t *dst, int prefixlen,
-                           in_addr_t *best_gw, char *best_iface);
-
-/**
- * Retrieve the gateway and outgoing interface for the specified IPv6
- * address/network
- *
- * @param dst           The destination to lookup
- * @param prefixlen     The length of the prefix of the destination
- * @param best_gw       Location where the retrieved GW has to be stored
- * @param best_iface    Location where the retrieved interface has to be stored
- *
- * @return              0 on success, a negative error code otherwise
- */
-int sitnl_route_v6_best_gw(const struct in6_addr *dst, int prefixlen,
-                           struct in6_addr *best_gw, char *best_iface);
-
-#endif /* TARGET_LINUX */
-
-#endif /* SITNL_H_ */