/* All the pointers in the Index'th NET_BLOCK and NET_BLOCK_OP are set to the bulk's head and tail respectively. So, this function alone can't be used by NetbufAlloc. */
VOID NetbufSetBlock(IN OUT NET_BUF *Nbuf, IN UINT8 *Bulk, IN UINT32 Len, IN UINT32 Index)
/* All the pointers in the Index'th NET_BLOCK and NET_BLOCK_OP are set to the bulk's head and tail respectively. So, this function alone can't be used by NetbufAlloc. */
VOID NetbufSetBlock(IN OUT NET_BUF *Nbuf, IN UINT8 *Bulk, IN UINT32 Len, IN UINT32 Index)
{
  NET_BLOCK_OP  *BlockOp;
  NET_BLOCK     *Block;
  NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE);
  NET_CHECK_SIGNATURE (Nbuf->Vector, NET_VECTOR_SIGNATURE);
  ASSERT (Index < Nbuf->BlockOpNum);
  Block              = &(Nbuf->Vector->Block[Index]);
  BlockOp            = &(Nbuf->BlockOp[Index]);
  Block->Len         = Len;
  Block->Bulk        = Bulk;
  BlockOp->BlockHead = Bulk;
  BlockOp->BlockTail = Bulk + Len;
  BlockOp->Head      = Bulk;
  BlockOp->Tail      = Bulk + Len;
  BlockOp->Size      = Len;
}