[TCPIP] Remove duplicate declarations from ticonsts.h

This commit is contained in:
Victor Perevertkin 2019-12-21 04:02:47 +03:00 committed by Victor Perevertkin
parent d5ad2057d7
commit 167fa2c26a
2 changed files with 10 additions and 27 deletions

View file

@ -32,31 +32,7 @@
#define TCPIP_PROTOCOL_NAME L"Tcpip"
#endif /* _NTTEST_ */
/* TCP/UDP/RawIP IOCTL code definitions */
#define FSCTL_TCP_BASE FILE_DEVICE_NETWORK
#define _TCP_CTL_CODE(Function, Method, Access) \
CTL_CODE(FSCTL_TCP_BASE, Function, Method, Access)
#define IOCTL_TCP_QUERY_INFORMATION_EX \
_TCP_CTL_CODE(0, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_TCP_SET_INFORMATION_EX \
_TCP_CTL_CODE(1, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_SET_IP_ADDRESS \
_TCP_CTL_CODE(14, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_DELETE_IP_ADDRESS \
_TCP_CTL_CODE(16, METHOD_BUFFERED, FILE_WRITE_ACCESS)
/* Unique error values for log entries */
#define TI_ERROR_DRIVERENTRY 0
/* Internal status codes */
#define IP_SUCCESS 0x0000 /* Successful */
#define IP_NO_RESOURCES 0x0001 /* Not enough free resources */
#define IP_NO_ROUTE_TO_DESTINATION 0x0002 /* No route to destination */
/* EOF */

View file

@ -36,7 +36,7 @@ VOID LoopTransmit(
* NdisPacket = Pointer to NDIS packet to send
* Offset = Offset in packet where packet data starts
* LinkAddress = Pointer to link address
* Type = LAN protocol type (unused)
* Type = LAN protocol type
*/
{
PCHAR PacketBuffer;
@ -49,6 +49,13 @@ VOID LoopTransmit(
ASSERT_KM_POINTER(PC(NdisPacket));
ASSERT_KM_POINTER(PC(NdisPacket)->DLComplete);
if (Type != LAN_PROTO_IPv4)
{
TI_DbgPrint(MAX_TRACE, ("Received unsupported protocol %u\n", Type));
PC(NdisPacket)->DLComplete(PC(NdisPacket)->Context, NdisPacket, NDIS_STATUS_NOT_SUPPORTED);
return;
}
TI_DbgPrint(MAX_TRACE, ("Called (NdisPacket = %x)\n", NdisPacket));
GetDataPtr( NdisPacket, 0, &PacketBuffer, &PacketLength );
@ -112,7 +119,7 @@ NDIS_STATUS LoopRegisterAdapter(
Loopback = IPCreateInterface(&BindInfo);
if (!Loopback) return NDIS_STATUS_RESOURCES;
Loopback->MTU = 16384;
Loopback->Name.Buffer = L"Loopback";
@ -124,7 +131,7 @@ NDIS_STATUS LoopRegisterAdapter(
AddrInitIPv4(&Loopback->Broadcast, LOOPBACK_BCASTADDR_IPv4);
IPRegisterInterface(Loopback);
IPAddInterfaceRoute(Loopback);
TI_DbgPrint(MAX_TRACE, ("Leaving.\n"));