Skip to content

Commit

Permalink
Add TAP_IOCTL constants for DHCPv6
Browse files Browse the repository at this point in the history
  • Loading branch information
juhovh committed Nov 25, 2010
1 parent 8cc1c8a commit 8bc9cb5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common.h
Expand Up @@ -54,6 +54,11 @@
/* obsoletes TAP_IOCTL_CONFIG_POINT_TO_POINT */
#define TAP_IOCTL_CONFIG_TUN TAP_CONTROL_CODE (10, METHOD_BUFFERED)

// Added in 9.8

#define TAP_IOCTL_CONFIG_DHCPV6_MASQ TAP_CONTROL_CODE (11, METHOD_BUFFERED)
#define TAP_IOCTL_CONFIG_DHCPV6_SET_OPT TAP_CONTROL_CODE (12, METHOD_BUFFERED)

//=================
// Registry keys
//=================
Expand Down
31 changes: 31 additions & 0 deletions tapdrvr.c
Expand Up @@ -2092,6 +2092,37 @@ TapDeviceHook (IN PDEVICE_OBJECT p_DeviceObject, IN PIRP p_IRP)
break;
}

case TAP_IOCTL_CONFIG_DHCPV6_MASQ:
{
break;
}

case TAP_IOCTL_CONFIG_DHCPV6_SET_OPT:
{
if (l_IrpSp->Parameters.DeviceIoControl.InputBufferLength <=
DHCPV6_USER_SUPPLIED_OPTIONS_BUFFER_SIZE
&& l_Adapter->m_dhcpv6_enabled)
{
l_Adapter->m_dhcpv6_user_supplied_options_buffer_len = 0;

NdisMoveMemory (l_Adapter->m_dhcpv6_user_supplied_options_buffer,
p_IRP->AssociatedIrp.SystemBuffer,
l_IrpSp->Parameters.DeviceIoControl.InputBufferLength);

l_Adapter->m_dhcpv6_user_supplied_options_buffer_len =
l_IrpSp->Parameters.DeviceIoControl.InputBufferLength;

p_IRP->IoStatus.Information = 1; // Simple boolean value
}
else
{
NOTE_ERROR ();
p_IRP->IoStatus.Status = l_Status = STATUS_INVALID_PARAMETER;
}

break;
}

default:
{
NOTE_ERROR ();
Expand Down

0 comments on commit 8bc9cb5

Please sign in to comment.