/* This can be used to, for example, retrieve the IP header in the packet. It also can be used to get the fragment that contains the byte which is used mainly by the library implementation itself. */
UINT8* EFIAPI NetbufGetByte(IN NET_BUF *Nbuf, IN UINT32 Offset, OUT UINT32 *Index OPTIONAL)
/* This can be used to, for example, retrieve the IP header in the packet. It also can be used to get the fragment that contains the byte which is used mainly by the library implementation itself. */
UINT8* EFIAPI NetbufGetByte(IN NET_BUF *Nbuf, IN UINT32 Offset, OUT UINT32 *Index OPTIONAL)
{
  NET_BLOCK_OP  *BlockOp;
  UINT32        Loop;
  UINT32        Len;
  NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE);
  if (Offset >= Nbuf->TotalSize) {
    return NULL;
  }
  BlockOp = Nbuf->BlockOp;
  Len     = 0;
  for (Loop = 0; Loop < Nbuf->BlockOpNum; Loop++) {
    if (Len + BlockOp[Loop].Size <= Offset) {
      Len += BlockOp[Loop].Size;
      continue;
    }
    if (Index != NULL) {
      *Index = Loop;
    }
    return BlockOp[Loop].Head + (Offset - Len);
  }
  return NULL;
}