Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code changes to with Aruba VIA client #150

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions COPYRIGHT.GPL
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,5 @@ proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

Copyright 2022 Hewlett Packard Enterprise Development LP
8 changes: 8 additions & 0 deletions src/adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* 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
*
* Copyright 2022 Hewlett Packard Enterprise Development LP
*/
#ifndef __TAP_ADAPTER_CONTEXT_H_
#define __TAP_ADAPTER_CONTEXT_H_
Expand Down Expand Up @@ -273,6 +275,12 @@ typedef struct _TAP_ADAPTER_CONTEXT
BOOLEAN m_CalledAdapterFreeResources;
BOOLEAN m_RegisteredAdapterShutdownHandler;


#ifdef ARUBA_SPECIFIC
// Handle Aruba specific logic
BOOLEAN m_IsLoadedByAruba;
#endif

} TAP_ADAPTER_CONTEXT, *PTAP_ADAPTER_CONTEXT;

FORCEINLINE
Expand Down
8 changes: 7 additions & 1 deletion src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* 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
*
* Copyright 2022 Hewlett Packard Enterprise Development LP
*/

//
Expand Down Expand Up @@ -703,7 +705,11 @@ Return Value:
Irp->IoStatus.Status = ntStatus = STATUS_INVALID_PARAMETER;
}
break;

#ifdef ARUBA_SPECIFIC
case TAP_WIN_IOCTL_CONFIG_LOADER_FLAG:
adapter->m_IsLoadedByAruba = TRUE;
break;
#endif
default:

//
Expand Down
6 changes: 3 additions & 3 deletions src/resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
VFT2_DRV_COMM
*/

#define VER_COMPANYNAME_STR "The OpenVPN Project"
#define VER_FILEDESCRIPTION_STR "TAP-Windows Virtual Network Driver (NDIS 6.0)"
#define VER_COMPANYNAME_STR "Hewlett Packard Enterprise"
#define VER_FILEDESCRIPTION_STR "Aruba Networks Virtual Adapter"
#define VER_ORIGINALFILENAME_STR PRODUCT_TAP_WIN_COMPONENT_ID ".sys"
#define VER_LEGALCOPYRIGHT_YEARS "2003-2018"
#define VER_LEGALCOPYRIGHT_STR "OpenVPN Technologies, Inc."
#define VER_LEGALCOPYRIGHT_STR "Copyright 2022 Hewlett Packard Enterprise Development LP."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the original Copyright is probably not even legal for a GPL program.



#define VER_PRODUCTNAME_STR VER_FILEDESCRIPTION_STR
Expand Down
7 changes: 6 additions & 1 deletion src/tap-windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* 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
*
* Copyright 2022 Hewlett Packard Enterprise Development LP
*/
#ifndef __TAP_WIN_H
#define __TAP_WIN_H
Expand Down Expand Up @@ -53,6 +55,9 @@

/* Control whether 802.1Q headers are added for priority */
#define TAP_WIN_IOCTL_PRIORITY_BEHAVIOR TAP_WIN_CONTROL_CODE (11, METHOD_BUFFERED)
#ifdef ARUBA_SPECIFIC
#define TAP_WIN_IOCTL_CONFIG_LOADER_FLAG TAP_WIN_CONTROL_CODE (12, METHOD_BUFFERED)
#endif
#define TAP_PRIORITY_BEHAVIOR_NOPRIORITY 0
#define TAP_PRIORITY_BEHAVIOR_ENABLED 1
#define TAP_PRIORITY_BEHAVIOR_ADDALWAYS 2
Expand All @@ -77,6 +82,6 @@
#define USERMODEDEVICEDIR "\\\\.\\Global\\"
#define SYSDEVICEDIR "\\Device\\"
#define USERDEVICEDIR "\\DosDevices\\Global\\"
#define TAP_WIN_SUFFIX ".tap"
#define TAP_WIN_SUFFIX ".avnic"

#endif // __TAP_WIN_H
21 changes: 21 additions & 0 deletions src/txpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* 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
*
* Copyright 2022 Hewlett Packard Enterprise Development LP
*/

//
Expand Down Expand Up @@ -221,6 +223,21 @@ ProcessARP(
__in const MACADDR mac
)
{

#ifdef ARUBA_SPECIFIC
BOOLEAN bIsDestinationSame = FALSE;

if (TRUE == Adapter->m_IsLoadedByAruba)
{
bIsDestinationSame = TRUE;
}
else
{
bIsDestinationSame = (src->m_ARP_IP_Destination & ip_netmask) == ip_network ? TRUE : FALSE;
}
#endif //ARUBA_SPECIFIC
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic might be useful but it needs better naming and better explaination.



//-----------------------------------------------
// Is this the kind of packet we are looking for?
//-----------------------------------------------
Expand All @@ -234,7 +251,11 @@ ProcessARP(
&& src->m_PROTO_AddressType == htons (NDIS_ETH_TYPE_IPV4)
&& src->m_PROTO_AddressSize == sizeof (IPADDR)
&& src->m_ARP_IP_Source == adapter_ip
#ifndef ARUBA_SPECIFIC
&& (src->m_ARP_IP_Destination & ip_netmask) == ip_network
#else
&& bIsDestinationSame
#endif
&& src->m_ARP_IP_Destination != adapter_ip)
{
ARP_PACKET *arp = (ARP_PACKET *) MemAlloc (sizeof (ARP_PACKET), TRUE);
Expand Down