/* Filter the received packet using the source port. */
BOOLEAN PxeBcFilterBySrcPort(IN EFI_PXE_BASE_CODE_MODE *Mode, IN VOID *Session, IN OUT UINT16 *SrcPort, IN UINT16 OpFlags)
/* Filter the received packet using the source port. */
BOOLEAN PxeBcFilterBySrcPort(IN EFI_PXE_BASE_CODE_MODE *Mode, IN VOID *Session, IN OUT UINT16 *SrcPort, IN UINT16 OpFlags)
{
  UINT16  Port;
  if (Mode->UsingIpv6) {
    Port = ((EFI_UDP6_SESSION_DATA *)Session)->SourcePort;
  } else {
    Port = ((EFI_UDP4_SESSION_DATA *)Session)->SourcePort;
  }
  if ((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT) != 0) {
    if (SrcPort != NULL) {
      *SrcPort = Port;
    }
    return TRUE;
  } else if ((SrcPort != NULL) && (*SrcPort == Port)) {
    return TRUE;
  }
  return FALSE;
}