codekingpro/portable-devtools
114k
1# -*- coding: utf-8 -*-2# Copyright (C) 2016 Fabio Falcinelli, Maximilian Hils3#4# This program is free software: you can redistribute it and/or modify5# it under the terms of the GNU Lesser General Public License as published by6# the Free Software Foundation, either version 3 of the License, or7# (at your option) any later version.8#9# This program is distributed in the hope that it will be useful,10# but WITHOUT ANY WARRANTY; without even the implied warranty of11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12# GNU Lesser General Public License for more details.13#14# You should have received a copy of the GNU Lesser General Public License15# along with this program. If not, see <http://www.gnu.org/licenses/>.16import ctypes17 18 19class WinDivertAddress(ctypes.Structure):20 """21 Ctypes Structure for WINDIVERT_ADDRESS.22 The WINDIVERT_ADDRESS structure represents the "address" of a captured or injected packet.23 The address includes the packet's network interfaces and the packet direction.24 25 typedef struct26 {27 UINT32 IfIdx;28 UINT32 SubIfIdx;29 UINT8 Direction;30 } WINDIVERT_ADDRESS, *PWINDIVERT_ADDRESS;31 32 Fields:33 34 - IfIdx: The interface index on which the packet arrived (for inbound packets),35 or is to be sent (for outbound packets).36 - SubIfIdx: The sub-interface index for IfIdx.37 - Direction: The packet's direction. The possible values are38 - WINDIVERT_DIRECTION_OUTBOUND with value 0 for outbound packets.39 - WINDIVERT_DIRECTION_INBOUND with value 1 for inbound packets.40 """41 _fields_ = [42 ("IfIdx", ctypes.c_uint32),43 ("SubIfIdx", ctypes.c_uint32),44 ("Direction", ctypes.c_uint8),45 ]46 