reqtable.h

来自「Vitual Ring Routing 管你知不知道」· C头文件 代码 · 共 78 行

H
78
字号
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil -*- (for GNU Emacs)
//
// (c) Microsoft Corporation. All rights reserved. 
//
// This file is part of the Microsoft Virtual Ring Routing distribution.
// You should have received a copy of the Microsoft Research Shared Source
// license agreement (MSR-SSLA) for this software; see the file "license.txt".
// If not, please see http://research.microsoft.com/vrr/license.htm,
// or write to Microsoft Research, One Microsoft Way, Redmond, WA 98052-6399.
//
// This file is derived from the Microsoft Research Mesh Connectivity Layer,
// available under the MSR-SSLA license, and downloadable from
// http://research.microsoft.com/mesh/.
//

#define NUM_DUPLICATE_SUPPRESS  64

typedef struct duplicateSuppress_t {
    VirtualAddress Target;
    VRRReqId Id;
    Time LastUsed;              // For statistics gathering.
} DuplicateSuppress;

typedef struct requestTableElement_t {
    VirtualAddress Addr;
    Time LastUsed;              // For statistics gathering.

    //
    // These fields are used when sending Route Requests for a Target.
    //
    Time LastReq;
    uint Backoff;               // How many Requests since last Reply.
    VRRReqId NextID;

    //
    // These fields are used when suppressing Route Requests from a Source.
    //
    uint Victim;
    DuplicateSuppress Suppress[NUM_DUPLICATE_SUPPRESS];
} RequestTableElement;

typedef struct forwardedRequestTable_t {
    KSPIN_LOCK Lock;
    uint Victim;
    uint MaxSize;
    uint CurSize;
    RequestTableElement *RTE;

    Time MinElementReuse;
    Time MinSuppressReuse;
} ForwardedRequestTable;

extern NDIS_STATUS
ReqTableNew(MiniportAdapter *VA, uint Size);

extern void 
ReqTableFree(MiniportAdapter *VA);

extern boolint
ReqTableSuppress(MiniportAdapter *VA,
                 const VirtualAddress Source,
                 const VirtualAddress Target,
                 VRRReqId Identifier);

extern VRRReqId
ReqTableIdentifier(MiniportAdapter *VA,
                   const VirtualAddress Target);

extern boolint
ReqTableSendP(MiniportAdapter *VA, const VirtualAddress Target,
              VRRReqId *Identifier);

extern void
ReqTableReceivedReply(MiniportAdapter *VA, const VirtualAddress Target);

extern void
ReqTableResetStatistics(MiniportAdapter *VA);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?