/* Generate an IPv6 router alert option in network order and output it through Buffer. */
EFI_STATUS Ip6FillHopByHop(OUT UINT8 *Buffer, IN OUT UINTN *BufferLen, IN UINT8 NextHeader)
/* Generate an IPv6 router alert option in network order and output it through Buffer. */
EFI_STATUS Ip6FillHopByHop(OUT UINT8 *Buffer, IN OUT UINTN *BufferLen, IN UINT8 NextHeader)
{
  UINT8  BufferArray[8];
  if (*BufferLen < 8) {
    *BufferLen = 8;
    return EFI_BUFFER_TOO_SMALL;
  }
  ZeroMem (BufferArray, sizeof (BufferArray));
  BufferArray[0] = NextHeader;
  BufferArray[2] = 0x5;
  BufferArray[3] = 0x2;
  BufferArray[6] = 1;
  CopyMem (Buffer, BufferArray, sizeof (BufferArray));
  return EFI_SUCCESS;
}