⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maintbuf.h

📁 Vitual Ring Routing 管你知不知道
💻 H
字号:
// -*- 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/.
//

typedef struct MaintBuf MaintBuf;
typedef struct MaintBufPacket MaintBufPacket;
typedef struct MaintBufNode MaintBufNode;

struct MaintBufPacket {
    MaintBufPacket *Next;

    uint RefCnt;
    SRPacket *srp;
    VRRAckId AckNum;
};

struct MaintBufNode {
    MaintBufNode *Next;

    VirtualAddress Address;
    VRRIf OutIf;
    VRRIf InIf;

    //
    // Fields used for transmitting Acknowledgement Requests.
    //

    VRRAckId NextAckNum;        // Sequence number for next ack request.
    VRRAckId LastAckNum;        // Last (highest) acknowledged sequence number.
    Time LastAckRcv;            // Time that LackAckNum was received.
    Time FirstAckReq;           // Time that first ack request was sent.
    Time LastAckReq;            // Time that most recent ack request was sent.

    uint NumPackets;
    uint HighWater;

    uint NumAckReqs;            // Number of ack requests sent.
    uint NumFastReqs;           // Number of fast-path ack requests.
    uint NumValidAcks;          // Number of acks received.
    uint NumInvalidAcks;        // Number of invalid acks received.

    uint MBNCountPackets;          // Count packets submitted to MBN for tx.
    uint MBNTxSuccess;             // Total successful tx.
    uint MBNRexmits;               // Total retranmsissions.
    uint MBNTxFailed;              // Total failed tx.

    MaintBufPacket *MBP;
};

struct MaintBuf {
    KSPIN_LOCK Lock;
    MaintBufNode *MBN;
    uint NumPackets;    // Across all MaintBufNodes.
    uint HighWater;     // Across all MaintBufNodes.
};

extern MaintBuf *
MaintBufNew(void);

extern void
MaintBufFree(MiniportAdapter *VA);

extern MaintBufNode *
MaintBufFindNode(MaintBuf *MB,
                 const VirtualAddress Address,
                 VRRIf InIf, VRRIf OutIf);

extern Time
MaintBufTimer(MiniportAdapter *VA, Time Now);

extern void 
MaintBufRecvAck(MiniportAdapter *VA, const VirtualAddress Address,
                VRRIf InIf, VRRIf OutIf, VRRAckId AckNum);

extern void
MaintBufStaticSendComplete(
    MiniportAdapter *VA,
    NDIS_PACKET *Packet,
    NDIS_STATUS Status);

extern uint
MaintBufSendPacket(MiniportAdapter *VA, SRPacket *srp,
                   void (*Complete)(MiniportAdapter *VA, SRPacket *srp,
                                    NDIS_STATUS Status));

extern void
MaintBufSendAck(
    MiniportAdapter *VA,
    VirtualAddress Source,
    VirtualAddress Dest,
    VRRAckId AckId,
    VRRIf RackSourceIF,
    VRRIf RackDestIF,
    uchar NCEState);

extern void
MaintBufResetStatistics(MiniportAdapter *VA);

extern void
MaintBufTransmitComplete(
    MiniportAdapter *VA,
    NDIS_PACKET *Packet,
    NDIS_STATUS Status);

⌨️ 快捷键说明

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