Пример #1
0
NTSTATUS TCPStartup(VOID)
/*
 * FUNCTION: Initializes the TCP subsystem
 * RETURNS:
 *     Status of operation
 */
{
    NTSTATUS Status;

    Status = PortsStartup( &TCPPorts, 1, 0xfffe );
    if (!NT_SUCCESS(Status))
    {
        return Status;
    }

    ExInitializeNPagedLookasideList(&TdiBucketLookasideList,
                                    NULL,
                                    NULL,
                                    0,
                                    sizeof(TDI_BUCKET),
                                    TDI_BUCKET_TAG,
                                    0);
    
    /* Initialize our IP library */
    LibIPInitialize();
    
    /* Register this protocol with IP layer */
    IPRegisterProtocol(IPPROTO_TCP, TCPReceive);
    
    TCPInitialized = TRUE;

    return STATUS_SUCCESS;
}
Пример #2
0
NTSTATUS TCPShutdown(VOID)
/*
 * FUNCTION: Shuts down the TCP subsystem
 * RETURNS:
 *     Status of operation
 */
{
    if (!TCPInitialized)
        return STATUS_SUCCESS;

    ExDeleteNPagedLookasideList(&TdiBucketLookasideList);
    
    LibIPShutdown();

    /* Deregister this protocol with IP layer */
    IPRegisterProtocol(IPPROTO_TCP, NULL);

    TCPInitialized = FALSE;

    PortsShutdown( &TCPPorts );

    return STATUS_SUCCESS;
}
Пример #3
0
NTSTATUS ICMPShutdown()
{
    IPRegisterProtocol(IPPROTO_ICMP, NULL);

    return STATUS_SUCCESS;
}
Пример #4
0
NTSTATUS ICMPStartup()
{
    IPRegisterProtocol(IPPROTO_ICMP, ICMPReceive);

    return STATUS_SUCCESS;
}