VirtualBox

Ignore:
Timestamp:
Oct 29, 2015 4:30:44 AM (9 years ago)
Author:
vboxsync
Message:

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
96 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware

  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Application/IfConfig6/IfConfig6.h

    r48674 r58466  
    4141
    4242#define MACADDRMAXSIZE    32
    43 #define PREFIXMAXLEN      16 
     43#define PREFIXMAXLEN      16
    4444
    4545typedef struct _IFCONFIG6_INTERFACE_CB {
     
    4747  LIST_ENTRY                                  Link;
    4848  EFI_IP6_CONFIG_PROTOCOL                     *IfCfg;
    49   EFI_IP6_CONFIG_INTERFACE_INFO               *IfInfo; 
     49  EFI_IP6_CONFIG_INTERFACE_INFO               *IfInfo;
    5050  EFI_IP6_CONFIG_INTERFACE_ID                 *IfId;
    5151  EFI_IP6_CONFIG_POLICY                       Policy;
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Application/IfConfig6/IfConfig6.inf

    r58459 r58466  
    4040  MdeModulePkg/MdeModulePkg.dec
    4141  ShellPkg/ShellPkg.dec
    42  
     42
    4343[LibraryClasses]
    4444  BaseLib
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Application/IfConfig6/IfConfig6Strings.uni

    • Property svn:mime-type changed from application/octet-stream to text/plain;encoding=UTF-16LE
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Application/IpsecConfig/IpSecConfig.inf

    r58459 r58466  
    11## @file
    22#  Shell application IpSecConfig.
    3 # 
     3#
    44#  This application is used to set and retrieve security and policy related information
    55#  for the EFI IPsec protocol driver.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Application/IpsecConfig/IpSecConfigStrings.uni

    • Property svn:mime-type changed from application/octet-stream to text/plain;encoding=UTF-16LE
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Application/IpsecConfig/Match.h

    r48674 r58466  
    11/** @file
    2   The internal structure and function declaration of 
     2  The internal structure and function declaration of
    33  match policy entry function in IpSecConfig application.
    44
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Application/Ping6/Ping6.c

    r58459 r58466  
    260260  }
    261261
    262   if (!IP6_IS_MULTICAST (&Private->DstAddress) && 
     262  if (!IP6_IS_MULTICAST (&Private->DstAddress) &&
    263263      !EFI_IP6_EQUAL (&RxData->Header->SourceAddress, &Private->DstAddress)) {
    264264    goto ON_EXIT;
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Application/Ping6/Ping6Strings.uni

    • Property svn:mime-type changed from application/octet-stream to text/plain;encoding=UTF-16LE
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Application/VConfig/VConfigStrings.uni

    • Property svn:mime-type changed from application/octet-stream to text/plain;encoding=UTF-16LE
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Dhcp6Dxe/ComponentName.c

    r58459 r58466  
    248248  @param  Dhcp6[in]                   A pointer to the EFI_DHCP6_PROTOCOL.
    249249
    250  
     250
    251251  @retval EFI_SUCCESS                 Update the ControllerNameTable of this instance successfully.
    252252  @retval EFI_INVALID_PARAMETER       The input parameter is invalid.
    253  
     253
    254254**/
    255255EFI_STATUS
     
    273273    return Status;
    274274  }
    275  
     275
    276276  if (gDhcp6ControllerNameTable != NULL) {
    277277    FreeUnicodeStringTable (gDhcp6ControllerNameTable);
    278278    gDhcp6ControllerNameTable = NULL;
    279279  }
    280  
     280
    281281  if (Dhcp6ModeData.Ia == NULL) {
    282282    HandleName = L"DHCPv6 (No configured IA)";
     
    287287    HandleName = mDhcp6ControllerName[Dhcp6ModeData.Ia->State];
    288288  }
    289  
     289
    290290  Status = AddUnicodeString2 (
    291291             "eng",
     
    298298    return Status;
    299299  }
    300  
     300
    301301  return AddUnicodeString2 (
    302302           "en",
     
    395395    return EFI_UNSUPPORTED;
    396396  }
    397  
    398   // 
    399   // Make sure this driver produced ChildHandle 
    400   // 
     397
     398  //
     399  // Make sure this driver produced ChildHandle
     400  //
    401401  Status = EfiTestChildHandle (
    402402             ControllerHandle,
    403              ChildHandle, 
     403             ChildHandle,
    404404             &gEfiUdp6ProtocolGuid
    405405             );
     
    414414                  ChildHandle,
    415415                  &gEfiDhcp6ProtocolGuid,
    416                   (VOID **)&Dhcp6, 
     416                  (VOID **)&Dhcp6,
    417417                  NULL,
    418418                  NULL,
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Dhcp6Dxe/Dhcp6Driver.c

    r58459 r58466  
    329329/**
    330330  Callback function which provided by user to remove one node in NetDestroyLinkList process.
    331  
     331
    332332  @param[in]    Entry           The entry to be removed.
    333333  @param[in]    Context         Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
     
    353353  Instance = NET_LIST_USER_STRUCT_S (Entry, DHCP6_INSTANCE, Link, DHCP6_INSTANCE_SIGNATURE);
    354354  ServiceBinding = (EFI_SERVICE_BINDING_PROTOCOL *) Context;
    355  
     355
    356356  return ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);
    357357}
     
    559559    //
    560560    // Destroy all the children instances before destory the service.
    561     // 
     561    //
    562562    List = &Service->Child;
    563563    Status = NetDestroyLinkList (
     
    592592    Status = EFI_SUCCESS;
    593593  }
    594  
     594
    595595ON_EXIT:
    596596  return Status;
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf

    r58459 r58466  
    11## @file
    22#  Client-side DHCPv6 services.
    3 # 
     3#
    44#  This driver produces EFI DHCPv6 Protocol which is used to get IPv6 addresses
    55#  and other configuration parameters from DHCPv6 servers.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c

    r58459 r58466  
    226226    Status = Instance->UdpSts;
    227227  }
    228  
     228
    229229ON_EXIT:
    230230  //
     
    667667    }
    668668
    669     do { 
     669    do {
    670670      TimerStatus = gBS->CheckEvent (Timer);
    671671      if (!EFI_ERROR (TimerStatus)) {
     
    683683      }
    684684    } while (TimerStatus == EFI_NOT_READY);
    685    
     685
    686686    gBS->CloseEvent (Timer);
    687687  }
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.h

    r58459 r58466  
    252252  //
    253253  // StartTime is used to calculate the 'elapsed-time' option. Refer to RFC3315,
    254   // the elapsed-time is amount of time since the client began its current DHCP transaction. 
     254  // the elapsed-time is amount of time since the client began its current DHCP transaction.
    255255  //
    256256  UINT64                        StartTime;
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Dhcp6Dxe/Dhcp6Io.c

    r58459 r58466  
    372372  @retval   TRUE      The control block is in Instance's retry list.
    373373  @retval   FALSE     The control block is NOT in Instance's retry list.
    374  
     374
    375375**/
    376376BOOLEAN
     
    17691769    goto ON_ERROR;
    17701770  }
    1771  
     1771
    17721772  gBS->RestoreTPL (OldTpl);
    17731773  return EFI_SUCCESS;
    1774  
     1774
    17751775ON_ERROR:
    1776   gBS->RestoreTPL (OldTpl); 
     1776  gBS->RestoreTPL (OldTpl);
    17771777  RemoveEntryList (&InfCb->Link);
    17781778  FreePool (InfCb);
     
    18981898  Packet->Length += (UINT32) (Cursor - Packet->Dhcp6.Option);
    18991899  ASSERT (Packet->Size > Packet->Length + 8);
    1900  
     1900
    19011901  //
    19021902  // Clear initial time for current transaction.
     
    22342234    } else if (Status == EFI_NOT_FOUND) {
    22352235      //
    2236       // Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message, 
     2236      // Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message,
    22372237      // the client sends a Renew or Rebind if the IA is not in the Reply message.
    22382238      // Return EFI_SUCCESS so we can continue to restart the Renew/Rebind process.
     
    22402240      return EFI_SUCCESS;
    22412241    }
    2242    
     2242
    22432243    goto ON_EXIT;
    2244    
     2244
    22452245  } else if (Option != NULL) {
    22462246    //
     
    22912291      if (Instance->IaCb.Ia->State == Dhcp6Renewing || Instance->IaCb.Ia->State == Dhcp6Rebinding) {
    22922292        //
    2293         // Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message, the client 
     2293        // Refer to RFC3315 Chapter 18.1.8, for each IA in the original Renew or Rebind message, the client
    22942294        // sends a Request message if the IA contained a Status Code option with the NoBinding status.
    22952295        //
     
    23102310
    23112311  return EFI_SUCCESS;
    2312  
     2312
    23132313ON_EXIT:
    23142314
     
    23202320               );
    23212321  }
    2322  
     2322
    23232323  return Status;
    23242324}
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c

    r58459 r58466  
    6868    //
    6969    //  The format of DUID-UUID:
    70     //   
     70    //
    7171    //    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    7272    //   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     
    9191    //
    9292    Duid->Length = (UINT16) (18);
    93  
     93
    9494    //
    9595    // Set the Duid-type and copy UUID.
    9696    //
    9797    WriteUnaligned16 ((UINT16 *) (Duid->Duid), HTONS (Dhcp6DuidTypeUuid));
    98  
     98
    9999    CopyMem (Duid->Duid + 2, &Uuid, sizeof(EFI_GUID));
    100100
    101101  } else {
    102      
     102
    103103    //
    104104    //
     
    135135      return NULL;
    136136    }
    137  
     137
    138138    //
    139139    // sizeof (Duid-type + hardware-type + time) = 8 bytes
    140140    //
    141141    Duid->Length = (UINT16) (Mode->HwAddressSize + 8);
    142  
     142
    143143    //
    144144    // Set the Duid-type, hardware-type, time and copy the hardware address.
     
    687687  //      .                                                               .
    688688  //      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    689  
     689
    690690  //
    691691  // Fill the value of Ia Address option type
     
    10001000
    10011001/**
    1002   Check whether the incoming IPv6 address in IaAddr is one of the maintained 
     1002  Check whether the incoming IPv6 address in IaAddr is one of the maintained
    10031003  addresses in the IA control blcok.
    10041004
     
    10191019
    10201020  ASSERT (IaAddr != NULL && CurrentIa != NULL);
    1021  
     1021
    10221022  for (Index = 0; Index < CurrentIa->IaAddressCount; Index++) {
    10231023    if (EFI_IP6_EQUAL(&IaAddr->IpAddress, &CurrentIa->IaAddress[Index].IpAddress)) {
     
    13031303  IN  EFI_IP6_CONFIG_PROTOCOL       *Ip6Cfg,
    13041304  OUT UINTN                         *TimeOut
    1305   ) 
     1305  )
    13061306{
    13071307  EFI_STATUS            Status;
     
    13231323    return Status;
    13241324  }
    1325  
     1325
    13261326  *TimeOut = TICKS_PER_SECOND * DadXmits.DupAddrDetectTransmits + DHCP6_DAD_ADDITIONAL_DELAY;
    1327  
     1327
    13281328  return EFI_SUCCESS;
    13291329}
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/ComponentName.c

    r58459 r58466  
    107107  @param[in]  IScsiExtScsiPassThru  A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
    108108  @param[in]  Ipv6Flag              TRUE if IP6 network stack is used.
    109  
     109
    110110  @retval EFI_SUCCESS               Update the ControllerNameTable of this instance successfully.
    111111  @retval EFI_INVALID_PARAMETER     The input parameter is invalid.
    112112  @retval EFI_UNSUPPORTED           Can't get the corresponding NIC info from the Controller handle.
    113  
     113
    114114**/
    115115EFI_STATUS
     
    127127    return EFI_INVALID_PARAMETER;
    128128  }
    129  
     129
    130130  Private  = ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU (IScsiExtScsiPassThru);
    131131  NicIndex = Private->Session->ConfigData->NicIndex;
    132    
     132
    133133  UnicodeSPrint (
    134134    HandleName,
     
    243243{
    244244  EFI_STATUS                      Status;
    245  
     245
    246246  EFI_HANDLE                      IScsiController;
    247247  BOOLEAN                         Ipv6Flag;
    248248  EFI_GUID                        *IScsiPrivateGuid;
    249249  ISCSI_PRIVATE_PROTOCOL          *IScsiIdentifier;
    250  
     250
    251251  EFI_EXT_SCSI_PASS_THRU_PROTOCOL *IScsiExtScsiPassThru;
    252  
     252
    253253  if (ControllerHandle == NULL) {
    254254    return EFI_UNSUPPORTED;
     
    310310      }
    311311    }
    312    
     312
    313313    //
    314314    // Retrieve an instance of a produced protocol from ChildHandle
     
    325325      return Status;
    326326    }
    327    
     327
    328328    //
    329329    // Update the component name for this child handle.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiCHAP.c

    r48674 r58466  
    1717/**
    1818  Initator caculates its own expected hash value.
    19  
     19
    2020  @param[in]   ChapIdentifier     iSCSI CHAP identifier sent by authenticator.
    2121  @param[in]   ChapSecret         iSCSI CHAP secret of the authenticator.
     
    2424  @param[in]   ChallengeLength    The length of iSCSI CHAP challenge message.
    2525  @param[out]  ChapResponse       The calculation of the expected hash value.
    26  
     26
    2727  @retval EFI_SUCCESS             The expected hash value was caculatedly successfully.
    2828  @retval EFI_PROTOCOL_ERROR      The length of the secret should be at least the
     
    9696/**
    9797  The initator checks the CHAP response replied by target against its own
    98   calculation of the expected hash value. 
    99  
    100   @param[in]   AuthData             iSCSI CHAP authentication data. 
    101   @param[in]   TargetResponse       The response from target.   
     98  calculation of the expected hash value.
     99
     100  @param[in]   AuthData             iSCSI CHAP authentication data.
     101  @param[in]   TargetResponse       The response from target.
    102102
    103103  @retval EFI_SUCCESS               The response from target passed authentication.
     
    268268    // Process the CHAP identifier and CHAP Challenge from Target.
    269269    // Calculate Response value.
    270     //   
     270    //
    271271    Result = IScsiNetNtoi (Identifier);
    272272    if (Result > 0xFF) {
    273273      goto ON_EXIT;
    274     }   
    275    
     274    }
     275
    276276    AuthData->InIdentifier      = (UINT32) Result;
    277277    AuthData->InChallengeLength = ISCSI_CHAP_AUTH_MAX_LEN;
     
    332332  if (KeyValueList != NULL) {
    333333    IScsiFreeKeyValueList (KeyValueList);
    334   } 
     334  }
    335335
    336336  FreePool (Data);
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiCHAP.h

    r48674 r58466  
    3030/// MD5_HASHSIZE
    3131///
    32 #define ISCSI_CHAP_RSP_LEN        16 
     32#define ISCSI_CHAP_RSP_LEN        16
    3333
    3434#define ISCSI_CHAP_STEP_ONE       1
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiConfig.c

    r58459 r58466  
    3535    END_DEVICE_PATH_TYPE,
    3636    END_ENTIRE_DEVICE_PATH_SUBTYPE,
    37     { 
     37    {
    3838      (UINT8) (END_DEVICE_PATH_LENGTH),
    3939      (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
     
    494494        NULL
    495495        );
    496      
     496
    497497      return EFI_INVALID_PARAMETER;
    498498    }
     
    515515            NULL
    516516            );
    517          
     517
    518518          return EFI_INVALID_PARAMETER;
    519519        } else if (!IP4_NET_EQUAL (HostIp.Addr[0], Gateway.Addr[0], SubnetMask.Addr[0])) {
     
    524524            NULL
    525525            );
    526          
     526
    527527          return EFI_INVALID_PARAMETER;
    528528        }
     
    554554          NULL
    555555          );
    556        
     556
    557557        return EFI_INVALID_PARAMETER;
    558558      }
     
    566566          L"Reverse CHAP Name or Reverse CHAP Secret is invalid!",
    567567          NULL
    568           );       
     568          );
    569569        return EFI_INVALID_PARAMETER;
    570570      }
     
    585585        FreePool (AttemptName1);
    586586        return EFI_OUT_OF_RESOURCES;
    587       }     
    588      
     587      }
     588
    589589      AsciiStrToUnicodeStr (Attempt->AttemptName, AttemptName1);
    590590      if (StrLen (AttemptName1) > ATTEMPT_NAME_SIZE) {
     
    610610        mPrivate->PortString,
    611611        NULL
    612         );       
     612        );
    613613
    614614      FreePool (AttemptName1);
     
    747747    // IScsiConfigProcessDefault. If input Attempt does not match any existing
    748748    // attempt, it should be a new created attempt. Save it to system now.
    749     //   
     749    //
    750750    ASSERT (Attempt == mPrivate->NewAttempt);
    751751
     
    841841
    842842/**
    843   Create Hii Extend Label OpCode as the start opcode and end opcode. It is 
     843  Create Hii Extend Label OpCode as the start opcode and end opcode. It is
    844844  a help function.
    845845
     
    852852  @retval EFI_OUT_OF_RESOURCES   Do not have sufficient resource to finish this
    853853                                 operation.
    854   @retval EFI_INVALID_PARAMETER  Any input parameter is invalid.                                 
     854  @retval EFI_INVALID_PARAMETER  Any input parameter is invalid.
    855855  @retval EFI_SUCCESS            The operation is completed successfully.
    856856
     
    902902    goto Exit;
    903903  }
    904  
     904
    905905  InternalStartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
    906906  InternalStartLabel->Number       = StartLabelNumber;
     
    936936    HiiFreeOpCodeHandle (*EndOpCodeHandle);
    937937  }
    938  
     938
    939939  return Status;
    940940}
     
    10101010    if (PortTitleHelpToken == 0) {
    10111011      Status = EFI_INVALID_PARAMETER;
    1012       goto Exit;     
     1012      goto Exit;
    10131013    }
    10141014
     
    10341034  HiiFreeOpCodeHandle (StartOpCodeHandle);
    10351035  HiiFreeOpCodeHandle (EndOpCodeHandle);
    1036  
     1036
    10371037  return Status;
    10381038}
     
    10991099    StartOpCodeHandle,               // Label for where to insert opcodes
    11001100    EndOpCodeHandle                  // Replace data
    1101   );   
     1101  );
    11021102
    11031103  HiiFreeOpCodeHandle (StartOpCodeHandle);
     
    12681268    FreePool (AttemptNewOrder);
    12691269  }
    1270  
     1270
    12711271  return Status;
    12721272}
     
    13541354             StartOpCodeHandle,               // Label for where to insert opcodes
    13551355             EndOpCodeHandle                  // Replace data
    1356              );   
     1356             );
    13571357
    13581358  HiiFreeOpCodeHandle (StartOpCodeHandle);
     
    13851385  VOID                        *EndOpCodeHandle;
    13861386  EFI_IFR_GUID_LABEL          *EndLabel;
    1387   VOID                        *OptionsOpCodeHandle; 
    1388  
     1387  VOID                        *OptionsOpCodeHandle;
     1388
    13891389  Status = IScsiCreateOpCode (
    13901390             ORDER_ENTRY_LABEL,
     
    14381438    CONFIGURATION_VARSTORE_ID,                  // VarStore ID
    14391439    DYNAMIC_ORDERED_LIST_VAR_OFFSET,            // Offset in Buffer Storage
    1440     STRING_TOKEN (STR_ORDER_ATTEMPT_ENTRY),     // Question prompt text       
    1441     STRING_TOKEN (STR_ORDER_ATTEMPT_ENTRY),     // Question help text       
     1440    STRING_TOKEN (STR_ORDER_ATTEMPT_ENTRY),     // Question prompt text
     1441    STRING_TOKEN (STR_ORDER_ATTEMPT_ENTRY),     // Question help text
    14421442    0,                                          // Question flag
    14431443    EFI_IFR_UNIQUE_SET,                         // Ordered list flag, e.g. EFI_IFR_UNIQUE_SET
    14441444    EFI_IFR_NUMERIC_SIZE_1,                     // Data type of Question value
    14451445    ISCSI_MAX_ATTEMPTS_NUM,                     // Maximum container
    1446     OptionsOpCodeHandle,                        // Option Opcode list                       
    1447     NULL                                        // Default Opcode is NULL                               
     1446    OptionsOpCodeHandle,                        // Option Opcode list
     1447    NULL                                        // Default Opcode is NULL
    14481448    );
    14491449
     
    14551455             StartOpCodeHandle,               // Label for where to insert opcodes
    14561456             EndOpCodeHandle                  // Replace data
    1457              );             
     1457             );
    14581458
    14591459Error:
    14601460  HiiFreeOpCodeHandle (StartOpCodeHandle);
    1461   HiiFreeOpCodeHandle (EndOpCodeHandle); 
     1461  HiiFreeOpCodeHandle (EndOpCodeHandle);
    14621462  if (OptionsOpCodeHandle != NULL) {
    14631463    HiiFreeOpCodeHandle (OptionsOpCodeHandle);
     
    16301630    return EFI_SUCCESS;
    16311631  }
    1632  
     1632
    16331633  //
    16341634  // Free any attempt that is previously created but not saved to system.
     
    16481648      return EFI_NOT_FOUND;
    16491649    }
    1650    
     1650
    16511651    //
    16521652    // Create new attempt.
     
    17211721    //
    17221722    CopyMem (AttemptConfigData->SessionConfigData.IsId, &NicInfo->PermanentAddress, 6);
    1723     AttemptConfigData->SessionConfigData.IsId[0] = 
     1723    AttemptConfigData->SessionConfigData.IsId[0] =
    17241724      (UINT8) (AttemptConfigData->SessionConfigData.IsId[0] & 0x3F);
    17251725
     
    17891789    ZeroMem (IfrNvData->ReverseCHAPSecret, sizeof (IfrNvData->ReverseCHAPSecret));
    17901790  }
    1791  
     1791
    17921792  IScsiConvertAttemptConfigDataToIfrNvData (AttemptConfigData, IfrNvData);
    17931793
     
    18021802
    18031803/**
    1804    
     1804
    18051805  This function allows the caller to request the current
    18061806  configuration for one or more named elements. The resulting
     
    18311831                         failing name / value pair (or the beginning
    18321832                         of the string if the failure is in the first
    1833                          name / value pair) if the request was not successful.                       
     1833                         name / value pair) if the request was not successful.
    18341834
    18351835  @param[out] Results    A null-terminated Unicode string in
     
    18521852                                  error. In this case, the
    18531853                                  Progress parameter would be
    1854                                   set to NULL. 
     1854                                  set to NULL.
    18551855
    18561856  @retval EFI_NOT_FOUND           Routing data doesn't match any
     
    19101910    return EFI_OUT_OF_RESOURCES;
    19111911  }
    1912  
     1912
    19131913  if (Private->Current != NULL) {
    19141914    IScsiConvertAttemptConfigDataToIfrNvData (Private->Current, IfrNvData);
     
    19211921    return EFI_OUT_OF_RESOURCES;
    19221922  }
    1923    
     1923
    19241924  Status = gIScsiInitiatorName.Get (&gIScsiInitiatorName, &BufferSize, InitiatorName);
    19251925  if (EFI_ERROR (Status)) {
     
    19811981
    19821982/**
    1983    
     1983
    19841984  This function applies changes in a driver's configuration.
    19851985  Input is a Configuration, which has the routing data for this
     
    19941994
    19951995  @param[in]  Configuration  A null-terminated Unicode string in
    1996                              <ConfigString> format. 
    1997  
     1996                             <ConfigString> format.
     1997
    19981998  @param[out] Progress       A pointer to a string filled in with the
    19991999                             offset of the most recent '&' before the
     
    20062006  @retval EFI_SUCCESS             The results have been distributed or are
    20072007                                  awaiting distribution.
    2008  
     2008
    20092009  @retval EFI_OUT_OF_RESOURCES    Not enough memory to store the
    20102010                                  parts of the results that must be
    20112011                                  stored awaiting possible future
    20122012                                  protocols.
    2013  
     2013
    20142014  @retval EFI_INVALID_PARAMETERS  Passing in a NULL for the
    20152015                                  Results parameter would result
    20162016                                  in this type of error.
    2017  
     2017
    20182018  @retval EFI_NOT_FOUND           Target for the specified routing data
    20192019                                  was not found.
     
    20472047
    20482048/**
    2049    
     2049
    20502050  This function is called to provide results data to the driver.
    20512051  This data consists of a unique key that is used to identify
     
    20562056  @param[in]       QuestionId    A unique value which is sent to the original
    20572057                                 exporting driver so that it can identify the type
    2058                                  of data to expect. The format of the data tends to 
     2058                                 of data to expect. The format of the data tends to
    20592059                                 vary based on the opcode that generated the callback.
    20602060  @param[in]       Type          The type of value for the question.
     
    21162116
    21172117  Private = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);
    2118  
     2118
    21192119  //
    21202120  // Retrieve uncommitted data from Browser
    21212121  //
    2122  
     2122
    21232123  BufferSize = sizeof (ISCSI_CONFIG_IFR_NVDATA);
    21242124  IfrNvData = AllocateZeroPool (BufferSize);
     
    21262126    return EFI_OUT_OF_RESOURCES;
    21272127  }
    2128  
     2128
    21292129  IScsiName = (CHAR8 *) AllocateZeroPool (ISCSI_NAME_MAX_SIZE);
    21302130  if (IScsiName == NULL) {
     
    21322132    return EFI_OUT_OF_RESOURCES;
    21332133  }
    2134  
     2134
    21352135  Status = EFI_SUCCESS;
    2136  
     2136
    21372137  ZeroMem (&OldIfrNvData, BufferSize);
    2138  
     2138
    21392139  HiiGetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData);
    2140  
     2140
    21412141  CopyMem (&OldIfrNvData, IfrNvData, BufferSize);
    21422142
     
    21672167      IScsiConfigDisplayOrderAttempts ();
    21682168      break;
    2169    
     2169
    21702170    default:
    21712171      Status = IScsiConfigProcessDefault (QuestionId, IfrNvData);
    21722172      break;
    21732173    }
    2174   } else if (Action == EFI_BROWSER_ACTION_CHANGED) { 
     2174  } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
    21752175    switch (QuestionId) {
    21762176    case KEY_INITIATOR_NAME:
     
    21852185          L"Invalid iSCSI Name!",
    21862186          NULL
    2187           );     
     2187          );
    21882188      }
    21892189
     
    22082208      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
    22092209      break;
    2210      
     2210
    22112211    case KEY_SAVE_ATTEMPT_CONFIG:
    22122212      Status = IScsiConvertIfrNvDataToAttemptConfigData (IfrNvData, Private->Current);
     
    22882288          L"Invalid IP address!",
    22892289          NULL
    2290           ); 
    2291        
     2290          );
     2291
    22922292        Status = EFI_INVALID_PARAMETER;
    22932293      } else {
     
    23052305          L"Invalid Subnet Mask!",
    23062306          NULL
    2307           ); 
    2308        
     2307          );
     2308
    23092309        Status = EFI_INVALID_PARAMETER;
    23102310      } else {
     
    23222322          L"Invalid Gateway!",
    23232323          NULL
    2324           );       
     2324          );
    23252325        Status = EFI_INVALID_PARAMETER;
    23262326      } else {
     
    23392339          L"Invalid IP address!",
    23402340          NULL
    2341           );       
     2341          );
    23422342        Status = EFI_INVALID_PARAMETER;
    23432343      } else {
     
    23562356          L"Invalid iSCSI Name!",
    23572357          NULL
    2358           );       
     2358          );
    23592359      } else {
    23602360        AsciiStrCpy (Private->Current->SessionConfigData.TargetName, IScsiName);
     
    23792379          L"Invalid LUN string!",
    23802380          NULL
    2381           );       
     2381          );
    23822382      } else {
    23832383        CopyMem (Private->Current->SessionConfigData.BootLun, &Lun, sizeof (Lun));
     
    24922492                  );
    24932493  ASSERT_EFI_ERROR (Status);
    2494  
     2494
    24952495  //
    24962496  // Publish our HII data.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiConfigStrings.uni

    • Property svn:mime-type changed from application/octet-stream to text/plain;encoding=UTF-16LE
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiConfigVfr.vfr

    • Property svn:eol-style set to native
    r58459 r58466  
    11/** @file
    22  VFR file used by the iSCSI configuration component.
    3  
     3
    44Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
     
    116116      flags  = INTERACTIVE,
    117117      key    = KEY_IGNORE_DELETE_ATTEMPT;
    118   endform;   
     118  endform;
    119119
    120120  form formid = FORMID_ATTEMPT_FORM,
     
    160160            maximum = CONNECT_MAX_RETRY,
    161161            step    = 0,
    162     endnumeric; 
    163    
     162    endnumeric;
     163
    164164    numeric varid   = ISCSI_CONFIG_IFR_NVDATA.ConnectTimeout,
    165165            prompt  = STRING_TOKEN(STR_ISCSI_CONFIG_TIMEOUT),
     
    174174    subtitle text = STRING_TOKEN(STR_NULL);
    175175
    176     string  varid   = ISCSI_CONFIG_IFR_NVDATA.IsId, 
     176    string  varid   = ISCSI_CONFIG_IFR_NVDATA.IsId,
    177177            prompt  = STRING_TOKEN(STR_ISCSI_CONFIG_ISID),
    178178            help    = STRING_TOKEN(STR_ISCSI_CONFIG_ISID_HELP),
     
    195195
    196196    suppressif ideqval ISCSI_CONFIG_IFR_NVDATA.InitiatorInfoFromDhcp == 0x01 OR
    197                ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_IP6 OR 
     197               ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_IP6 OR
    198198               ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_AUTOCONFIG;
    199199    string  varid   = ISCSI_CONFIG_IFR_NVDATA.LocalIp,
     
    223223            maxsize = IP4_MAX_SIZE,
    224224    endstring;
    225    
     225
    226226    endif;
    227227
    228228    suppressif ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_AUTOCONFIG;
    229229    subtitle text = STRING_TOKEN(STR_NULL);
    230     endif;     
     230    endif;
    231231
    232232    suppressif ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_AUTOCONFIG OR
     
    277277            maxsize = LUN_MAX_SIZE,
    278278    endstring;
    279    
     279
    280280    endif;
    281281
    282282    suppressif ideqval ISCSI_CONFIG_IFR_NVDATA.IpMode == IP_MODE_AUTOCONFIG;
    283283    subtitle text = STRING_TOKEN(STR_NULL);
    284     endif; 
     284    endif;
    285285
    286286    oneof varid  = ISCSI_CONFIG_IFR_NVDATA.AuthenticationType,
    287           questionid = KEY_AUTH_TYPE,     
     287          questionid = KEY_AUTH_TYPE,
    288288          prompt = STRING_TOKEN(STR_AUTHEN_TYPE_PROMPT),
    289289          help   = STRING_TOKEN(STR_AUTHEN_TYPE_HELP),
     
    292292    endoneof;
    293293
    294     suppressif NOT ideqval ISCSI_CONFIG_IFR_NVDATA.AuthenticationType == ISCSI_AUTH_TYPE_CHAP;   
     294    suppressif NOT ideqval ISCSI_CONFIG_IFR_NVDATA.AuthenticationType == ISCSI_AUTH_TYPE_CHAP;
    295295    oneof varid  = ISCSI_CONFIG_IFR_NVDATA.CHAPType,
    296296          prompt = STRING_TOKEN(STR_CHAP_TYPE_PROMPT),
     
    352352      flags  = INTERACTIVE,
    353353      key    = KEY_SAVE_ATTEMPT_CONFIG;
    354      
     354
    355355    goto FORMID_MAIN_FORM,
    356356    prompt = STRING_TOKEN (STR_RETURN_MAIN_FORM),
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiDhcp.c

    r48674 r58466  
    188188  The callback function registerd to the DHCP4 instance that is used to select
    189189  the qualified DHCP OFFER.
    190  
     190
    191191  @param[in]  This         The DHCP4 protocol.
    192192  @param[in]  Context      The context set when configuring the DHCP4 protocol.
    193193  @param[in]  CurrentState The current state of the DHCP4 protocol.
    194194  @param[in]  Dhcp4Event   The event occurs in the current state.
    195   @param[in]  Packet       The DHCP packet that is to be sent or was already received. 
     195  @param[in]  Packet       The DHCP packet that is to be sent or was already received.
    196196  @param[out] NewPacket    The packet used to replace the above Packet.
    197  
     197
    198198  @retval EFI_SUCCESS      Either the DHCP OFFER is qualified or we're not intereseted
    199199                           in the Dhcp4Event.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiDhcp6.c

    r58459 r58466  
    4848  ISCSI_SESSION_CONFIG_NVDATA *ConfigNvData;
    4949  EFI_IP_ADDRESS              Ip;
    50   UINT8                       IpMode; 
     50  UINT8                       IpMode;
    5151
    5252  ConfigNvData = &ConfigData->SessionConfigData;
     
    144144  // Get the IP address of the target.
    145145  //
    146   Field   = &Fields[RP_FIELD_IDX_SERVERNAME]; 
     146  Field   = &Fields[RP_FIELD_IDX_SERVERNAME];
    147147  if (ConfigNvData->IpMode < IP_MODE_AUTOCONFIG) {
    148148    IpMode = ConfigNvData->IpMode;
     
    214214
    215215/**
    216   EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol 
     216  EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol
    217217  instance to intercept events that occurs in the DHCPv6 Information Request
    218218  exchange process.
    219219
    220   @param[in]  This              Pointer to the EFI_DHCP6_PROTOCOL instance that 
     220  @param[in]  This              Pointer to the EFI_DHCP6_PROTOCOL instance that
    221221                                is used to configure this  callback function.
    222222  @param[in]  Context           Pointer to the context that is initialized in
     
    252252  ISCSI_ATTEMPT_CONFIG_NVDATA *ConfigData;
    253253  UINT16                      ParaLen;
    254  
     254
    255255  OptionCount = 0;
    256256  BootFileOpt = NULL;
    257  
     257
    258258  Status      = This->Parse (This, Packet, &OptionCount, NULL);
    259259  if (Status != EFI_BUFFER_TOO_SMALL) {
     
    329329    goto Exit;
    330330  }
    331  
     331
    332332  //
    333333  // Get iSCSI root path from Boot File Uniform Resource Locator (URL) Option
     
    499499  if (Oro != NULL) {
    500500    FreePool (Oro);
    501   } 
     501  }
    502502
    503503  if (Timer != NULL) {
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiDriver.c

    r58459 r58466  
    3838
    3939/**
    40   Tests to see if this driver supports the RemainingDevicePath. 
    41 
    42   @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This 
    43                                    parameter is ignored by device drivers, and is optional for bus 
    44                                    drivers. For bus drivers, if this parameter is not NULL, then 
    45                                    the bus driver must determine if the bus controller specified 
    46                                    by ControllerHandle and the child controller specified 
    47                                    by RemainingDevicePath are both supported by this 
     40  Tests to see if this driver supports the RemainingDevicePath.
     41
     42  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
     43                                   parameter is ignored by device drivers, and is optional for bus
     44                                   drivers. For bus drivers, if this parameter is not NULL, then
     45                                   the bus driver must determine if the bus controller specified
     46                                   by ControllerHandle and the child controller specified
     47                                   by RemainingDevicePath are both supported by this
    4848                                   bus driver.
    4949
     
    8181
    8282  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    83   @param[in]  ControllerHandle     The handle of the controller to test. This handle 
    84                                    must support a protocol interface that supplies 
     83  @param[in]  ControllerHandle     The handle of the controller to test. This handle
     84                                   must support a protocol interface that supplies
    8585                                   an I/O abstraction to the driver.
    86   @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This 
    87                                    parameter is ignored by device drivers, and is optional for bus 
    88                                    drivers. For bus drivers, if this parameter is not NULL, then 
    89                                    the bus driver must determine if the bus controller specified 
    90                                    by ControllerHandle and the child controller specified 
    91                                    by RemainingDevicePath are both supported by this 
     86  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
     87                                   parameter is ignored by device drivers, and is optional for bus
     88                                   drivers. For bus drivers, if this parameter is not NULL, then
     89                                   the bus driver must determine if the bus controller specified
     90                                   by ControllerHandle and the child controller specified
     91                                   by RemainingDevicePath are both supported by this
    9292                                   bus driver.
    9393  @param[in]  IpVersion            IP_VERSION_4 or IP_VERSION_6.
     
    167167    }
    168168  }
    169  
     169
    170170  return EFI_SUCCESS;
    171171}
     
    185185  @retval EFI_NOT_FOUND         There is no sufficient information to establish
    186186                                the iScsi session.
    187   @retval EFI_DEVICE_ERROR      Failed to get TCP connection device path.                             
     187  @retval EFI_DEVICE_ERROR      Failed to get TCP connection device path.
    188188
    189189**/
     
    298298                  EFI_OPEN_PROTOCOL_BY_DRIVER
    299299                  );
    300                  
     300
    301301  if (EFI_ERROR (Status)) {
    302302    goto ON_ERROR;
     
    304304
    305305  //
    306   // Always install private protocol no matter what happens later. We need to 
     306  // Always install private protocol no matter what happens later. We need to
    307307  // keep the relationship between ControllerHandle and ChildHandle.
    308308  //
     
    316316    goto ON_ERROR;
    317317  }
    318  
     318
    319319  if (IpVersion == IP_VERSION_4) {
    320320    mPrivate->Ipv6Flag = FALSE;
     
    703703               IScsiPrivateGuid,
    704704               &ExistPrivate->IScsiIdentifier
    705                ); 
    706        
     705               );
     706
    707707        IScsiRemoveNic (ExistPrivate->Controller);
    708708        if (ExistPrivate->Session != NULL) {
     
    761761                  Private->ExtScsiPassThruHandle,
    762762                  EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
    763                   );             
     763                  );
    764764  if (EFI_ERROR (Status)) {
    765765    gBS->UninstallMultipleProtocolInterfaces (
     
    771771           NULL
    772772           );
    773    
     773
    774774    goto ON_ERROR;
    775775  }
     
    798798  Stops a device controller or a bus controller. This is the worker function for
    799799  IScsiIp4(6)DriverBindingStop.
    800  
     800
    801801  @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    802   @param[in]  ControllerHandle  A handle to the device being stopped. The handle must 
    803                                 support a bus specific I/O protocol for the driver 
     802  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must
     803                                support a bus specific I/O protocol for the driver
    804804                                to use to stop the device.
    805805  @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.
    806   @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL 
     806  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL
    807807                                if NumberOfChildren is 0.
    808808  @param[in]  IpVersion         IP_VERSION_4 or IP_VERSION_6.
    809  
     809
    810810  @retval EFI_SUCCESS           The device was stopped.
    811811  @retval EFI_DEVICE_ERROR      The device could not be stopped due to a device error.
     
    869869           Private->ExtScsiPassThruHandle
    870870           );
    871    
     871
    872872    gBS->CloseProtocol (
    873873           Conn->TcpIo.Handle,
     
    879879    return EFI_SUCCESS;
    880880  }
    881  
     881
    882882  //
    883883  // Get the handle of the controller we are controling.
     
    919919                    IScsiController
    920920                    );
    921                    
     921
    922922    ASSERT (!EFI_ERROR (Status));
    923923
     
    936936         ProtocolGuid,
    937937         &Private->IScsiIdentifier
    938          ); 
     938         );
    939939
    940940  //
     
    958958
    959959/**
    960   Tests to see if this driver supports a given controller. If a child device is provided, 
     960  Tests to see if this driver supports a given controller. If a child device is provided,
    961961  it tests to see if this driver supports creating a handle for the specified child device.
    962962
    963   This function checks to see if the driver specified by This supports the device specified by 
    964   ControllerHandle. Drivers typically use the device path attached to 
    965   ControllerHandle and/or the services from the bus I/O abstraction attached to 
    966   ControllerHandle to determine if the driver supports ControllerHandle. This function 
    967   may be called many times during platform initialization. In order to reduce boot times, the tests 
    968   performed by this function must be very small and take as little time as possible to execute. This 
    969   function must not change the state of any hardware devices, and this function must be aware that the 
    970   device specified by ControllerHandle may already be managed by the same driver or a 
    971   different driver. This function must match its calls to AllocatePages() with FreePages(), 
    972   AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). 
    973   Since ControllerHandle may have been previously started by the same driver, if a protocol is 
    974   already in the opened state, then it must not be closed with CloseProtocol(). This is required 
     963  This function checks to see if the driver specified by This supports the device specified by
     964  ControllerHandle. Drivers typically use the device path attached to
     965  ControllerHandle and/or the services from the bus I/O abstraction attached to
     966  ControllerHandle to determine if the driver supports ControllerHandle. This function
     967  may be called many times during platform initialization. In order to reduce boot times, the tests
     968  performed by this function must be very small and take as little time as possible to execute. This
     969  function must not change the state of any hardware devices, and this function must be aware that the
     970  device specified by ControllerHandle may already be managed by the same driver or a
     971  different driver. This function must match its calls to AllocatePages() with FreePages(),
     972  AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
     973  Since ControllerHandle may have been previously started by the same driver, if a protocol is
     974  already in the opened state, then it must not be closed with CloseProtocol(). This is required
    975975  to guarantee the state of ControllerHandle is not modified by this function.
    976976
    977977  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    978   @param[in]  ControllerHandle     The handle of the controller to test. This handle 
    979                                    must support a protocol interface that supplies 
     978  @param[in]  ControllerHandle     The handle of the controller to test. This handle
     979                                   must support a protocol interface that supplies
    980980                                   an I/O abstraction to the driver.
    981   @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This 
    982                                    parameter is ignored by device drivers, and is optional for bus 
    983                                    drivers. For bus drivers, if this parameter is not NULL, then 
    984                                    the bus driver must determine if the bus controller specified 
    985                                    by ControllerHandle and the child controller specified 
    986                                    by RemainingDevicePath are both supported by this 
     981  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
     982                                   parameter is ignored by device drivers, and is optional for bus
     983                                   drivers. For bus drivers, if this parameter is not NULL, then
     984                                   the bus driver must determine if the bus controller specified
     985                                   by ControllerHandle and the child controller specified
     986                                   by RemainingDevicePath are both supported by this
    987987                                   bus driver.
    988988
     
    10191019
    10201020  The Start() function is designed to be invoked from the EFI boot service ConnectController().
    1021   As a result, much of the error checking on the parameters to Start() has been moved into this 
    1022   common boot service. It is legal to call Start() from other locations, 
     1021  As a result, much of the error checking on the parameters to Start() has been moved into this
     1022  common boot service. It is legal to call Start() from other locations,
    10231023  but the following calling restrictions must be followed or the system behavior will not be deterministic.
    10241024  1. ControllerHandle must be a valid EFI_HANDLE.
     
    10261026     EFI_DEVICE_PATH_PROTOCOL.
    10271027  3. Prior to calling Start(), the Supported() function for the driver specified by This must
    1028      have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. 
     1028     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
    10291029
    10301030  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    1031   @param[in]  ControllerHandle     The handle of the controller to start. This handle 
    1032                                    must support a protocol interface that supplies 
     1031  @param[in]  ControllerHandle     The handle of the controller to start. This handle
     1032                                   must support a protocol interface that supplies
    10331033                                   an I/O abstraction to the driver.
    1034   @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This 
    1035                                    parameter is ignored by device drivers, and is optional for bus 
    1036                                    drivers. For a bus driver, if this parameter is NULL, then handles 
    1037                                    for all the children of Controller are created by this driver. 
    1038                                    If this parameter is not NULL and the first Device Path Node is 
    1039                                    not the End of Device Path Node, then only the handle for the 
    1040                                    child device specified by the first Device Path Node of 
     1034  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
     1035                                   parameter is ignored by device drivers, and is optional for bus
     1036                                   drivers. For a bus driver, if this parameter is NULL, then handles
     1037                                   for all the children of Controller are created by this driver.
     1038                                   If this parameter is not NULL and the first Device Path Node is
     1039                                   not the End of Device Path Node, then only the handle for the
     1040                                   child device specified by the first Device Path Node of
    10411041                                   RemainingDevicePath is created by this driver.
    1042                                    If the first Device Path Node of RemainingDevicePath is 
     1042                                   If the first Device Path Node of RemainingDevicePath is
    10431043                                   the End of Device Path Node, no child handle is created by this
    10441044                                   driver.
     
    10701070/**
    10711071  Stops a device controller or a bus controller.
    1072  
    1073   The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). 
    1074   As a result, much of the error checking on the parameters to Stop() has been moved 
    1075   into this common boot service. It is legal to call Stop() from other locations, 
     1072
     1073  The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
     1074  As a result, much of the error checking on the parameters to Stop() has been moved
     1075  into this common boot service. It is legal to call Stop() from other locations,
    10761076  but the following calling restrictions must be followed or the system behavior will not be deterministic.
    10771077  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
     
    10811081     Start() function, and the Start() function must have called OpenProtocol() on
    10821082     ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
    1083  
     1083
    10841084  @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    1085   @param[in]  ControllerHandle  A handle to the device being stopped. The handle must 
    1086                                 support a bus specific I/O protocol for the driver 
     1085  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must
     1086                                support a bus specific I/O protocol for the driver
    10871087                                to use to stop the device.
    10881088  @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.
    1089   @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL 
     1089  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL
    10901090                                if NumberOfChildren is 0.
    10911091
     
    11131113
    11141114/**
    1115   Tests to see if this driver supports a given controller. If a child device is provided, 
     1115  Tests to see if this driver supports a given controller. If a child device is provided,
    11161116  it tests to see if this driver supports creating a handle for the specified child device.
    11171117
    1118   This function checks to see if the driver specified by This supports the device specified by 
    1119   ControllerHandle. Drivers typically use the device path attached to 
    1120   ControllerHandle and/or the services from the bus I/O abstraction attached to 
    1121   ControllerHandle to determine if the driver supports ControllerHandle. This function 
    1122   may be called many times during platform initialization. In order to reduce boot times, the tests 
    1123   performed by this function must be very small and take as little time as possible to execute. This 
    1124   function must not change the state of any hardware devices, and this function must be aware that the 
    1125   device specified by ControllerHandle may already be managed by the same driver or a 
    1126   different driver. This function must match its calls to AllocatePages() with FreePages(), 
    1127   AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). 
    1128   Since ControllerHandle may have been previously started by the same driver, if a protocol is 
    1129   already in the opened state, then it must not be closed with CloseProtocol(). This is required 
     1118  This function checks to see if the driver specified by This supports the device specified by
     1119  ControllerHandle. Drivers typically use the device path attached to
     1120  ControllerHandle and/or the services from the bus I/O abstraction attached to
     1121  ControllerHandle to determine if the driver supports ControllerHandle. This function
     1122  may be called many times during platform initialization. In order to reduce boot times, the tests
     1123  performed by this function must be very small and take as little time as possible to execute. This
     1124  function must not change the state of any hardware devices, and this function must be aware that the
     1125  device specified by ControllerHandle may already be managed by the same driver or a
     1126  different driver. This function must match its calls to AllocatePages() with FreePages(),
     1127  AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
     1128  Since ControllerHandle may have been previously started by the same driver, if a protocol is
     1129  already in the opened state, then it must not be closed with CloseProtocol(). This is required
    11301130  to guarantee the state of ControllerHandle is not modified by this function.
    11311131
    11321132  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    1133   @param[in]  ControllerHandle     The handle of the controller to test. This handle 
    1134                                    must support a protocol interface that supplies 
     1133  @param[in]  ControllerHandle     The handle of the controller to test. This handle
     1134                                   must support a protocol interface that supplies
    11351135                                   an I/O abstraction to the driver.
    1136   @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This 
    1137                                    parameter is ignored by device drivers, and is optional for bus 
    1138                                    drivers. For bus drivers, if this parameter is not NULL, then 
    1139                                    the bus driver must determine if the bus controller specified 
    1140                                    by ControllerHandle and the child controller specified 
    1141                                    by RemainingDevicePath are both supported by this 
     1136  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
     1137                                   parameter is ignored by device drivers, and is optional for bus
     1138                                   drivers. For bus drivers, if this parameter is not NULL, then
     1139                                   the bus driver must determine if the bus controller specified
     1140                                   by ControllerHandle and the child controller specified
     1141                                   by RemainingDevicePath are both supported by this
    11421142                                   bus driver.
    11431143
     
    11741174
    11751175  The Start() function is designed to be invoked from the EFI boot service ConnectController().
    1176   As a result, much of the error checking on the parameters to Start() has been moved into this 
    1177   common boot service. It is legal to call Start() from other locations, 
     1176  As a result, much of the error checking on the parameters to Start() has been moved into this
     1177  common boot service. It is legal to call Start() from other locations,
    11781178  but the following calling restrictions must be followed or the system behavior will not be deterministic.
    11791179  1. ControllerHandle must be a valid EFI_HANDLE.
     
    11811181     EFI_DEVICE_PATH_PROTOCOL.
    11821182  3. Prior to calling Start(), the Supported() function for the driver specified by This must
    1183      have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. 
     1183     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
    11841184
    11851185  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    1186   @param[in]  ControllerHandle     The handle of the controller to start. This handle 
    1187                                    must support a protocol interface that supplies 
     1186  @param[in]  ControllerHandle     The handle of the controller to start. This handle
     1187                                   must support a protocol interface that supplies
    11881188                                   an I/O abstraction to the driver.
    1189   @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This 
    1190                                    parameter is ignored by device drivers, and is optional for bus 
    1191                                    drivers. For a bus driver, if this parameter is NULL, then handles 
    1192                                    for all the children of Controller are created by this driver. 
    1193                                    If this parameter is not NULL and the first Device Path Node is 
    1194                                    not the End of Device Path Node, then only the handle for the 
    1195                                    child device specified by the first Device Path Node of 
     1189  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
     1190                                   parameter is ignored by device drivers, and is optional for bus
     1191                                   drivers. For a bus driver, if this parameter is NULL, then handles
     1192                                   for all the children of Controller are created by this driver.
     1193                                   If this parameter is not NULL and the first Device Path Node is
     1194                                   not the End of Device Path Node, then only the handle for the
     1195                                   child device specified by the first Device Path Node of
    11961196                                   RemainingDevicePath is created by this driver.
    1197                                    If the first Device Path Node of RemainingDevicePath is 
     1197                                   If the first Device Path Node of RemainingDevicePath is
    11981198                                   the End of Device Path Node, no child handle is created by this
    11991199                                   driver.
     
    12251225/**
    12261226  Stops a device controller or a bus controller.
    1227  
    1228   The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). 
    1229   As a result, much of the error checking on the parameters to Stop() has been moved 
    1230   into this common boot service. It is legal to call Stop() from other locations, 
     1227
     1228  The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
     1229  As a result, much of the error checking on the parameters to Stop() has been moved
     1230  into this common boot service. It is legal to call Stop() from other locations,
    12311231  but the following calling restrictions must be followed or the system behavior will not be deterministic.
    12321232  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
     
    12361236     Start() function, and the Start() function must have called OpenProtocol() on
    12371237     ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
    1238  
     1238
    12391239  @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    1240   @param[in]  ControllerHandle  A handle to the device being stopped. The handle must 
    1241                                 support a bus specific I/O protocol for the driver 
     1240  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must
     1241                                support a bus specific I/O protocol for the driver
    12421242                                to use to stop the device.
    12431243  @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.
    1244   @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL 
     1244  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL
    12451245                                if NumberOfChildren is 0.
    12461246
     
    13541354    goto ON_EXIT;
    13551355  }
    1356  
     1356
    13571357  //
    13581358  // Uninstall the protocols installed by iSCSI driver.
     
    13671367    goto ON_EXIT;
    13681368  }
    1369  
     1369
    13701370  if (gIScsiControllerNameTable!= NULL) {
    13711371    Status = FreeUnicodeStringTable (gIScsiControllerNameTable);
     
    13961396    }
    13971397  }
    1398  
     1398
    13991399  Status = gBS->HandleProtocol (
    14001400                  gIScsiIp4DriverBinding.DriverBindingHandle,
     
    14341434    }
    14351435  }
    1436  
     1436
    14371437  Status = gBS->HandleProtocol (
    14381438                  gIScsiIp6DriverBinding.DriverBindingHandle,
     
    14791479    FreePool (DeviceHandleBuffer);
    14801480  }
    1481  
     1481
    14821482  return Status;
    14831483}
     
    14871487  the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
    14881488  both device drivers and bus drivers.
    1489  
     1489
    14901490  The entry point for iSCSI driver which initializes the global variables and
    14911491  installs the driver binding, component name protocol, iSCSI initiator name
    14921492  protocol and Authentication Info protocol on its image.
    1493  
     1493
    14941494  @param[in]  ImageHandle       The firmware allocated handle for the UEFI image.
    14951495  @param[in]  SystemTable       A pointer to the EFI System Table.
     
    15481548    goto Error1;
    15491549  }
    1550  
     1550
    15511551  //
    15521552  // Install the iSCSI Initiator Name Protocol.
     
    15601560  if (EFI_ERROR (Status)) {
    15611561    goto Error2;
    1562   } 
     1562  }
    15631563
    15641564  //
     
    16001600    if (EFI_ERROR (Status)) {
    16011601      goto Error5;
    1602     }   
     1602    }
    16031603  }
    16041604
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiDriver.h

    r58459 r58466  
    8484
    8585/**
    86   Tests to see if this driver supports a given controller. If a child device is provided, 
     86  Tests to see if this driver supports a given controller. If a child device is provided,
    8787  it tests to see if this driver supports creating a handle for the specified child device.
    8888
    89   This function checks to see if the driver specified by This supports the device specified by 
    90   ControllerHandle. Drivers typically use the device path attached to 
    91   ControllerHandle and/or the services from the bus I/O abstraction attached to 
    92   ControllerHandle to determine if the driver supports ControllerHandle. This function 
    93   may be called many times during platform initialization. In order to reduce boot times, the tests 
    94   performed by this function must be very small and take as little time as possible to execute. This 
    95   function must not change the state of any hardware devices, and this function must be aware that the 
    96   device specified by ControllerHandle may already be managed by the same driver or a 
    97   different driver. This function must match its calls to AllocatePages() with FreePages(), 
    98   AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). 
    99   Since ControllerHandle may have been previously started by the same driver, if a protocol is 
    100   already in the opened state, then it must not be closed with CloseProtocol(). This is required 
     89  This function checks to see if the driver specified by This supports the device specified by
     90  ControllerHandle. Drivers typically use the device path attached to
     91  ControllerHandle and/or the services from the bus I/O abstraction attached to
     92  ControllerHandle to determine if the driver supports ControllerHandle. This function
     93  may be called many times during platform initialization. In order to reduce boot times, the tests
     94  performed by this function must be very small and take as little time as possible to execute. This
     95  function must not change the state of any hardware devices, and this function must be aware that the
     96  device specified by ControllerHandle may already be managed by the same driver or a
     97  different driver. This function must match its calls to AllocatePages() with FreePages(),
     98  AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
     99  Since ControllerHandle may have been previously started by the same driver, if a protocol is
     100  already in the opened state, then it must not be closed with CloseProtocol(). This is required
    101101  to guarantee the state of ControllerHandle is not modified by this function.
    102102
    103103  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    104   @param[in]  ControllerHandle     The handle of the controller to test. This handle 
    105                                    must support a protocol interface that supplies 
     104  @param[in]  ControllerHandle     The handle of the controller to test. This handle
     105                                   must support a protocol interface that supplies
    106106                                   an I/O abstraction to the driver.
    107   @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This 
    108                                    parameter is ignored by device drivers, and is optional for bus 
    109                                    drivers. For bus drivers, if this parameter is not NULL, then 
    110                                    the bus driver must determine if the bus controller specified 
    111                                    by ControllerHandle and the child controller specified 
    112                                    by RemainingDevicePath are both supported by this 
     107  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
     108                                   parameter is ignored by device drivers, and is optional for bus
     109                                   drivers. For bus drivers, if this parameter is not NULL, then
     110                                   the bus driver must determine if the bus controller specified
     111                                   by ControllerHandle and the child controller specified
     112                                   by RemainingDevicePath are both supported by this
    113113                                   bus driver.
    114114
     
    137137
    138138  The Start() function is designed to be invoked from the EFI boot service ConnectController().
    139   As a result, much of the error checking on the parameters to Start() has been moved into this 
    140   common boot service. It is legal to call Start() from other locations, 
     139  As a result, much of the error checking on the parameters to Start() has been moved into this
     140  common boot service. It is legal to call Start() from other locations,
    141141  but the following calling restrictions must be followed or the system behavior will not be deterministic.
    142142  1. ControllerHandle must be a valid EFI_HANDLE.
     
    144144     EFI_DEVICE_PATH_PROTOCOL.
    145145  3. Prior to calling Start(), the Supported() function for the driver specified by This must
    146      have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. 
     146     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
    147147
    148148  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    149   @param[in]  ControllerHandle     The handle of the controller to start. This handle 
    150                                    must support a protocol interface that supplies 
     149  @param[in]  ControllerHandle     The handle of the controller to start. This handle
     150                                   must support a protocol interface that supplies
    151151                                   an I/O abstraction to the driver.
    152   @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This 
    153                                    parameter is ignored by device drivers, and is optional for bus 
    154                                    drivers. For a bus driver, if this parameter is NULL, then handles 
    155                                    for all the children of Controller are created by this driver. 
    156                                    If this parameter is not NULL and the first Device Path Node is 
    157                                    not the End of Device Path Node, then only the handle for the 
    158                                    child device specified by the first Device Path Node of 
     152  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
     153                                   parameter is ignored by device drivers, and is optional for bus
     154                                   drivers. For a bus driver, if this parameter is NULL, then handles
     155                                   for all the children of Controller are created by this driver.
     156                                   If this parameter is not NULL and the first Device Path Node is
     157                                   not the End of Device Path Node, then only the handle for the
     158                                   child device specified by the first Device Path Node of
    159159                                   RemainingDevicePath is created by this driver.
    160                                    If the first Device Path Node of RemainingDevicePath is 
     160                                   If the first Device Path Node of RemainingDevicePath is
    161161                                   the End of Device Path Node, no child handle is created by this
    162162                                   driver.
     
    178178/**
    179179  Stops a device controller or a bus controller.
    180  
    181   The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). 
    182   As a result, much of the error checking on the parameters to Stop() has been moved 
    183   into this common boot service. It is legal to call Stop() from other locations, 
     180
     181  The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
     182  As a result, much of the error checking on the parameters to Stop() has been moved
     183  into this common boot service. It is legal to call Stop() from other locations,
    184184  but the following calling restrictions must be followed or the system behavior will not be deterministic.
    185185  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
     
    189189     Start() function, and the Start() function must have called OpenProtocol() on
    190190     ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
    191  
     191
    192192  @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    193   @param[in]  ControllerHandle  A handle to the device being stopped. The handle must 
    194                                 support a bus specific I/O protocol for the driver 
     193  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must
     194                                support a bus specific I/O protocol for the driver
    195195                                to use to stop the device.
    196196  @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.
    197   @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL 
     197  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL
    198198                                if NumberOfChildren is 0.
    199199
     
    212212
    213213/**
    214   Tests to see if this driver supports a given controller. If a child device is provided, 
     214  Tests to see if this driver supports a given controller. If a child device is provided,
    215215  it tests to see if this driver supports creating a handle for the specified child device.
    216216
    217   This function checks to see if the driver specified by This supports the device specified by 
    218   ControllerHandle. Drivers typically use the device path attached to 
    219   ControllerHandle and/or the services from the bus I/O abstraction attached to 
    220   ControllerHandle to determine if the driver supports ControllerHandle. This function 
    221   may be called many times during platform initialization. In order to reduce boot times, the tests 
    222   performed by this function must be very small and take as little time as possible to execute. This 
    223   function must not change the state of any hardware devices, and this function must be aware that the 
    224   device specified by ControllerHandle may already be managed by the same driver or a 
    225   different driver. This function must match its calls to AllocatePages() with FreePages(), 
    226   AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). 
    227   Since ControllerHandle may have been previously started by the same driver, if a protocol is 
    228   already in the opened state, then it must not be closed with CloseProtocol(). This is required 
     217  This function checks to see if the driver specified by This supports the device specified by
     218  ControllerHandle. Drivers typically use the device path attached to
     219  ControllerHandle and/or the services from the bus I/O abstraction attached to
     220  ControllerHandle to determine if the driver supports ControllerHandle. This function
     221  may be called many times during platform initialization. In order to reduce boot times, the tests
     222  performed by this function must be very small and take as little time as possible to execute. This
     223  function must not change the state of any hardware devices, and this function must be aware that the
     224  device specified by ControllerHandle may already be managed by the same driver or a
     225  different driver. This function must match its calls to AllocatePages() with FreePages(),
     226  AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
     227  Since ControllerHandle may have been previously started by the same driver, if a protocol is
     228  already in the opened state, then it must not be closed with CloseProtocol(). This is required
    229229  to guarantee the state of ControllerHandle is not modified by this function.
    230230
    231231  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    232   @param[in]  ControllerHandle     The handle of the controller to test. This handle 
    233                                    must support a protocol interface that supplies 
     232  @param[in]  ControllerHandle     The handle of the controller to test. This handle
     233                                   must support a protocol interface that supplies
    234234                                   an I/O abstraction to the driver.
    235   @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This 
    236                                    parameter is ignored by device drivers, and is optional for bus 
    237                                    drivers. For bus drivers, if this parameter is not NULL, then 
    238                                    the bus driver must determine if the bus controller specified 
    239                                    by ControllerHandle and the child controller specified 
    240                                    by RemainingDevicePath are both supported by this 
     235  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
     236                                   parameter is ignored by device drivers, and is optional for bus
     237                                   drivers. For bus drivers, if this parameter is not NULL, then
     238                                   the bus driver must determine if the bus controller specified
     239                                   by ControllerHandle and the child controller specified
     240                                   by RemainingDevicePath are both supported by this
    241241                                   bus driver.
    242242
     
    265265
    266266  The Start() function is designed to be invoked from the EFI boot service ConnectController().
    267   As a result, much of the error checking on the parameters to Start() has been moved into this 
    268   common boot service. It is legal to call Start() from other locations, 
     267  As a result, much of the error checking on the parameters to Start() has been moved into this
     268  common boot service. It is legal to call Start() from other locations,
    269269  but the following calling restrictions must be followed or the system behavior will not be deterministic.
    270270  1. ControllerHandle must be a valid EFI_HANDLE.
     
    272272     EFI_DEVICE_PATH_PROTOCOL.
    273273  3. Prior to calling Start(), the Supported() function for the driver specified by This must
    274      have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. 
     274     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
    275275
    276276  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    277   @param[in]  ControllerHandle     The handle of the controller to start. This handle 
    278                                    must support a protocol interface that supplies 
     277  @param[in]  ControllerHandle     The handle of the controller to start. This handle
     278                                   must support a protocol interface that supplies
    279279                                   an I/O abstraction to the driver.
    280   @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This 
    281                                    parameter is ignored by device drivers, and is optional for bus 
    282                                    drivers. For a bus driver, if this parameter is NULL, then handles 
    283                                    for all the children of Controller are created by this driver. 
    284                                    If this parameter is not NULL and the first Device Path Node is 
    285                                    not the End of Device Path Node, then only the handle for the 
    286                                    child device specified by the first Device Path Node of 
     280  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
     281                                   parameter is ignored by device drivers, and is optional for bus
     282                                   drivers. For a bus driver, if this parameter is NULL, then handles
     283                                   for all the children of Controller are created by this driver.
     284                                   If this parameter is not NULL and the first Device Path Node is
     285                                   not the End of Device Path Node, then only the handle for the
     286                                   child device specified by the first Device Path Node of
    287287                                   RemainingDevicePath is created by this driver.
    288                                    If the first Device Path Node of RemainingDevicePath is 
     288                                   If the first Device Path Node of RemainingDevicePath is
    289289                                   the End of Device Path Node, no child handle is created by this
    290290                                   driver.
     
    306306/**
    307307  Stops a device controller or a bus controller.
    308  
    309   The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). 
    310   As a result, much of the error checking on the parameters to Stop() has been moved 
    311   into this common boot service. It is legal to call Stop() from other locations, 
     308
     309  The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
     310  As a result, much of the error checking on the parameters to Stop() has been moved
     311  into this common boot service. It is legal to call Stop() from other locations,
    312312  but the following calling restrictions must be followed or the system behavior will not be deterministic.
    313313  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
     
    317317     Start() function, and the Start() function must have called OpenProtocol() on
    318318     ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
    319  
     319
    320320  @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
    321   @param[in]  ControllerHandle  A handle to the device being stopped. The handle must 
    322                                 support a bus specific I/O protocol for the driver 
     321  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must
     322                                support a bus specific I/O protocol for the driver
    323323                                to use to stop the device.
    324324  @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.
    325   @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL 
     325  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL
    326326                                if NumberOfChildren is 0.
    327327
     
    425425                                requesting, and it must match one of the
    426426                                languages specified in SupportedLanguages. The
    427                                 number of languages supported by a driver is 
    428                                 determined by the driver writer. Language is 
    429                                 specified inRFC 4646 or ISO 639-2 language code 
     427                                number of languages supported by a driver is
     428                                determined by the driver writer. Language is
     429                                specified inRFC 4646 or ISO 639-2 language code
    430430                                format.
    431                                
     431
    432432  @param[out]  ControllerName   A pointer to the Unicode string to return.
    433433                                This Unicode string is the name of the
     
    588588  Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel.
    589589  This function supports both blocking I/O and nonblocking I/O. The blocking I/O
    590   functionality is required, and the nonblocking I/O functionality is optional. 
     590  functionality is required, and the nonblocking I/O functionality is optional.
    591591
    592592  @param[in]       This    A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
     
    595595                           Request Packet. Each transport driver may choose to
    596596                           utilize a subset of this size to suit the needs
    597                            of transport target representation. For example, a 
     597                           of transport target representation. For example, a
    598598                           Fibre Channel driver may use only 8 bytes (WWN)
    599599                           to represent an FC target.
    600600  @param[in]       Lun     The LUN of the SCSI device to send the SCSI Request Packet.
    601601  @param[in, out]  Packet  A pointer to the SCSI Request Packet to send to the
    602                            SCSI device specified by Target and Lun.                 
     602                           SCSI device specified by Target and Lun.
    603603  @param[in]       Event   If nonblocking I/O is not supported then Event is ignored,
    604604                           and blocking I/O is performed. If Event is NULL, then
     
    609609
    610610  @retval EFI_SUCCESS           The SCSI Request Packet was sent by the host. For
    611                                 bi-directional commands, InTransferLength bytes 
     611                                bi-directional commands, InTransferLength bytes
    612612                                were transferred from InDataBuffer.
    613613                                For write and bi-directional commands, OutTransferLength
     
    622622                                queued. The caller may retry later.
    623623  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to send
    624                                 the SCSI Request Packet.                               
     624                                the SCSI Request Packet.
    625625  @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket
    626626                                are invalid.
     
    649649  a SCSI channel. These can either be the list SCSI devices that are actually
    650650  present on the SCSI channel, or the list of legal Target Ids and LUNs for the
    651   SCSI channel. Regardless, the caller of this function must probe the Target ID     
    652   and LUN returned to see if a SCSI device is actually present at that location   
    653   on the SCSI channel. 
     651  SCSI channel. Regardless, the caller of this function must probe the Target ID
     652  and LUN returned to see if a SCSI device is actually present at that location
     653  on the SCSI channel.
    654654
    655655  @param[in]       This          The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
     
    781781
    782782/**
    783   Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.                         
     783  Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.
    784784
    785785  @param[in]       This         A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL
     
    791791                                An input value of 0xF(all bytes in the array are 0xF)
    792792                                in the Target array retrieves the Target ID of the
    793                                 first SCSI device present on a SCSI channel.                 
     793                                first SCSI device present on a SCSI channel.
    794794
    795795  @retval EFI_SUCCESS           The Target ID of the next SCSI device on the SCSI
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiDxe.inf

    r58459 r58466  
    44#  The iSCSI driver provides iSCSI service in the preboot environment and supports
    55#  booting over iSCSI.
    6 #                                                   
     6#
    77# Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
    88# This program and the accompanying materials
     
    5656  IScsiIbft.c
    5757  IScsiIbft.h
    58   IScsiInitiatorName.c 
     58  IScsiInitiatorName.c
    5959  IScsiImpl.h
    6060  IScsiMisc.c
     
    8181  UefiBootServicesTableLib
    8282  UefiDriverEntryPoint
    83   UefiLib 
     83  UefiLib
    8484  UefiRuntimeServicesTableLib
    8585  UefiHiiServicesLib
     
    9191  gEfiPciIoProtocolGuid                         ## SOMETIMES_CONSUMES
    9292  gEfiDhcp4ProtocolGuid                         ## TO_START
    93   gEfiDhcp6ProtocolGuid                         ## TO_START 
     93  gEfiDhcp6ProtocolGuid                         ## TO_START
    9494  gEfiDhcp4ServiceBindingProtocolGuid           ## TO_START
    95   gEfiDhcp6ServiceBindingProtocolGuid           ## TO_START 
     95  gEfiDhcp6ServiceBindingProtocolGuid           ## TO_START
    9696  gEfiTcp4ProtocolGuid                          ## TO_START
    97   gEfiTcp6ProtocolGuid                          ## TO_START 
     97  gEfiTcp6ProtocolGuid                          ## TO_START
    9898  gEfiTcp4ServiceBindingProtocolGuid            ## TO_START
    99   gEfiTcp6ServiceBindingProtocolGuid            ## TO_START 
     99  gEfiTcp6ServiceBindingProtocolGuid            ## TO_START
    100100  gEfiExtScsiPassThruProtocolGuid               ## BY_START
    101101  gEfiHiiConfigAccessProtocolGuid               ## PRODUCES
     
    106106  ## UNDEFINED # Variable
    107107  gEfiIScsiInitiatorNameProtocolGuid
    108   ## PRODUCES       
    109   gEfiAuthenticationInfoProtocolGuid           
     108  ## PRODUCES
     109  gEfiAuthenticationInfoProtocolGuid
    110110
    111111[Guids]
     
    115115  gEfiAcpi10TableGuid                           ## SOMETIMES_CONSUMES ## SystemTable
    116116  gEfiAcpi20TableGuid                           ## SOMETIMES_CONSUMES ## SystemTable
    117  
     117
    118118  ## SOMETIMES_PRODUCES ## Variable:L"AttemptOrder"
    119119  ## SOMETIMES_CONSUMES ## Variable:L"AttemptOrder"
     
    124124  ## SOMETIMES_CONSUMES ## HII
    125125  gIScsiConfigGuid
    126  
     126
    127127[UserExtensions.TianoCore."ExtraFiles"]
    128128  IScsiDxeExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiExtScsiPassThru.c

    r58459 r58466  
    3030  Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel.
    3131  This function supports both blocking I/O and nonblocking I/O. The blocking I/O
    32   functionality is required, and the nonblocking I/O functionality is optional. 
     32  functionality is required, and the nonblocking I/O functionality is optional.
    3333
    3434  @param[in]       This    A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
     
    3737                           Request Packet. Each transport driver may choose to
    3838                           utilize a subset of this size to suit the needs
    39                            of transport target representation. For example, a 
     39                           of transport target representation. For example, a
    4040                           Fibre Channel driver may use only 8 bytes (WWN)
    4141                           to represent an FC target.
    4242  @param[in]       Lun     The LUN of the SCSI device to send the SCSI Request Packet.
    4343  @param[in, out]  Packet  A pointer to the SCSI Request Packet to send to the
    44                            SCSI device specified by Target and Lun.                 
     44                           SCSI device specified by Target and Lun.
    4545  @param[in]       Event   If nonblocking I/O is not supported then Event is ignored,
    4646                           and blocking I/O is performed. If Event is NULL, then
     
    5151
    5252  @retval EFI_SUCCESS           The SCSI Request Packet was sent by the host. For
    53                                 bi-directional commands, InTransferLength bytes 
     53                                bi-directional commands, InTransferLength bytes
    5454                                were transferred from InDataBuffer.
    5555                                For write and bi-directional commands, OutTransferLength
     
    6464                                queued. The caller may retry later.
    6565  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to send
    66                                 the SCSI Request Packet.                               
     66                                the SCSI Request Packet.
    6767  @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket,
    6868                                are invalid.
     
    8989  EFI_STATUS         Status;
    9090  ISCSI_DRIVER_DATA  *Private;
    91  
     91
    9292  if (Target[0] != 0) {
    9393    return EFI_INVALID_PARAMETER;
     
    119119  a SCSI channel. These can either be the list SCSI devices that are actually
    120120  present on the SCSI channel, or the list of legal Target Ids and LUNs for the
    121   SCSI channel. Regardless, the caller of this function must probe the Target ID     
    122   and LUN returned to see if a SCSI device is actually present at that location   
    123   on the SCSI channel. 
     121  SCSI channel. Regardless, the caller of this function must probe the Target ID
     122  and LUN returned to see if a SCSI device is actually present at that location
     123  on the SCSI channel.
    124124
    125125  @param[in]       This          The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
     
    299299  @retval EFI_UNSUPPORTED        This driver does not support the device path  node
    300300                                 type in DevicePath.
    301   @retval EFI_NOT_FOUND          A valid translation does not exist from DevicePath 
     301  @retval EFI_NOT_FOUND          A valid translation does not exist from DevicePath
    302302                                 to a TargetID and LUN.
    303303
     
    383383
    384384/**
    385   Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.                         
     385  Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.
    386386
    387387  @param[in]       This         A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL
     
    393393                                An input value of 0xF(all bytes in the array are 0xF)
    394394                                in the Target array retrieves the Target ID of the
    395                                 first SCSI device present on a SCSI channel.                 
     395                                first SCSI device present on a SCSI channel.
    396396
    397397  @retval EFI_SUCCESS           The Target ID of the next SCSI device on the SCSI
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiIbft.c

    r58459 r58466  
    2020/**
    2121  Initialize the header of the iSCSI Boot Firmware Table.
    22  
     22
    2323  @param[out]  Header     The header of the iSCSI Boot Firmware Table.
    2424  @param[in]   OemId      The OEM ID.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiIbft.h

    r48674 r58466  
    1717
    1818#include <IndustryStandard/Acpi.h>
    19 #include <IndustryStandard/IScsiBootFirmwareTable.h> 
     19#include <IndustryStandard/IScsiBootFirmwareTable.h>
    2020#include <Protocol/AcpiTable.h>
    2121#include <Protocol/PciIo.h>
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiImpl.h

    r58459 r58466  
    192192  EFI_HANDLE                      ExtScsiPassThruHandle;
    193193  EFI_DEVICE_PATH_PROTOCOL        *DevicePath;
    194   EFI_HANDLE                      ChildHandle; 
     194  EFI_HANDLE                      ChildHandle;
    195195  ISCSI_SESSION                   *Session;
    196196};
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiMisc.c

    r58459 r58466  
    2121
    2222  @param[in, out] Str   Pointer to the null-terminated string to be trimmed.
    23                         On return, Str will hold the trimmed string. 
     23                        On return, Str will hold the trimmed string.
    2424
    2525  @param[in]      CharC Character will be trimmed from str.
     
    3434  CHAR16  *Pointer1;
    3535  CHAR16  *Pointer2;
    36  
     36
    3737  if (*Str == 0) {
    3838    return ;
    3939  }
    40  
     40
    4141  //
    4242  // Trim off the leading and trailing characters c
     
    4545    ;
    4646  }
    47  
     47
    4848  Pointer2 = Str;
    4949  if (Pointer2 == Pointer1) {
     
    5353    }
    5454  } else {
    55     while (*Pointer1 != 0) {   
    56     *Pointer2 = *Pointer1;   
     55    while (*Pointer1 != 0) {
     56    *Pointer2 = *Pointer1;
    5757    Pointer1++;
    5858    Pointer2++;
     
    6060    *Pointer2 = 0;
    6161  }
    62  
    63  
     62
     63
    6464  for (Pointer1 = Str + StrLen(Str) - 1; Pointer1 >= Str && *Pointer1 == CharC; Pointer1--) {
    6565    ;
    6666  }
    67   if  (Pointer1 !=  Str + StrLen(Str) - 1) { 
     67  if  (Pointer1 !=  Str + StrLen(Str) - 1) {
    6868    *(Pointer1 + 1) = 0;
    6969  }
     
    132132  UINT8   TemValue;
    133133  UINT16  Value[4];
    134  
     134
    135135  ZeroMem (Lun, 8);
    136136  ZeroMem (TemStr, 2);
    137137  ZeroMem ((UINT8 *) Value, sizeof (Value));
    138   SizeStr    = AsciiStrLen (Str); 
     138  SizeStr    = AsciiStrLen (Str);
    139139  IndexValue = 0;
    140140  IndexNum   = 0;
     
    151151      }
    152152    }
    153    
     153
    154154    if ((TemValue == 0) && (TemStr[0] == '-')) {
    155155      //
     
    168168      continue;
    169169    }
    170    
     170
    171171    if (++IndexNum > 4) {
    172       //     
     172      //
    173173      // Each Lun Str can't exceed size 4, because it will be as UINT16 value.
    174174      //
    175175      return EFI_INVALID_PARAMETER;
    176176    }
    177    
     177
    178178    //
    179179    // Combine UINT16 value.
     
    181181    Value[IndexValue] = (UINT16) ((Value[IndexValue] << 4) + TemValue);
    182182  }
    183  
     183
    184184  for (Index = 0; Index <= IndexValue; Index ++) {
    185185    *((UINT16 *) &Lun[Index * 2]) =  HTONS (Value[Index]);
    186186  }
    187  
     187
    188188  return EFI_SUCCESS;
    189189}
     
    320320  @param[in, out]  HexLength   The length of the string.
    321321
    322   @retval EFI_SUCCESS          The binary data is converted to the hexadecimal string 
     322  @retval EFI_SUCCESS          The binary data is converted to the hexadecimal string
    323323                               and the length of the string is updated.
    324324  @retval EFI_BUFFER_TOO_SMALL The string is too small.
     
    386386  UINT8   Digit;
    387387  CHAR8   TemStr[2];
    388  
     388
    389389  ZeroMem (TemStr, sizeof (TemStr));
    390390
     
    395395    HexStr += 2;
    396396  }
    397  
     397
    398398  Length = AsciiStrLen (HexStr);
    399399
     
    413413    }
    414414  }
    415  
     415
    416416  *BinLength = (UINT32) ((Index + 1)/2);
    417417
     
    899899  @param[in]  Controller           The handle of the controller.
    900900  @param[in]  IpVersion            IP_VERSION_4 or IP_VERSION_6.
    901  
     901
    902902  @retval TRUE                     The handle of the controller need the Dhcp protocol.
    903903  @retval FALSE                    The handle of the controller does not need the Dhcp protocol.
    904  
     904
    905905**/
    906906BOOLEAN
     
    920920  CHAR16                      MacString[ISCSI_MAX_MAC_STRING_LEN];
    921921  CHAR16                      AttemptName[ISCSI_NAME_IFR_MAX_SIZE];
    922  
     922
    923923  AttemptConfigOrder = IScsiGetVariableAndSize (
    924924                         L"AttemptOrder",
     
    929929    return FALSE;
    930930  }
    931  
     931
    932932  //
    933933  // Get MAC address of this network device.
     
    942942  VlanId = NetLibGetVlanId (Controller);
    943943  IScsiMacAddrToStr (&MacAddr, (UINT32) HwAddressSize, VlanId, MacString);
    944  
     944
    945945  for (Index = 0; Index < AttemptConfigOrderSize / sizeof (UINT8); Index++) {
    946946    UnicodeSPrint (
     
    960960      continue;
    961961    }
    962    
     962
    963963    ASSERT (AttemptConfigOrder[Index] == AttemptTmp->AttemptConfigIndex);
    964964
     
    968968    }
    969969
    970     if (AttemptTmp->SessionConfigData.IpMode != IP_MODE_AUTOCONFIG && 
     970    if (AttemptTmp->SessionConfigData.IpMode != IP_MODE_AUTOCONFIG &&
    971971        AttemptTmp->SessionConfigData.IpMode != ((IpVersion == IP_VERSION_4) ? IP_MODE_IP4 : IP_MODE_IP6)) {
    972972      FreePool (AttemptTmp);
    973973      continue;
    974974    }
    975    
     975
    976976    if(AttemptTmp->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG ||
    977977       AttemptTmp->SessionConfigData.InitiatorInfoFromDhcp == TRUE ||
    978        AttemptTmp->SessionConfigData.TargetInfoFromDhcp == TRUE) { 
     978       AttemptTmp->SessionConfigData.TargetInfoFromDhcp == TRUE) {
    979979      FreePool (AttemptTmp);
    980980      FreePool (AttemptConfigOrder);
     
    984984    FreePool (AttemptTmp);
    985985  }
    986  
     986
    987987  FreePool (AttemptConfigOrder);
    988988  return FALSE;
     
    10471047    // Check whether the attempt exists in AttemptConfig.
    10481048    //
    1049     AttemptTmp = IScsiConfigGetAttemptByConfigIndex (AttemptConfigOrder[Index]);   
     1049    AttemptTmp = IScsiConfigGetAttemptByConfigIndex (AttemptConfigOrder[Index]);
    10501050    if (AttemptTmp != NULL && AttemptTmp->SessionConfigData.Enabled == ISCSI_DISABLED) {
    10511051      continue;
     
    11991199        (UINT8) (mPrivate->Ipv6Flag ? IP_MODE_AUTOCONFIG_IP6 : IP_MODE_AUTOCONFIG_IP4);
    12001200    }
    1201    
     1201
    12021202    //
    12031203    // Get some information from dhcp server.
     
    13691369                  &gEfiDevicePathProtocolGuid,
    13701370                  (VOID **) &DevicePath
    1371                   ); 
     1371                  );
    13721372  if (EFI_ERROR (Status)) {
    13731373    return NULL;
     
    13881388        DPathNode->Ipv4.LocalPort       = 0;
    13891389
    1390         DPathNode->Ipv4.StaticIpAddress = 
     1390        DPathNode->Ipv4.StaticIpAddress =
    13911391          (BOOLEAN) (!Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp);
    13921392
     
    14481448  is performed by evaluating if the the protocol specified by ProtocolGuid is
    14491449  present on ControllerHandle and is was opened by DriverBindingHandle and Nic
    1450   Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER. 
     1450  Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
    14511451  If ProtocolGuid is NULL, then ASSERT().
    14521452
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiMisc.h

    r58459 r58466  
    5656
    5757/**
    58   Convert the hexadecimal encoded LUN string into the 64-bit LUN. 
     58  Convert the hexadecimal encoded LUN string into the 64-bit LUN.
    5959
    6060  @param[in]   Str             The hexadecimal encoded LUN string.
     
    128128  @param[in, out]  HexLength   The length of the string.
    129129
    130   @retval EFI_SUCCESS          The binary data is converted to the hexadecimal string 
     130  @retval EFI_SUCCESS          The binary data is converted to the hexadecimal string
    131131                               and the length of the string is updated.
    132132  @retval EFI_BUFFER_TOO_SMALL The string is too small.
     
    304304  @param[in]  Controller           The handle of the controller.
    305305  @param[in]  IpVersion            IP_VERSION_4 or IP_VERSION_6.
    306  
     306
    307307  @retval TRUE                     The handle of the controller need the Dhcp protocol.
    308308  @retval FALSE                    The handle of the controller does not need the Dhcp protocol.
    309  
     309
    310310**/
    311311BOOLEAN
     
    365365  is performed by evaluating if the the protocol specified by ProtocolGuid is
    366366  present on ControllerHandle and is was opened by DriverBindingHandle and Nic
    367   Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER. 
     367  Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
    368368  If ProtocolGuid is NULL, then ASSERT().
    369369
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiProto.c

    r58459 r58466  
    1818
    1919/**
    20   Attach the iSCSI connection to the iSCSI session. 
     20  Attach the iSCSI connection to the iSCSI session.
    2121
    2222  @param[in, out]  Session The iSCSI session.
     
    3636
    3737/**
    38   Detach the iSCSI connection from the session it belongs to. 
     38  Detach the iSCSI connection from the session it belongs to.
    3939
    4040  @param[in, out]  Conn The iSCSI connection.
     
    5353
    5454/**
    55   Check the sequence number according to RFC3720. 
     55  Check the sequence number according to RFC3720.
    5656
    5757  @param[in, out]  ExpSN   The currently expected sequence number.
     
    125125  @retval EFI_SUCCESS        The iSCSI connection is logged into the iSCSI target.
    126126  @retval EFI_TIMEOUT        Timeout occurred during the login procedure.
    127   @retval Others             Other errors as indicated. 
     127  @retval Others             Other errors as indicated.
    128128
    129129**/
     
    254254  if (!Conn->Ipv6Flag) {
    255255    Tcp4IoConfig = &TcpIoConfig.Tcp4IoConfigData;
    256    
     256
    257257    CopyMem (&Tcp4IoConfig->LocalIp, &NvData->LocalIp, sizeof (EFI_IPv4_ADDRESS));
    258258    CopyMem (&Tcp4IoConfig->SubnetMask, &NvData->SubnetMask, sizeof (EFI_IPv4_ADDRESS));
     
    265265  } else {
    266266    Tcp6IoConfig = &TcpIoConfig.Tcp6IoConfigData;
    267  
     267
    268268    CopyMem (&Tcp6IoConfig->RemoteIp, &NvData->TargetIp, sizeof (EFI_IPv6_ADDRESS));
    269269    Tcp6IoConfig->RemotePort  = NvData->TargetPort;
     
    318318  @retval     EFI_SUCCESS      Get the NIC information successfully.
    319319  @retval     Others           Other errors as indicated.
    320  
     320
    321321**/
    322322EFI_STATUS
     
    474474
    475475    if (!Conn->Ipv6Flag) {
    476       ProtocolGuid = &gEfiTcp4ProtocolGuid;     
     476      ProtocolGuid = &gEfiTcp4ProtocolGuid;
    477477    } else {
    478478      ProtocolGuid = &gEfiTcp6ProtocolGuid;
     
    485485                    Session->Private->Image,
    486486                    Session->Private->ExtScsiPassThruHandle,
    487                     EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER                   
     487                    EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
    488488                    );
    489489
     
    592592
    593593  @param[in]  Conn             The connection in the iSCSI login phase.
    594  
     594
    595595  @retval EFI_SUCCESS          The iSCSI login response PDU is received and processed.
    596596  @retval Others               Other errors as indicated.
     
    770770    //
    771771    // Both none authentication and CHAP authentication share the CHAP path.
    772     // 
     772    //
    773773    //
    774774    if (Session->AuthType != ISCSI_AUTH_TYPE_KRB) {
     
    785785      IScsiFillOpParams (Conn, Nbuf);
    786786    }
    787    
     787
    788788    ISCSI_SET_FLAG (LoginReq, ISCSI_LOGIN_REQ_PDU_FLAG_TRANSIT);
    789789    break;
     
    941941    //
    942942    if ((Session->State == SESSION_STATE_FREE) && (Session->CmdSN != LoginRsp->ExpCmdSN)) {
    943       return EFI_PROTOCOL_ERROR;     
     943      return EFI_PROTOCOL_ERROR;
    944944    }
    945945
     
    10491049                               TargetAddress key-value list.
    10501050  @param[in]      Len          Length of the data.
    1051  
     1051
    10521052  @retval EFI_SUCCESS          The target address is updated.
    10531053  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
     
    12831283  case ISCSI_OPCODE_SCSI_DATA_IN:
    12841284    //
    1285     // To reduce memory copy overhead, try to use the buffer described by Context 
     1285    // To reduce memory copy overhead, try to use the buffer described by Context
    12861286    // if the PDU is an iSCSI SCSI data.
    12871287    //
     
    16311631  IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_TARGET_PORTAL_GROUP_TAG);
    16321632
    1633  
     1633
    16341634  //
    16351635  // Remove the key-value that may not needed for result function is OR.
     
    21462146    NetbufFree (PduHeader);
    21472147    return NULL;
    2148   }     
     2148  }
    21492149  Header  = (ISCSI_ADDITIONAL_HEADER *) (ScsiCmd + 1);
    21502150
     
    28172817  @param[in, out]  Packet    The request packet containing IO request, SCSI command
    28182818                             buffer and buffers to read/write.
    2819                              
    2820   @retval EFI_SUCCES           The SCSI command is executed and the result is updated to 
     2819
     2820  @retval EFI_SUCCES           The SCSI command is executed and the result is updated to
    28212821                               the Packet.
    28222822  @retval EFI_DEVICE_ERROR     Session state was not as required.
     
    31123112      ProtocolGuid = &gEfiTcp4ProtocolGuid;
    31133113    } else {
    3114       ProtocolGuid = &gEfiTcp6ProtocolGuid;   
     3114      ProtocolGuid = &gEfiTcp6ProtocolGuid;
    31153115    }
    31163116
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IScsiDxe/IScsiProto.h

    r58459 r58466  
    622622
    623623/**
    624   Attach the iSCSI connection to the iSCSI session. 
     624  Attach the iSCSI connection to the iSCSI session.
    625625
    626626  @param[in, out]  Session The iSCSI session.
     
    635635
    636636/**
    637   Detach the iSCSI connection from the session it belongs to. 
     637  Detach the iSCSI connection from the session it belongs to.
    638638
    639639  @param[in, out]  Conn The iSCSI connection.
     
    653653  @retval EFI_SUCCESS        The iSCSI connection is logged into the iSCSI target.
    654654  @retval EFI_TIMEOUT        Timeout occurred during the login procedure.
    655   @retval Others             Other errors as indicated. 
     655  @retval Others             Other errors as indicated.
    656656
    657657**/
     
    738738
    739739  @param[in]  Conn             The connection in the iSCSI login phase.
    740  
     740
    741741  @retval EFI_SUCCESS          The iSCSI login response PDU is received and processed.
    742742  @retval Others               Other errors as indicated.
     
    810810                               TargetAddress key-value list.
    811811  @param[in]      Len          Length of the data.
    812  
     812
    813813  @retval EFI_SUCCESS          The target address is updated.
    814814  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
     
    978978  @param[in, out]  Packet    The request packet containing IO request, SCSI command
    979979                             buffer and buffers to read/write.
    980                              
    981   @retval EFI_SUCCES           The SCSI command is executed and the result is updated to 
     980
     981  @retval EFI_SUCCES           The SCSI command is executed and the result is updated to
    982982                               the Packet.
    983983  @retval EFI_DEVICE_ERROR     Session state was not as required.
     
    10211021  IN BOOLEAN            Recovery
    10221022  );
    1023  
     1023
    10241024/**
    10251025  Abort the iSCSI session, that is, reset all the connection and free the
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Include/Guid/IScsiConfigHii.h

    r48674 r58466  
    11/** @file
    2   GUIDs used as HII FormSet and HII Package list GUID in IScsiConfig driver 
    3   that supports IP4 and IP6 both. 
    4  
     2  GUIDs used as HII FormSet and HII Package list GUID in IScsiConfig driver
     3  that supports IP4 and IP6 both.
     4
    55Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
    6 This program and the accompanying materials are licensed and made available under 
    7 the terms and conditions of the BSD License that accompanies this distribution. 
     6This program and the accompanying materials are licensed and made available under
     7the terms and conditions of the BSD License that accompanies this distribution.
    88The full text of the license may be found at
    9 http://opensource.org/licenses/bsd-license.php.                                           
     9http://opensource.org/licenses/bsd-license.php.
    1010
    11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
     11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1212WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1313
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Include/Guid/Ip6ConfigHii.h

    r48674 r58466  
    11/** @file
    2   GUIDs used as HII FormSet and HII Package list GUID in Ip6Config driver. 
    3  
     2  GUIDs used as HII FormSet and HII Package list GUID in Ip6Config driver.
     3
    44Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials are licensed and made available under 
    6 the terms and conditions of the BSD License that accompanies this distribution. 
     5This program and the accompanying materials are licensed and made available under
     6the terms and conditions of the BSD License that accompanies this distribution.
    77The full text of the license may be found at
    8 http://opensource.org/licenses/bsd-license.php.                                           
     8http://opensource.org/licenses/bsd-license.php.
    99
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1111WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe/ComponentName.c

    r58459 r58466  
    239239  @param  Ip6[in]                   A pointer to the EFI_IP6_PROTOCOL.
    240240
    241  
     241
    242242  @retval EFI_SUCCESS               Update the ControllerNameTable of this instance successfully.
    243243  @retval EFI_INVALID_PARAMETER     The input parameter is invalid.
    244  
     244
    245245**/
    246246EFI_STATUS
     
    295295      gIp6ControllerNameTable = NULL;
    296296  }
    297  
     297
    298298  Status = AddUnicodeString2 (
    299299             "eng",
     
    306306    return Status;
    307307  }
    308  
     308
    309309  return AddUnicodeString2 (
    310310           "en",
     
    396396  EFI_STATUS                    Status;
    397397  EFI_IP6_PROTOCOL              *Ip6;
    398  
     398
    399399  //
    400400  // Only provide names for child handles.
     
    405405
    406406  //
    407   // Make sure this driver produced ChildHandle 
     407  // Make sure this driver produced ChildHandle
    408408  //
    409409  Status = EfiTestChildHandle (
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe/Ip6Common.c

    r58459 r58466  
    331331/**
    332332  Callback function which provided by user to remove one node in NetDestroyLinkList process.
    333  
     333
    334334  @param[in]    Entry           The entry to be removed.
    335335  @param[in]    Context         Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
     
    349349  EFI_SERVICE_BINDING_PROTOCOL  *ServiceBinding;
    350350  EFI_IPv6_ADDRESS              *Address;
    351  
     351
    352352  Instance = NET_LIST_USER_STRUCT_S (Entry, IP6_PROTOCOL, Link, IP6_PROTOCOL_SIGNATURE);
    353353  ServiceBinding = ((IP6_DESTROY_CHILD_BY_ADDR_CALLBACK_CONTEXT*) Context)->ServiceBinding;
     
    357357    return ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);
    358358  }
    359  
     359
    360360  return EFI_SUCCESS;
    361361}
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe/Ip6Config.vfr

    • Property svn:eol-style set to native
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.h

    r58459 r58466  
    7373  @retval EFI_SUCCESS          The specified configuration data for the EFI IPv6
    7474                               network stack was set successfully.
    75  
     75
    7676**/
    7777typedef
     
    9090                           bytes, the size of buffer required to store the specified
    9191                           configuration data.
    92   @param[in]      Data     The data buffer in which the configuration data is returned. 
     92  @param[in]      Data     The data buffer in which the configuration data is returned.
    9393                           Ignored if DataSize is ZERO.
    9494
    9595  @retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified
    96                                configuration data, and the required size is 
     96                               configuration data, and the required size is
    9797                               returned in DataSize.
    98   @retval EFI_SUCCESS          The specified configuration data was obtained successfully.                               
    99  
     98  @retval EFI_SUCCESS          The specified configuration data was obtained successfully.
     99
    100100**/
    101101typedef
     
    165165
    166166typedef struct {
    167   EFI_IP6_CONFIG_POLICY                    Policy;              ///< manual or automatic 
     167  EFI_IP6_CONFIG_POLICY                    Policy;              ///< manual or automatic
    168168  EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS DadTransmitCount;    ///< dad transmits count
    169   EFI_IP6_CONFIG_INTERFACE_ID              InterfaceId;         ///< alternative interface id 
     169  EFI_IP6_CONFIG_INTERFACE_ID              InterfaceId;         ///< alternative interface id
    170170  LIST_ENTRY                               ManualAddress;       ///< IP addresses
    171171  UINT32                                   ManualAddressCount;  ///< IP addresses count
     
    219219  The event process routine when the DHCPv6 server is answered with a reply packet
    220220  for an information request.
    221  
     221
    222222  @param[in]     This          Points to the EFI_DHCP6_PROTOCOL.
    223223  @param[in]     Context       The pointer to the IP6 configuration instance data.
     
    225225
    226226  @retval EFI_SUCCESS      The DNS server address was retrieved from the reply packet.
    227   @retval EFI_NOT_READY    The reply packet does not contain the DNS server option, or 
     227  @retval EFI_NOT_READY    The reply packet does not contain the DNS server option, or
    228228                           the DNS server address is not valid.
    229229
     
    239239/**
    240240  The work function to trigger the DHCPv6 process to perform a stateful autoconfiguration.
    241  
     241
    242242  @param[in]     Instance      Pointer to the IP6 config instance data.
    243243  @param[in]     OtherInfoOnly If FALSE, get stateful address and other information
     
    258258
    259259  @param[out]    Instance       The buffer of IP6_CONFIG_INSTANCE to be initialized.
    260  
     260
    261261  @retval EFI_OUT_OF_RESOURCES  Failed to allocate resources to complete the operation.
    262262  @retval EFI_SUCCESS           The IP6_CONFIG_INSTANCE initialized successfully.
    263  
     263
    264264**/
    265265EFI_STATUS
     
    272272
    273273  @param[in, out] Instance    The buffer of IP6_CONFIG_INSTANCE to be freed.
    274  
     274
    275275**/
    276276VOID
     
    286286  @retval EFI_SUCCESS         The child was successfully destroyed.
    287287  @retval Others              Failed to destroy the child.
    288  
     288
    289289**/
    290290EFI_STATUS
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c

    r58459 r58466  
    995995/**
    996996  Convert IFR data into IP6 configuration data. The policy, alternative interface
    997   ID, and DAD transmit counts, and will be saved. 
     997  ID, and DAD transmit counts, and will be saved.
    998998
    999999  @param[in]       IfrNvData       The IFR NV data.
     
    15421542  CHAR16                        PortString[ADDRESS_STR_MAX_SIZE];
    15431543  EFI_IP6_CONFIG_INTERFACE_INFO *IfInfo;
    1544  
     1544
    15451545
    15461546  Ip6Config = &Instance->Ip6Config;
     
    17951795      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
    17961796      break;
    1797    
     1797
    17981798    case KEY_INTERFACE_ID:
    17991799      Status = Ip6ParseInterfaceIdFromString (IfrNvData->InterfaceId, &Ip6NvData->InterfaceId);
     
    18061806          );
    18071807      }
    1808    
     1808
    18091809      break;
    1810    
     1810
    18111811    case KEY_MANUAL_ADDRESS:
    18121812      Status = Ip6ParseAddressListFromString (
     
    18231823          );
    18241824      }
    1825    
     1825
    18261826      break;
    1827    
     1827
    18281828    case KEY_GATEWAY_ADDRESS:
    18291829      Status = Ip6ParseAddressListFromString (
     
    18401840          );
    18411841      }
    1842    
     1842
    18431843      break;
    1844    
     1844
    18451845    case KEY_DNS_ADDRESS:
    18461846      Status = Ip6ParseAddressListFromString (
     
    18571857          );
    18581858      }
    1859    
     1859
    18601860      break;
    18611861
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe/Ip6Driver.c

    r58459 r58466  
    124124    if (EFI_ERROR (Status)) {
    125125      return Status;
    126     } 
     126    }
    127127  }
    128128
     
    567567    if (EFI_ERROR (Status)) {
    568568      goto ON_ERROR;
    569     }   
     569    }
    570570
    571571    //
     
    585585/**
    586586  Callback function which provided by user to remove one node in NetDestroyLinkList process.
    587  
     587
    588588  @param[in]    Entry           The entry to be removed.
    589589  @param[in]    Context         Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
     
    718718    Status = EFI_SUCCESS;
    719719  }
    720  
     720
    721721Exit:
    722722  return Status;
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe/Ip6Dxe.inf

    r58459 r58466  
    11## @file
    22#  Basic IPv6 packet I/O Service.
    3 #   
    4 #  This module provides basic network IPv6 packet I/O services which includes support for 
    5 #  Neighbor Discovery Protocol (ND), Multicast Listener Discovery Protocol (MLD), 
    6 #  and a subset of the Internet Control Message Protocol (ICMPv6). This driver 
     3#
     4#  This module provides basic network IPv6 packet I/O services which includes support for
     5#  Neighbor Discovery Protocol (ND), Multicast Listener Discovery Protocol (MLD),
     6#  and a subset of the Internet Control Message Protocol (ICMPv6). This driver
    77#  also provides the mechanism to set and get various types of configurations for
    88#  the EFI IPv6 network stack.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe/Ip6DxeStrings.uni

    • Property svn:mime-type changed from application/octet-stream to text/plain;encoding=UTF-16LE
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe/Ip6If.c

    r58459 r58466  
    566566  EFI_STATUS                Status;
    567567  IP6_LINK_RX_TOKEN         *Token;
    568  
     568
    569569  NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
    570570
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe/Ip6Input.c

    r58459 r58466  
    652652      sizeof (IP6_CLIP_INFO)
    653653      );
    654    
     654
    655655    NetIpSecNetbufFree(Packet);
    656656    *Netbuf = TxWrap->Packet;
     
    729729  @param[in]      Flag          The link layer flag for the packet received, such
    730730                                as multicast.
    731   @param[out]     Payload       The pointer to the payload of the recieved packet. 
    732                                 it starts from the first byte of the extension header.                                 
     731  @param[out]     Payload       The pointer to the payload of the recieved packet.
     732                                it starts from the first byte of the extension header.
    733733  @param[out]     LastHead      The pointer of NextHeader of the last extension
    734734                                header processed by IP6.
    735735  @param[out]     ExtHdrsLen    The length of the whole option.
    736736  @param[out]     UnFragmentLen The length of unfragmented length of extension headers.
    737   @param[out]     Fragmented    Indicate whether the packet is fragmented. 
     737  @param[out]     Fragmented    Indicate whether the packet is fragmented.
    738738  @param[out]     Head          The pointer to the EFI_IP6_Header.
    739739
     
    751751     OUT UINT32          *ExtHdrsLen,
    752752     OUT UINT32          *UnFragmentLen,
    753      OUT BOOLEAN         *Fragmented, 
     753     OUT BOOLEAN         *Fragmented,
    754754     OUT EFI_IP6_HEADER  **Head
    755755  )
     
    969969  //
    970970  NetbufTrim (*Packet, sizeof (EFI_IP6_HEADER) + *ExtHdrsLen, TRUE);
    971  
     971
    972972  return EFI_SUCCESS;
    973973}
     
    10141014    goto Drop;
    10151015  }
    1016  
     1016
    10171017  //
    10181018  // Pre-Process the Ipv6 Packet and then reassemble if it is necessary.
    10191019  //
    10201020  Status = Ip6PreProcessPacket (
    1021              IpSb, 
    1022              &Packet, 
    1023              Flag, 
    1024              &Payload, 
    1025              &LastHead, 
    1026              &ExtHdrsLen, 
    1027              &UnFragmentLen, 
     1021             IpSb,
     1022             &Packet,
     1023             Flag,
     1024             &Payload,
     1025             &LastHead,
     1026             &ExtHdrsLen,
     1027             &UnFragmentLen,
    10281028             &Fragmented,
    10291029             &Head
     
    10571057  if (0 == CompareMem (Head, &ZeroHead, sizeof (EFI_IP6_HEADER))) {
    10581058    Status = Ip6PreProcessPacket (
    1059                IpSb, 
    1060                &Packet, 
    1061                Flag, 
    1062                &Payload, 
    1063                &LastHead, 
    1064                &ExtHdrsLen, 
    1065                &UnFragmentLen, 
    1066                &Fragmented, 
     1059               IpSb,
     1060               &Packet,
     1061               Flag,
     1062               &Payload,
     1063               &LastHead,
     1064               &ExtHdrsLen,
     1065               &UnFragmentLen,
     1066               &Fragmented,
    10671067               &Head
    10681068               );
     
    10781078    goto Restart;
    10791079  }
    1080  
     1080
    10811081  //
    10821082  // Packet may have been changed. The ownership of the packet
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Ip6Dxe/Ip6Nd.c

    r58459 r58466  
    823823  EFI_DHCP6_RETRANSMISSION  InfoReqReXmit;
    824824  EFI_IPv6_ADDRESS          AllNodes;
    825  
     825
    826826  IpSb     = IpIf->Service;
    827827  AddrInfo = DadEntry->AddressInfo;
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/ComponentName.c

    r58459 r58466  
    326326    return EFI_UNSUPPORTED;
    327327  }
    328  
     328
    329329  //
    330330  // Make sure this driver is currently managing ControllerHandle
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IetfConstants.c

    r48674 r58466  
    11/** @file
    22  Cryptographic Parameter Constant Definitions from IETF;
    3  
     3
    44  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
    55
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/Ike.h

    r48674 r58466  
    5656#define IPSEC_ESP_3IDEA               8
    5757#define IPSEC_ESP_DES_IV32            9
    58 #define IPSEC_ESP_RC4                 10  // It's reserved in IKEv2 
     58#define IPSEC_ESP_RC4                 10  // It's reserved in IKEv2
    5959#define IPSEC_ESP_NULL                11
    6060#define IPSEC_ESP_AES                 12
     
    151151  UINT16  AttrLength;
    152152  UINT16  AttrValue;
    153 } IKE_SA_ATTR_UNION; 
     153} IKE_SA_ATTR_UNION;
    154154
    155155//
     
    164164
    165165//
    166 // Contains the IKE packet information. 
     166// Contains the IKE packet information.
    167167//
    168168typedef struct {
     
    220220// Each algorithm has its own Id, Guid, BlockSize and KeyLength.
    221221// This struct contains these information for each algorithm. It is generic structure
    222 // for both encryption and authentication algorithm. 
     222// for both encryption and authentication algorithm.
    223223// For authentication algorithm, the AlgSize means IcvSize. For encryption algorithm,
    224224// it means IvSize.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IkeCommon.c

    r58459 r58466  
    11/** @file
    22  Common operation of the IKE
    3  
     3
    44  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
    55
     
    2727/**
    2828  Call Crypto Lib to generate a random value with eight-octet length.
    29  
     29
    3030  @return the 64 byte vaule.
    3131
     
    5151
    5252  @param[in]  NonceSize      Size of the data in bytes.
    53  
    54   @return Buffer which contains the random data of the spcified size. 
     53
     54  @return Buffer which contains the random data of the spcified size.
    5555
    5656**/
     
    128128    return NULL;
    129129  }
    130  
     130
    131131  IkePayload->Signature = IKE_PAYLOAD_SIGNATURE;
    132132
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IkeCommon.h

    r48674 r58466  
    2020#include <Protocol/Udp6.h>
    2121#include <Protocol/Ip4Config.h>
    22  
     22
    2323#include <Library/BaseLib.h>
    2424#include <Library/BaseMemoryLib.h>
     
    6363/**
    6464  Call Crypto Lib to generate a random value with eight-octet length.
    65  
     65
    6666  @return the 64 byte vaule.
    6767
     
    7676
    7777  @param[in]  NonceSize      Size of the data in bytes.
    78  
    79   @return Buffer which contains the random data of the spcified size. 
     78
     79  @return Buffer which contains the random data of the spcified size.
    8080
    8181**/
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IkePacket.c

    r48674 r58466  
    3737  IkePacket->RefCount = 1;
    3838  InitializeListHead (&IkePacket->PayloadList);
    39  
     39
    4040  IkePacket->Header = (IKE_HEADER *) AllocateZeroPool (sizeof (IKE_HEADER));
    4141  if (IkePacket->Header == NULL) {
     
    9595/**
    9696  Callback funtion of NetbufFromExt()
    97  
    98   @param[in]  Arg  The data passed from the NetBufFromExe(). 
     97
     98  @param[in]  Arg  The data passed from the NetBufFromExe().
    9999
    100100**/
     
    112112/**
    113113  Copy the NetBuf into a IKE_PACKET sturcture.
    114  
    115   Create a IKE_PACKET and fill the received IKE header into the header of IKE_PACKET 
     114
     115  Create a IKE_PACKET and fill the received IKE header into the header of IKE_PACKET
    116116  and copy the recieved packet without IKE HEADER to the PayloadBuf of IKE_PACKET.
    117117
    118   @param[in]  Netbuf      The pointer of the Netbuf which contains the whole received 
     118  @param[in]  Netbuf      The pointer of the Netbuf which contains the whole received
    119119                          IKE packet.
    120120
     
    175175  @param[in]  SessionCommon  Pointer of related IKE_COMMON_SESSION
    176176  @param[in]  IkePacket      Pointer of IKE_PACKET to be copy to NetBuf
    177   @param[in]  IkeType        The IKE type to pointer the packet is for which IKE 
    178                              phase. Now it supports IKE_SA_TYPE, IKE_CHILDSA_TYPE, 
     177  @param[in]  IkeType        The IKE type to pointer the packet is for which IKE
     178                             phase. Now it supports IKE_SA_TYPE, IKE_CHILDSA_TYPE,
    179179                             IKE_INFO_TYPE.
    180180
    181181  @return a pointer of Netbuff which contains the IKE_PACKE in network order.
    182  
     182
    183183**/
    184184NET_BUF *
     
    218218  //
    219219  NET_LIST_FOR_EACH (PacketEntry, &(IkePacket)->PayloadList) {
    220  
     220
    221221    NumPayloads++;
    222222  }
     
    252252             NULL
    253253             );
    254  
     254
    255255  FreePool (Fragments);
    256256  return Netbuf;
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IkePacket.h

    r48674 r58466  
    1111  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1212  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    13  
     13
    1414**/
    1515
     
    4747/**
    4848  Copy the NetBuf into a IKE_PACKET sturcture.
    49  
    50   Create a IKE_PACKET and fill the received IKE header into the header of IKE_PACKET 
     49
     50  Create a IKE_PACKET and fill the received IKE header into the header of IKE_PACKET
    5151  and copy the recieved packet without IKE HEADER to the PayloadBuf of IKE_PACKET.
    5252
    53   @param[in]  Netbuf      The pointer of the Netbuf which contains the whole received 
     53  @param[in]  Netbuf      The pointer of the Netbuf which contains the whole received
    5454                          IKE packet.
    5555
     
    6767  @param[in]  SessionCommon  Pointer of related IKE_COMMON_SESSION
    6868  @param[in]  IkePacket      Pointer of IKE_PACKET to be copy to NetBuf
    69   @param[in]  IkeType        The IKE type to pointer the packet is for which IKE 
    70                              phase. Now it supports IKE_SA_TYPE, IKE_CHILDSA_TYPE, 
     69  @param[in]  IkeType        The IKE type to pointer the packet is for which IKE
     70                             phase. Now it supports IKE_SA_TYPE, IKE_CHILDSA_TYPE,
    7171                             IKE_INFO_TYPE.
    7272
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/Ikev2/ChildSa.c

    r48674 r58466  
    1717
    1818/**
    19   Generate IKE Packet for CREATE_CHILD_SA exchange. 
     19  Generate IKE Packet for CREATE_CHILD_SA exchange.
    2020
    2121  This IKE Packet would be the packet for creating new CHILD SA, or the packet for
    2222  rekeying existing IKE SA, or the packet for existing CHILD SA.
    23  
    24   @param[in] SaSession   Pointer to related SA session. 
     23
     24  @param[in] SaSession   Pointer to related SA session.
    2525  @param[in] Context     The data passed by the caller.
    2626
     
    4040  IKE_PAYLOAD             *NotifyPayload;
    4141  UINT32                  *MessageId;
    42  
     42
    4343  ChildSaSession  = (IKEV2_CHILD_SA_SESSION *) SaSession;
    4444  IkePacket       = IkePacketAlloc();
     
    5555    MessageId = (UINT32 *) Context;
    5656  }
    57  
     57
    5858  IkePacket->Header->Version      = (UINT8) (2 << 4);
    5959  IkePacket->Header->NextPayload  = IKEV2_PAYLOAD_TYPE_NOTIFY;
    6060  IkePacket->Header->ExchangeType = IKE_XCG_TYPE_CREATE_CHILD_SA;
    61  
     61
    6262  if (ChildSaSession->SessionCommon.IkeSessionType == IkeSessionTypeChildSa) {
    6363    //
    6464    // 1.a Fill the IkePacket->Hdr
    65     //   
     65    //
    6666    IkePacket->Header->InitiatorCookie = ChildSaSession->IkeSaSession->InitiatorCookie;
    6767    IkePacket->Header->ResponderCookie = ChildSaSession->IkeSaSession->ResponderCookie;
    68    
     68
    6969    if (MessageId != NULL) {
    7070      IkePacket->Header->MessageId     = *MessageId;
    7171    } else {
    7272      IkePacket->Header->MessageId     = ChildSaSession->MessageId;
    73     }   
    74    
     73    }
     74
    7575    if (ChildSaSession->SessionCommon.IsInitiator) {
    7676      IkePacket->Header->Flags = IKE_HEADER_FLAGS_CHILD_INIT;
     
    7878      IkePacket->Header->Flags = IKE_HEADER_FLAGS_RESPOND;
    7979    }
    80      
     80
    8181  } else {
    8282    IkeSaSession  = (IKEV2_SA_SESSION *) SaSession;
     
    9191    } else {
    9292      IkePacket->Header->MessageId     = IkeSaSession->MessageId;
    93     }   
    94    
     93    }
     94
    9595    if (IkeSaSession->SessionCommon.IsInitiator) {
    9696      IkePacket->Header->Flags = IKE_HEADER_FLAGS_CHILD_INIT;
     
    9898      IkePacket->Header->Flags = IKE_HEADER_FLAGS_RESPOND;
    9999    }
    100   } 
    101    
     100  }
     101
    102102  //
    103103  // According to RFC4306, Chapter 4.
     
    108108                    0,
    109109                    IKEV2_PAYLOAD_TYPE_NONE,
    110                     0,                 
     110                    0,
    111111                    IKEV2_NOTIFICATION_NO_ADDITIONAL_SAS,
    112112                    NULL,
     
    114114                    0
    115115                    );
    116                        
     116
    117117  IKE_PACKET_APPEND_PAYLOAD (IkePacket, NotifyPayload);
    118118  //
    119   // TODO: Support the CREATE_CHILD_SA exchange. 
    120   // 
     119  // TODO: Support the CREATE_CHILD_SA exchange.
     120  //
    121121  return IkePacket;
    122122}
     
    124124/**
    125125  Parse the IKE packet of CREATE_CHILD_SA exchange.
    126  
     126
    127127  This function parse the IKE packet and save the related information to further
    128   calculation. 
    129  
     128  calculation.
     129
    130130  @param[in] SaSession   Pointer to IKEv2_CHILD_SA_SESSION related to this Exchange.
    131131  @param[in] IkePacket   Received packet to be parsed.
    132  
     132
    133133
    134134  @retval EFI_SUCCESS       The IKE Packet is acceptable.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/Ikev2/Ikev2.h

    r48674 r58466  
    232232} PRF_DATA_FRAGMENT;
    233233
    234 typedef 
     234typedef
    235235IKE_PACKET *
    236236(*IKEV2_PACKET_GENERATOR) (
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/Ikev2/Info.c

    r48674 r58466  
    1111  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1212  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    13  
     13
    1414**/
    1515
     
    2121  Generate Information Packet.
    2222
    23   The information Packet may contain one Delete Payload, or Notify Payload, which 
     23  The information Packet may contain one Delete Payload, or Notify Payload, which
    2424  dependes on the Context's parameters.
    2525
    26   @param[in]  SaSession   Pointer to IKE SA Session or Child SA Session which is 
     26  @param[in]  SaSession   Pointer to IKE SA Session or Child SA Session which is
    2727                          related to the information Exchange.
    2828  @param[in]  Context     The Data passed from the caller. If the Context is not NULL
    2929                          it should contain the information for Notification Data.
    30                          
     30
    3131  @retval     Pointer of IKE_PACKET generated.
    3232
     
    5353  //
    5454  IkePacket->Header->ExchangeType    = IKEV2_EXCHANGE_TYPE_INFO;
    55   IkePacket->Header->Version         = (UINT8) (2 << 4); 
     55  IkePacket->Header->Version         = (UINT8) (2 << 4);
    5656
    5757  if (Context != NULL) {
     
    6262  // For Liveness Check
    6363  //
    64   if (InfoContext != NULL && 
    65       (InfoContext->InfoType == Ikev2InfoLiveCheck || InfoContext->InfoType == Ikev2InfoNotify) 
     64  if (InfoContext != NULL &&
     65      (InfoContext->InfoType == Ikev2InfoLiveCheck || InfoContext->InfoType == Ikev2InfoNotify)
    6666    ) {
    6767    IkePacket->Header->MessageId       = InfoContext->MessageId;
     
    7575    return IkePacket;
    7676  }
    77  
     77
    7878  //
    7979  // For delete SAs
    80   // 
     80  //
    8181  if (IkeSaSession->SessionCommon.IkeSessionType == IkeSessionTypeIkeSa) {
    8282
     
    9999    if (IkeSaSession->SessionCommon.State == IkeStateSaDeleting ) {
    100100      IkePayload = Ikev2GenerateDeletePayload (
    101                      IkeSaSession, 
    102                      IKEV2_PAYLOAD_TYPE_NONE, 
    103                      0, 
    104                      0, 
     101                     IkeSaSession,
     102                     IKEV2_PAYLOAD_TYPE_NONE,
     103                     0,
     104                     0,
    105105                     NULL
    106                      ); 
     106                     );
    107107      if (IkePayload == NULL) {
    108108        goto ERROR_EXIT;
     
    116116      IkePacket->Spi               = 0;
    117117      IkePacket->IsDeleteInfo      = TRUE;
    118            
     118
    119119    } else if (Context != NULL) {
    120120      //
     
    126126      //
    127127      goto ERROR_EXIT;
    128     } 
     128    }
    129129  } else {
    130130    //
     
    146146      Ikev2SaSessionIncreaseMessageId (IkeSaSession);
    147147    }
    148    
     148
    149149    IkePayload     = Ikev2GenerateDeletePayload (
    150150                       ChildSaSession->IkeSaSession,
     
    225225  EFI_STATUS             Status;
    226226  IKE_PACKET             *RespondPacket;
    227  
     227
    228228  IKEV2_INFO_EXCHANGE_CONTEXT Context;
    229  
     229
    230230  IkeSaSession   = (IKEV2_SA_SESSION *) SaSession;
    231231
     
    235235  RespondPacket  = NULL;
    236236  Status         = EFI_SUCCESS;
    237  
     237
    238238  //
    239239  // For Liveness Check
     
    272272  // For SA Delete
    273273  //
    274   NET_LIST_FOR_EACH (Entry, &(IkePacket)->PayloadList) {   
     274  NET_LIST_FOR_EACH (Entry, &(IkePacket)->PayloadList) {
    275275
    276276  //
     
    278278  //
    279279    IkePayload  = IKE_PAYLOAD_BY_PACKET (Entry);
    280    
     280
    281281    if (IkePayload->PayloadType == IKEV2_PAYLOAD_TYPE_DELETE) {
    282282      DeletePayload = IkePayload;
     
    303303            // IPsec status variable.
    304304            //
    305             if (IsListEmpty (&Private->Ikev1EstablishedList) && 
     305            if (IsListEmpty (&Private->Ikev1EstablishedList) &&
    306306                (IsListEmpty (&Private->Ikev2EstablishedList))
    307307               ) {
     
    334334          }
    335335          Status = Ikev2SendIkePacket (
    336                      IkeSaSession->SessionCommon.UdpService, 
    337                      (UINT8 *)(&IkeSaSession->SessionCommon), 
    338                      RespondPacket, 
     336                     IkeSaSession->SessionCommon.UdpService,
     337                     (UINT8 *)(&IkeSaSession->SessionCommon),
     338                     RespondPacket,
    339339                     0
    340340                     );
     
    366366                Context.InfoType = Ikev2InfoDelete;
    367367                Context.MessageId = IkePacket->Header->MessageId;
    368          
     368
    369369                RespondPacket = Ikev2InfoGenerator ((UINT8 *)ChildSaSession, &Context);
    370370                if (RespondPacket == NULL) {
     
    375375                           ChildSaSession->SessionCommon.UdpService,
    376376                           (UINT8 *)(&ChildSaSession->SessionCommon),
    377                            RespondPacket, 
     377                           RespondPacket,
    378378                           0
    379379                           );
     
    392392    }
    393393  }
    394  
     394
    395395  return Status;
    396396}
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/Ikev2/Payload.h

    r48674 r58466  
    6363typedef struct {
    6464  IKEV2_COMMON_PAYLOAD_HEADER Header;
    65   // 
     65  //
    6666  // Proposals
    6767  //
     
    9090//
    9191// IKEv2 Transform ID for Encrypt Algorithm (ENCR)
    92 // 
     92//
    9393#define IKEV2_TRANSFORM_ID_ENCR_DES_IV64 1
    9494#define IKEV2_TRANSFORM_ID_ENCR_DES      2
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/Ikev2/Sa.c

    r48674 r58466  
    2323
    2424  This generates the DH local public key and store it in the IKEv2 SA Session's GxBuffer.
    25  
     25
    2626  @param[in]  IkeSaSession   Pointer to related IKE SA Session.
    2727
     
    153153  //    No need to recompute the Public key.
    154154  //
    155   if ((IkeSaSession->SessionCommon.IsInitiator) && (IkeSaSession->NCookie == NULL)) {   
     155  if ((IkeSaSession->SessionCommon.IsInitiator) && (IkeSaSession->NCookie == NULL)) {
    156156    Status = Ikev2GenerateSaDhPublicKey (IkeSaSession);
    157157    if (EFI_ERROR (Status)) {
     
    164164  //
    165165  KePayload = Ikev2GenerateKePayload (
    166                 IkeSaSession, 
     166                IkeSaSession,
    167167                IKEV2_PAYLOAD_TYPE_NONCE
    168168                );
     
    219219    IkePayloadFree (SaPayload);
    220220  }
    221   return NULL;   
     221  return NULL;
    222222}
    223223
     
    237237  IN UINT8            *SaSession,
    238238  IN IKE_PACKET       *IkePacket
    239   ) 
     239  )
    240240{
    241241  IKEV2_SA_SESSION     *IkeSaSession;
     
    403403    FreePool (NonceBuffer);
    404404  }
    405  
     405
    406406  return Status;
    407407}
     
    432432  IKE_PAYLOAD            *CpPayload;
    433433  IKEV2_CHILD_SA_SESSION *ChildSaSession;
    434  
     434
    435435
    436436  IkeSaSession   = (IKEV2_SA_SESSION *) SaSession;
     
    439439  CpPayload      = NULL;
    440440  NotifyPayload  = NULL;
    441  
     441
    442442  //
    443443  // 1. Allocate IKE Packet
     
    460460
    461461  //
    462   // According to RFC4306_2.2, For the IKE_SA_INIT message the MessageID should 
     462  // According to RFC4306_2.2, For the IKE_SA_INIT message the MessageID should
    463463  // be always number 0 and 1;
    464464  //
     
    589589  @param[in]  IkePacket   Pointer to the IKE_AUTH packet to be parsered.
    590590
    591   @retval     EFI_INVALID_PARAMETER   The IKE packet is malformed or the SA 
     591  @retval     EFI_INVALID_PARAMETER   The IKE packet is malformed or the SA
    592592                                      proposal is unacceptable.
    593593  @retval     EFI_SUCCESS             The IKE packet is acceptable and the
     
    595595
    596596**/
    597 EFI_STATUS 
     597EFI_STATUS
    598598Ikev2AuthPskParser (
    599599  IN UINT8             *SaSession,
     
    661661  //
    662662  if (IkeSaSession->SessionCommon.IsInitiator) {
    663    
     663
    664664    //
    665665    // 1. Check the IkePacket->Hdr == IKE_HEADER_FLAGS_RESPOND
     
    755755        ) {
    756756      return EFI_INVALID_PARAMETER;
    757     } 
     757    }
    758758    if ((((TRAFFIC_SELECTOR *)(TsiPayload->PayloadBuf + sizeof (IKEV2_TS)))->StartPort != 0) &&
    759759        (((TRAFFIC_SELECTOR *)(TsiPayload->PayloadBuf + sizeof (IKEV2_TS)))->StartPort != ChildSaSession->LocalPort)
     
    772772      }
    773773      //
    774       // Get the Virtual IP address from the Tsi traffic selector. 
     774      // Get the Virtual IP address from the Tsi traffic selector.
    775775      // TODO: check the CFG reply payload
    776776      //
     
    781781        sizeof (EFI_IPv4_ADDRESS) : sizeof (EFI_IPv6_ADDRESS)
    782782        );
    783       }   
     783      }
    784784  }
    785785
     
    795795    IkeSaSession->SessionCommon.State = IkeStateIkeSaEstablished;
    796796  }
    797  
     797
    798798  return EFI_SUCCESS;
    799799}
     
    813813  IN UINT8           *SaSession,
    814814  IN VOID            *Context
    815   ) 
     815  )
    816816{
    817817  IKE_PACKET         *IkePacket;
     
    865865  @retval EFI_SUCCESS            The IKEv2 packet is acceptable and the relative data is
    866866                                 saved for furthure communication.
    867   @retval EFI_INVALID_PARAMETER  The IKE packet is malformed or the SA proposal is unacceptable.                       
     867  @retval EFI_INVALID_PARAMETER  The IKE packet is malformed or the SA proposal is unacceptable.
    868868  @retval EFI_UNSUPPORTED        The certificate authentication is not supported.
    869869
     
    877877  if (!FeaturePcdGet (PcdIpsecCertificateEnabled)) {
    878878    return EFI_UNSUPPORTED;
    879   } 
    880  
     879  }
     880
    881881  //
    882882  // The first two messages exchange is same between PSK and Cert.
    883   // Todo: Parse Certificate Request from responder Initial Exchange. 
     883  // Todo: Parse Certificate Request from responder Initial Exchange.
    884884  //
    885885  return Ikev2InitPskParser (SaSession, IkePacket);
     
    10571057
    10581058    //
    1059     // Generate Notify Payload. If transport mode, there should have Notify 
     1059    // Generate Notify Payload. If transport mode, there should have Notify
    10601060    // payload with TRANSPORT_MODE notification.
    10611061    //
     
    11891189  }
    11901190
    1191   if ((SaPayload == NULL) || (AuthPayload == NULL) || (TsiPayload == NULL) || 
     1191  if ((SaPayload == NULL) || (AuthPayload == NULL) || (TsiPayload == NULL) ||
    11921192      (TsrPayload == NULL) || (CertPayload == NULL)) {
    11931193    goto Exit;
     
    12011201  //
    12021202  if (IkeSaSession->SessionCommon.IsInitiator) {
    1203    
     1203
    12041204    //
    12051205    // 1. Check the IkePacket->Hdr == IKE_HEADER_FLAGS_RESPOND
     
    12951295        ) {
    12961296      goto Exit;
    1297     } 
     1297    }
    12981298    if ((((TRAFFIC_SELECTOR *)(TsiPayload->PayloadBuf + sizeof (IKEV2_TS)))->StartPort != 0) &&
    12991299        (((TRAFFIC_SELECTOR *)(TsiPayload->PayloadBuf + sizeof (IKEV2_TS)))->StartPort != ChildSaSession->LocalPort)
     
    13121312      }
    13131313      //
    1314       // Get the Virtual IP address from the Tsi traffic selector. 
     1314      // Get the Virtual IP address from the Tsi traffic selector.
    13151315      // TODO: check the CFG reply payload
    13161316      //
     
    13231323    }
    13241324  }
    1325  
     1325
    13261326  //
    13271327  // 5. Generat keymats for IPsec protocol.
     
    14061406  @param[in]  DhBuffer       Pointer to buffer of peer's puliic key.
    14071407  @param[in]  KePayload      Pointer to received key payload.
    1408  
     1408
    14091409  @retval EFI_SUCCESS        The operation succeeded.
    14101410  @retval Otherwise          The operation failed.
     
    15181518  // If one or more algorithm is not support, return EFI_UNSUPPORTED.
    15191519  //
    1520   if (AuthAlgKeyLen == 0 || 
     1520  if (AuthAlgKeyLen == 0 ||
    15211521      EncryptAlgKeyLen == 0 ||
    15221522      IntegrityAlgKeyLen == 0 ||
     
    15771577  IPSEC_DUMP_BUF (">>> InitiatorCookie", (UINT8 *)&IkeSaSession->InitiatorCookie, sizeof(UINT64));
    15781578  IPSEC_DUMP_BUF (">>> ResponderCookie", (UINT8 *)&IkeSaSession->ResponderCookie, sizeof(UINT64));
    1579  
    1580   OutputKeyLength = PrfAlgKeyLen + 
     1579
     1580  OutputKeyLength = PrfAlgKeyLen +
    15811581                    2 * EncryptAlgKeyLen +
    15821582                    2 * AuthAlgKeyLen +
     
    16281628  IkeSaSession->IkeKeys->SkAiKeySize = IntegrityAlgKeyLen;
    16291629  CopyMem (IkeSaSession->IkeKeys->SkAiKey, OutputKey + PrfAlgKeyLen, IntegrityAlgKeyLen);
    1630  
     1630
    16311631  IPSEC_DUMP_BUF (">>> SK_Ai Key", IkeSaSession->IkeKeys->SkAiKey, IkeSaSession->IkeKeys->SkAiKeySize);
    16321632
     
    16451645    IntegrityAlgKeyLen
    16461646    );
    1647  
     1647
    16481648  IPSEC_DUMP_BUF (">>> SK_Ar Key", IkeSaSession->IkeKeys->SkArKey, IkeSaSession->IkeKeys->SkArKeySize);
    16491649
     
    16571657  }
    16581658  IkeSaSession->IkeKeys->SkEiKeySize = EncryptAlgKeyLen;
    1659  
     1659
    16601660  CopyMem (
    16611661    IkeSaSession->IkeKeys->SkEiKey,
     
    16641664    );
    16651665  IPSEC_DUMP_BUF (
    1666     ">>> SK_Ei Key", 
     1666    ">>> SK_Ei Key",
    16671667    OutputKey + AuthAlgKeyLen + 2 * IntegrityAlgKeyLen,
    16681668    EncryptAlgKeyLen
     
    17251725    OutputKey + AuthAlgKeyLen + 2 * IntegrityAlgKeyLen + 2 * EncryptAlgKeyLen + AuthAlgKeyLen,
    17261726    AuthAlgKeyLen
    1727     ); 
     1727    );
    17281728  IPSEC_DUMP_BUF (
    17291729    ">>> SK_Pr Key",
     
    17681768  }
    17691769
    1770  
     1770
    17711771  return Status;
    17721772}
     
    17981798  Status = EFI_SUCCESS;
    17991799  OutputKey = NULL;
    1800  
     1800
    18011801  if (KePayload != NULL) {
    18021802    //
    1803     // Generate Gxy 
     1803    // Generate Gxy
    18041804    //
    18051805    Ikev2GenerateSaDhComputeKey (ChildSaSession->DhBuffer, KePayload);
     
    18271827
    18281828  //
    1829   // 
     1829  //
    18301830  // If KePayload is not NULL, calculate KEYMAT = prf+(SK_d, g^ir (new) | Ni | Nr ),
    18311831  // otherwise, KEYMAT = prf+(SK_d, Ni | Nr )
     
    18511851
    18521852  if (EFI_ERROR (Status)) {
    1853     goto Exit; 
    1854   }
    1855  
     1853    goto Exit;
     1854  }
     1855
    18561856  //
    18571857  // Copy KEYMATE (SK_ENCRYPT_i | SK_ENCRYPT_r | SK_INTEG_i | SK_INTEG_r) to
    18581858  // ChildKeyMates.
    1859   // 
     1859  //
    18601860  if (!ChildSaSession->SessionCommon.IsInitiator) {
    18611861
    1862     // 
     1862    //
    18631863    // Initiator Encryption Key
    18641864    //
     
    18861886      Status = EFI_OUT_OF_RESOURCES;
    18871887      goto Exit;
    1888     }   
    1889    
     1888    }
     1889
    18901890    CopyMem (
    18911891      ChildSaSession->ChildKeymats.LocalPeerInfo.EspAlgoInfo.AuthKey,
     
    19031903      Status = EFI_OUT_OF_RESOURCES;
    19041904      goto Exit;
    1905     }   
    1906    
     1905    }
     1906
    19071907    CopyMem (
    19081908      ChildSaSession->ChildKeymats.RemotePeerInfo.EspAlgoInfo.EncKey,
     
    19201920      Status = EFI_OUT_OF_RESOURCES;
    19211921      goto Exit;
    1922     }   
    1923    
     1922    }
     1923
    19241924    CopyMem (
    19251925      ChildSaSession->ChildKeymats.RemotePeerInfo.EspAlgoInfo.AuthKey,
     
    19371937      Status = EFI_OUT_OF_RESOURCES;
    19381938      goto Exit;
    1939     }   
    1940    
     1939    }
     1940
    19411941    CopyMem (
    19421942      ChildSaSession->ChildKeymats.RemotePeerInfo.EspAlgoInfo.EncKey,
     
    19541954      Status = EFI_OUT_OF_RESOURCES;
    19551955      goto Exit;
    1956     }   
    1957    
     1956    }
     1957
    19581958    CopyMem (
    19591959      ChildSaSession->ChildKeymats.RemotePeerInfo.EspAlgoInfo.AuthKey,
     
    19711971      Status = EFI_OUT_OF_RESOURCES;
    19721972      goto Exit;
    1973     } 
    1974    
     1973    }
     1974
    19751975    CopyMem (
    19761976      ChildSaSession->ChildKeymats.LocalPeerInfo.EspAlgoInfo.EncKey,
     
    19881988      Status = EFI_OUT_OF_RESOURCES;
    19891989      goto Exit;
    1990     }   
    1991    
     1990    }
     1991
    19921992    CopyMem (
    19931993      ChildSaSession->ChildKeymats.LocalPeerInfo.EspAlgoInfo.AuthKey,
     
    20392039    FreePool (OutputKey);
    20402040  }
    2041  
     2041
    20422042  return EFI_SUCCESS;
    20432043}
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/Ikev2/Utility.c

    r58459 r58466  
    2121UINT16 mIkev2EncryptAlgorithmList[IKEV2_SUPPORT_ENCRYPT_ALGORITHM_NUM] = {
    2222  IKEV2_TRANSFORM_ID_ENCR_3DES,
    23   IKEV2_TRANSFORM_ID_ENCR_AES_CBC, 
     23  IKEV2_TRANSFORM_ID_ENCR_AES_CBC,
    2424};
    2525
     
    6767  IkeSaSession->ResponderCookie      = 0;
    6868  //
    69   // BUGBUG: Message ID starts from 2 is to match the OpenSwan requirement, but it 
     69  // BUGBUG: Message ID starts from 2 is to match the OpenSwan requirement, but it
    7070  // might not match the IPv6 Logo. In its test specification, it mentions that
    7171  // the Message ID should start from zero after the IKE_SA_INIT exchange.
     
    141141  //
    142142  // Cleanup the fields of SessionCommon for processing.
    143   // 
     143  //
    144144  Ikev2SessionCommonRefresh (SessionCommon);
    145145
     
    161161  if (EFI_ERROR(Status)){
    162162    //
    163     // If TimerEvent creation failed, the SA will be alive untill user disable it or 
    164     // receiving a Delete Payload from peer. 
     163    // If TimerEvent creation failed, the SA will be alive untill user disable it or
     164    // receiving a Delete Payload from peer.
    165165    //
    166166    return;
     
    175175    Lifetime = IkeSaSession->Spd->Data->ProcessingPolicy->SaLifetime.HardLifetime;
    176176  }
    177  
     177
    178178  Status = gBS->SetTimer (
    179179                  SessionCommon->TimeoutEvent,
     
    183183  if (EFI_ERROR(Status)){
    184184    //
    185     // If SetTimer failed, the SA will be alive untill user disable it or 
    186     // receiving a Delete Payload from peer. 
     185    // If SetTimer failed, the SA will be alive untill user disable it or
     186    // receiving a Delete Payload from peer.
    187187    //
    188188    return ;
     
    237237
    238238  @param[in]  SaSessionList   Pointer to list to be inserted into.
    239   @param[in]  IkeSaSession    Pointer to IKEV2_SA_SESSION to be inserted. 
    240   @param[in]  RemotePeerIp    Pointer to EFI_IP_ADDRESSS to indicate the 
     239  @param[in]  IkeSaSession    Pointer to IKEV2_SA_SESSION to be inserted.
     240  @param[in]  RemotePeerIp    Pointer to EFI_IP_ADDRESSS to indicate the
    241241                              unique IKEV2_SA_SESSION.
    242242
     
    259259  @param[in]  RemotePeerIp    Pointer to EFI_IP_ADDRESS to use for SA Session search.
    260260
    261   @retval Pointer to IKEV2_SA_SESSION with the specified remote IP address or NULL. 
     261  @retval Pointer to IKEV2_SA_SESSION with the specified remote IP address or NULL.
    262262
    263263**/
     
    305305
    306306/**
    307   Free specified Seession Common. The session common would belong to a IKE SA or 
     307  Free specified Seession Common. The session common would belong to a IKE SA or
    308308  a Child SA.
    309309
     
    356356}
    357357/**
    358   Free specified IKEV2 SA Session. 
     358  Free specified IKEV2 SA Session.
    359359
    360360  @param[in]    IkeSaSession   Pointer to IKEV2_SA_SESSION to be freed.
     
    372372
    373373  ASSERT (IkeSaSession != NULL);
    374  
     374
    375375  //
    376376  // Delete Common Session
     
    417417    //
    418418    // Delete Keys
    419     //   
     419    //
    420420    if (IkeKeys->SkAiKey != NULL) {
    421421      FreePool (IkeKeys->SkAiKey);
     
    493493/**
    494494  Allocate memory for IKEV2 Child SA Session.
    495  
     495
    496496  @param[in]   UdpService     Pointer to IKE_UDP_SERVICE.
    497   @param[in]   IkeSaSession   Pointer to IKEV2_SA_SESSION related to this Child SA 
     497  @param[in]   IkeSaSession   Pointer to IKEV2_SA_SESSION related to this Child SA
    498498                              Session.
    499499
     
    555555
    556556/**
    557   Register a established IKEv2 Child SA into IkeSaSession->ChildSaEstablishSessionList. 
    558   If the there is IKEV2_CHILD_SA_SESSION with same remote peer IP, remove the old one 
     557  Register a established IKEv2 Child SA into IkeSaSession->ChildSaEstablishSessionList.
     558  If the there is IKEV2_CHILD_SA_SESSION with same remote peer IP, remove the old one
    559559  then register the new one.
    560560
     
    600600  //
    601601  // Cleanup the fields of SessionCommon for processing.
    602   // 
     602  //
    603603  Ikev2SessionCommonRefresh (SessionCommon);
    604  
     604
    605605  //
    606606  // Insert the ready child SA session into established list.
     
    683683  This functin find a ChildSA session by searching the ChildSaSessionlist of
    684684  the input IKEV2_SA_SESSION by specified MessageID.
    685  
     685
    686686  @param[in]  SaSessionList      Pointer to List to be searched.
    687687  @param[in]  Spi                Specified SPI.
     
    728728/**
    729729  Remove the IKEV2_CHILD_SA_SESSION from IkeSaSessionList.
    730  
     730
    731731  @param[in]  SaSessionList      The SA Session List to be iterated.
    732732  @param[in]  Spi                Spi used to identified the IKEV2_CHILD_SA_SESSION.
    733   @param[in]  ListType           The type of the List to indicate whether it is a 
    734                                  Established. 
     733  @param[in]  ListType           The type of the List to indicate whether it is a
     734                                 Established.
    735735
    736736  @return The point to IKEV2_CHILD_SA_SESSION or NULL.
    737  
     737
    738738**/
    739739IKEV2_CHILD_SA_SESSION *
    740740Ikev2ChildSaSessionRemove (
    741741  IN LIST_ENTRY           *SaSessionList,
    742   IN UINT32               Spi, 
     742  IN UINT32               Spi,
    743743  IN UINT8                ListType
    744744  )
     
    749749
    750750  NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, SaSessionList) {
    751    
     751
    752752    if (ListType == IKEV2_ESTABLISHED_CHILDSA_LIST || ListType == IKEV2_ESTABLISHING_CHILDSA_LIST) {
    753753      ChildSaSession = IKEV2_CHILD_SA_SESSION_BY_IKE_SA (Entry);
     
    784784
    785785/**
    786   Free the memory located for the specified IKEV2_CHILD_SA_SESSION. 
     786  Free the memory located for the specified IKEV2_CHILD_SA_SESSION.
    787787
    788788  @param[in]  ChildSaSession  Pointer to IKEV2_CHILD_SA_SESSION.
     
    902902  ChildSession = Ikev2ChildSaSessionRemove(
    903903                   &(IkeSaSession->ChildSaEstablishSessionList),
    904                    Spi, 
     904                   Spi,
    905905                   IKEV2_ESTABLISHED_CHILDSA_LIST
    906906                   );
     
    911911  LocalSpi  = ChildSession->LocalPeerSpi;
    912912  RemoteSpi = ChildSession->RemotePeerSpi;
    913  
     913
    914914  SelectorSize  = sizeof (EFI_IPSEC_CONFIG_SELECTOR);
    915915  Selector      = AllocateZeroPool (SelectorSize);
    916916  ASSERT (Selector != NULL);
    917917
    918  
     918
    919919
    920920  while (1) {
     
    10151015
    10161016  @param[in] DhBuffer   Pointer to IKEV2_DH_BUFFER to be freed.
    1017  
     1017
    10181018**/
    10191019VOID
    10201020Ikev2DhBufferFree (
    10211021  IKEV2_DH_BUFFER *DhBuffer
    1022 ) 
     1022)
    10231023{
    10241024  if (DhBuffer != NULL) {
     
    10411041/**
    10421042  This function is to parse a request IKE packet and return its request type.
    1043   The request type is one of IKE CHILD SA creation, IKE SA rekeying and 
     1043  The request type is one of IKE CHILD SA creation, IKE SA rekeying and
    10441044  IKE CHILD SA rekeying.
    10451045
     
    10681068      Flag = TRUE;
    10691069    }
    1070     if (IkePayload->PayloadType == IKEV2_PAYLOAD_TYPE_NOTIFY) { 
     1070    if (IkePayload->PayloadType == IKEV2_PAYLOAD_TYPE_NOTIFY) {
    10711071      if (((IKEV2_NOTIFY*)IkePayload)->MessageType == IKEV2_NOTIFICATION_REKEY_SA) {
    10721072        //
    1073         // If notify payload with REKEY_SA message type, the IkePacket is for 
     1073        // If notify payload with REKEY_SA message type, the IkePacket is for
    10741074        // rekeying Child SA.
    10751075        //
     
    10861086  } else {
    10871087    //
    1088     // If the Notify payloaad with transport mode message type, the IkePacket is 
     1088    // If the Notify payloaad with transport mode message type, the IkePacket is
    10891089    // for create Child SA.
    10901090    //
     
    10961096  Associate a SPD selector to the Child SA Session.
    10971097
    1098   This function is called when the Child SA is not the first child SA of its 
     1098  This function is called when the Child SA is not the first child SA of its
    10991099  IKE SA. It associate a SPD to this Child SA.
    11001100
    1101   @param[in, out]  ChildSaSession     Pointer to the Child SA Session to be associated to 
     1101  @param[in, out]  ChildSaSession     Pointer to the Child SA Session to be associated to
    11021102                                      a SPD selector.
    11031103
     
    11221122/**
    11231123  This function finds the SPI from Create Child SA Exchange Packet.
    1124  
     1124
    11251125  @param[in] IkePacket       Pointer to IKE_PACKET to be searched.
    11261126
     
    11351135  //
    11361136  // Not support yet.
    1137   // 
     1137  //
    11381138  return 0;
    11391139}
     
    11851185  // Information Exchagne and Create Child Exchange can be started from each part.
    11861186  //
    1187   if (IkeHdr->ExchangeType != IKEV2_EXCHANGE_TYPE_INFO && 
     1187  if (IkeHdr->ExchangeType != IKEV2_EXCHANGE_TYPE_INFO &&
    11881188      IkeHdr->ExchangeType != IKEV2_EXCHANGE_TYPE_CREATE_CHILD
    11891189      ) {
     
    12601260
    12611261  //
    1262   // If SA data for IKE_SA_INIT exchage, contains 4 transforms. If SA data for 
     1262  // If SA data for IKE_SA_INIT exchage, contains 4 transforms. If SA data for
    12631263  // IKE_AUTH exchange contains 3 transforms.
    12641264  //
     
    14301430  //
    14311431  // Create a SpdSelector. In this implementation, one SPD represents
    1432   // 2 direction traffic, so in here, there needs to reverse the local address 
     1432  // 2 direction traffic, so in here, there needs to reverse the local address
    14331433  // and remote address for Remote Peer's SA, then reverse again for the locate
    1434   // SA. 
     1434  // SA.
    14351435  //
    14361436  TempAddressCount = ChildSaSession->SpdSelector->LocalAddressCount;
     
    14571457  if (SaData.Mode == EfiIPsecTunnel) {
    14581458    CopyMem (
    1459       &SaData.TunnelSourceAddress, 
     1459      &SaData.TunnelSourceAddress,
    14601460      &ChildSaSession->Spd->Data->ProcessingPolicy->TunnelOption->RemoteTunnelAddress,
    14611461      sizeof (EFI_IP_ADDRESS)
     
    14861486  //
    14871487  // Store the local SA into SAD.
    1488   // 
     1488  //
    14891489  ChildSaSession->SpdSelector->RemoteAddressCount = ChildSaSession->SpdSelector->LocalAddressCount;
    14901490  ChildSaSession->SpdSelector->RemoteAddress      = ChildSaSession->SpdSelector->LocalAddress;
     
    14921492  ChildSaSession->SpdSelector->LocalAddress       = TempAddressInfo;
    14931493  ChildSaSession->SpdSelector->LocalAddressCount  = TempAddressCount;
    1494  
     1494
    14951495  SaId.Spi = ChildSaSession->RemotePeerSpi;
    14961496
     
    15291529  Call back function of the IKE life time is over.
    15301530
    1531   This function will mark the related IKE SA Session as deleting and trigger a 
     1531  This function will mark the related IKE SA Session as deleting and trigger a
    15321532  Information negotiation.
    15331533
    15341534  @param[in]    Event     The signaled Event.
    15351535  @param[in]    Context   Pointer to data passed by caller.
    1536  
     1536
    15371537**/
    15381538VOID
     
    15761576    //
    15771577    // Change the Child SA Session's State to IKE_STATE_SA_DELETING.
    1578     //   
     1578    //
    15791579    DEBUG ((
    15801580      DEBUG_INFO,
     
    16121612  EFI_STATUS                   Status;
    16131613
    1614   ASSERT (Context != NULL); 
     1614  ASSERT (Context != NULL);
    16151615  IkeSaSession   = NULL;
    16161616  ChildSaSession = NULL;
     
    16881688
    16891689        //
    1690         // Established Child SA should be remove from the SAD entry and 
    1691         // DeleteList. The function of Ikev2DeleteChildSaSilent() will remove 
    1692         // the childSA from the IkeSaSession->ChildSaEstablishedList. So there 
     1690        // Established Child SA should be remove from the SAD entry and
     1691        // DeleteList. The function of Ikev2DeleteChildSaSilent() will remove
     1692        // the childSA from the IkeSaSession->ChildSaEstablishedList. So there
    16931693        // is no need to remove it here.
    16941694        //
     
    17331733
    17341734  ChildSaSession->SpdSelector stores the real Spdselector for its SA. Sometime,
    1735   the SpdSelector in ChildSaSession is more accurated or the scope is smaller 
     1735  the SpdSelector in ChildSaSession is more accurated or the scope is smaller
    17361736  than the one in ChildSaSession->Spd, especially for the tunnel mode.
    1737    
     1737
    17381738  @param[in, out]  ChildSaSession  Pointer to IKEV2_CHILD_SA_SESSION related to.
    1739  
     1739
    17401740**/
    17411741VOID
    17421742Ikev2ChildSaSessionSpdSelectorCreate (
    17431743  IN OUT IKEV2_CHILD_SA_SESSION *ChildSaSession
    1744   ) 
     1744  )
    17451745{
    17461746  if (ChildSaSession->Spd != NULL && ChildSaSession->Spd->Selector != NULL) {
     
    17501750    }
    17511751    CopyMem (
    1752       ChildSaSession->SpdSelector, 
    1753       ChildSaSession->Spd->Selector, 
     1752      ChildSaSession->SpdSelector,
     1753      ChildSaSession->Spd->Selector,
    17541754      sizeof (EFI_IPSEC_SPD_SELECTOR)
    17551755      );
    17561756    ChildSaSession->SpdSelector->RemoteAddress = AllocateCopyPool (
    1757                                                    ChildSaSession->Spd->Selector->RemoteAddressCount * 
    1758                                                    sizeof (EFI_IP_ADDRESS_INFO), 
     1757                                                   ChildSaSession->Spd->Selector->RemoteAddressCount *
     1758                                                   sizeof (EFI_IP_ADDRESS_INFO),
    17591759                                                   ChildSaSession->Spd->Selector->RemoteAddress
    17601760                                                   );
    17611761    ChildSaSession->SpdSelector->LocalAddress = AllocateCopyPool (
    1762                                                   ChildSaSession->Spd->Selector->LocalAddressCount * 
    1763                                                   sizeof (EFI_IP_ADDRESS_INFO), 
     1762                                                  ChildSaSession->Spd->Selector->LocalAddressCount *
     1763                                                  sizeof (EFI_IP_ADDRESS_INFO),
    17641764                                                  ChildSaSession->Spd->Selector->LocalAddress
    17651765                                                  );
     
    17691769
    17701770    ChildSaSession->SpdSelector->RemoteAddressCount = ChildSaSession->Spd->Selector->RemoteAddressCount;
    1771     ChildSaSession->SpdSelector->LocalAddressCount = ChildSaSession->Spd->Selector->LocalAddressCount; 
     1771    ChildSaSession->SpdSelector->LocalAddressCount = ChildSaSession->Spd->Selector->LocalAddressCount;
    17721772  }
    17731773}
     
    17991799  //
    18001800  // Set the specific parameters.
    1801   // 
     1801  //
    18021802  ChildSaSession->Spd        = IkeSaSession->Spd;
    18031803  ChildSaCommon              = &ChildSaSession->SessionCommon;
     
    18321832
    18331833  //
    1834   //  Only if the Create Child SA is called for the IKE_INIT Exchange and 
    1835   //  IkeSaSession is initiator (Only Initiator's SPD is not NULL), Set the 
     1834  //  Only if the Create Child SA is called for the IKE_INIT Exchange and
     1835  //  IkeSaSession is initiator (Only Initiator's SPD is not NULL), Set the
    18361836  //  Traffic Selectors related information here.
    18371837  //
     
    18531853
    18541854  This function is the subfunction of Ikev1AssociateSpdEntry(). It is the call
    1855   back function of IpSecVisitConfigData(). 
    1856  
     1855  back function of IpSecVisitConfigData().
     1856
    18571857
    18581858  @param[in]  Type               Type of the input Config Selector.
    1859   @param[in]  Selector           Pointer to the Configure Selector to be checked. 
    1860   @param[in]  Data               Pointer to the Configure Selector's Data passed 
     1859  @param[in]  Selector           Pointer to the Configure Selector to be checked.
     1860  @param[in]  Data               Pointer to the Configure Selector's Data passed
    18611861                                 from the caller.
    18621862  @param[in]  SelectorSize       The buffer size of Selector.
     
    18651865                                 SA Session in this context.
    18661866
    1867   @retval EFI_SUCCESS        The SPD Selector is not related to the Child SA Session. 
    1868   @retval EFI_ABORTED        The SPD Selector is related to the Child SA session and 
     1867  @retval EFI_SUCCESS        The SPD Selector is not related to the Child SA Session.
     1868  @retval EFI_ABORTED        The SPD Selector is related to the Child SA session and
    18691869                             set the ChildSaSession->Spd to point to this SPD Selector.
    18701870
     
    18971897  ChildSaSession  = (IKEV2_CHILD_SA_SESSION *) Context;
    18981898  IpVersion       = ChildSaSession->SessionCommon.UdpService->IpVersion;
    1899   SpdSelector     = (EFI_IPSEC_SPD_SELECTOR *) Selector; 
     1899  SpdSelector     = (EFI_IPSEC_SPD_SELECTOR *) Selector;
    19001900  IsMatch         = TRUE;
    19011901
     
    19261926  }
    19271927
    1928   IsMatch = (BOOLEAN) (IsMatch && 
     1928  IsMatch = (BOOLEAN) (IsMatch &&
    19291929                       IpSecMatchIpAddress (
    19301930                         IpVersion,
     
    19341934                         ));
    19351935
    1936   IsMatch = (BOOLEAN) (IsMatch && 
     1936  IsMatch = (BOOLEAN) (IsMatch &&
    19371937                       IpSecMatchIpAddress (
    19381938                         IpVersion,
     
    20082008  @param[in]  ProposalData              Pointer to related IKEV2_PROPOSAL_DATA.
    20092009  @param[out] PreferEncryptAlgorithm    Output of preferred encrypt algorithm.
    2010   @param[out] PreferIntegrityAlgorithm  Output of preferred integrity algorithm. 
    2011   @param[out] PreferPrfAlgorithm        Output of preferred PRF algorithm. Only 
     2010  @param[out] PreferIntegrityAlgorithm  Output of preferred integrity algorithm.
     2011  @param[out] PreferPrfAlgorithm        Output of preferred PRF algorithm. Only
    20122012                                        for IKE SA.
    2013   @param[out] PreferDhGroup             Output of preferred DH group. Only for 
     2013  @param[out] PreferDhGroup             Output of preferred DH group. Only for
    20142014                                        IKE SA.
    2015   @param[out] PreferEncryptKeylength    Output of preferred encrypt key length 
     2015  @param[out] PreferEncryptKeylength    Output of preferred encrypt key length
    20162016                                        in bytes.
    20172017  @param[out] IsSupportEsn              Output of value about the Extented Sequence
     
    20232023VOID
    20242024Ikev2ParseProposalData (
    2025   IN     IKEV2_PROPOSAL_DATA  *ProposalData, 
     2025  IN     IKEV2_PROPOSAL_DATA  *ProposalData,
    20262026     OUT UINT16               *PreferEncryptAlgorithm,
    20272027     OUT UINT16               *PreferIntegrityAlgorithm,
     
    20312031     OUT BOOLEAN              *IsSupportEsn,
    20322032  IN     BOOLEAN              IsChildSa
    2033 ) 
     2033)
    20342034{
    20352035  IKEV2_TRANSFORM_DATA *TransformData;
     
    20402040  //
    20412041  if (ProposalData == NULL ||
    2042       PreferEncryptAlgorithm == NULL || 
     2042      PreferEncryptAlgorithm == NULL ||
    20432043      PreferIntegrityAlgorithm == NULL ||
    20442044      PreferEncryptKeylength == NULL
     
    20552055      return;
    20562056    }
    2057   } 
     2057  }
    20582058
    20592059  TransformData = (IKEV2_TRANSFORM_DATA *)(ProposalData + 1);
    20602060  for (TransformIndex = 0; TransformIndex < ProposalData->NumTransforms; TransformIndex++) {
    2061     switch (TransformData->TransformType) {         
    2062     //
    2063     // For IKE SA there are four algorithm types. Encryption Algorithm, Pseudo-random Function, 
    2064     // Integrity Algorithm, Diffie-Hellman Group. For Child SA, there are three algorithm types. 
     2061    switch (TransformData->TransformType) {
     2062    //
     2063    // For IKE SA there are four algorithm types. Encryption Algorithm, Pseudo-random Function,
     2064    // Integrity Algorithm, Diffie-Hellman Group. For Child SA, there are three algorithm types.
    20652065    // Encryption Algorithm, Integrity Algorithm, Extended Sequence Number.
    20662066    //
     
    20892089          *PreferPrfAlgorithm = TransformData->TransformId;
    20902090        }
    2091       }       
     2091      }
    20922092      break;
    20932093
     
    20972097      }
    20982098      break;
    2099      
     2099
    21002100    case IKEV2_TRANSFORM_TYPE_DH :
    21012101      if (!IsChildSa) {
     
    21032103          *PreferDhGroup = TransformData->TransformId;
    21042104        }
    2105       }       
     2105      }
    21062106      break;
    2107    
     2107
    21082108    case IKEV2_TRANSFORM_TYPE_ESN :
    21092109      if (IsChildSa) {
     
    21112111          *IsSupportEsn = TRUE;
    21122112        }
    2113       }       
     2113      }
    21142114      break;
    21152115
     
    21232123/**
    21242124  Parse the received Initial Exchange Packet.
    2125  
    2126   This function parse the SA Payload and Key Payload to find out the cryptographic 
    2127   suite for the further IKE negotiation and fill it into the IKE SA Session's 
     2125
     2126  This function parse the SA Payload and Key Payload to find out the cryptographic
     2127  suite for the further IKE negotiation and fill it into the IKE SA Session's
    21282128  CommonSession->SaParams.
    21292129
    21302130  @param[in, out]  IkeSaSession  Pointer to related IKEV2_SA_SESSION.
    21312131  @param[in]       SaPayload     The received packet.
    2132   @param[in]       Type          The received packet IKE header flag. 
     2132  @param[in]       Type          The received packet IKE header flag.
    21332133
    21342134  @retval          TRUE          If the SA proposal in Packet is acceptable.
     
    21812181        //
    21822182        Ikev2ParseProposalData (
    2183           ProposalData, 
     2183          ProposalData,
    21842184          &PreferEncryptAlgorithm,
    21852185          &PreferIntegrityAlgorithm,
     
    21932193        if (PreferEncryptAlgorithm != 0 &&
    21942194              PreferIntegrityAlgorithm != 0 &&
    2195               PreferPrfAlgorithm != 0 && 
     2195              PreferPrfAlgorithm != 0 &&
    21962196              PreferDhGroup != 0
    21972197              ) {
    21982198            //
    2199             // Find the matched one. 
     2199            // Find the matched one.
    22002200            //
    22012201            IkeSaSession->SessionCommon.SaParams = AllocateZeroPool (sizeof (IKEV2_SA_PARAMS));
     
    22252225            //
    22262226            CopyMem (
    2227               (IKEV2_PROPOSAL_DATA *) (IkeSaSession->SaData + 1), 
    2228                ProposalData, 
     2227              (IKEV2_PROPOSAL_DATA *) (IkeSaSession->SaData + 1),
     2228               ProposalData,
    22292229               SaDataSize - sizeof (IKEV2_SA_DATA)
    22302230              );
     
    22432243      // Point to next Proposal.
    22442244      //
    2245       ProposalData = (IKEV2_PROPOSAL_DATA*)((UINT8*)(ProposalData + 1) + 
     2245      ProposalData = (IKEV2_PROPOSAL_DATA*)((UINT8*)(ProposalData + 1) +
    22462246                     ProposalData->NumTransforms * sizeof (IKEV2_TRANSFORM_DATA));
    22472247    }
    22482248  } else if (Type == IKE_HEADER_FLAGS_RESPOND) {
    22492249    //
    2250     // First check the SA proposal's ProtoctolID and Transform Numbers. Since it is 
    2251     // the responded SA proposal, suppose it only has one proposal and the transform Numbers 
    2252     // is 4. 
     2250    // First check the SA proposal's ProtoctolID and Transform Numbers. Since it is
     2251    // the responded SA proposal, suppose it only has one proposal and the transform Numbers
     2252    // is 4.
    22532253    //
    22542254    ProposalData  = (IKEV2_PROPOSAL_DATA *)((IKEV2_SA_DATA *) SaPayload->PayloadBuf + 1);
     
    22572257    }
    22582258    //
    2259     // Get the preferred algorithms. 
     2259    // Get the preferred algorithms.
    22602260    //
    22612261    Ikev2ParseProposalData (
     
    22662266      &PreferDhGroup,
    22672267      &PreferEncryptKeylength,
    2268       NULL, 
     2268      NULL,
    22692269      FALSE
    22702270      );
    2271     // 
     2271    //
    22722272    // Check if the Sa proposal data from received packet is in the IkeSaSession->SaData.
    22732273    //
     
    22762276    for (ProposalIndex = 0; ProposalIndex < IkeSaSession->SaData->NumProposals && (!IsMatch); ProposalIndex++) {
    22772277      Ikev2ParseProposalData (
    2278           ProposalData, 
     2278          ProposalData,
    22792279          &EncryptAlgorithm,
    22802280          &IntegrityAlgorithm,
     
    22972297        PrfAlgorithm       = 0;
    22982298        DhGroup            = 0;
    2299         EncryptKeylength   = 0; 
     2299        EncryptKeylength   = 0;
    23002300      }
    23012301
    2302       ProposalData = (IKEV2_PROPOSAL_DATA*)((UINT8*)(ProposalData + 1) + 
    2303                      ProposalData->NumTransforms * sizeof (IKEV2_TRANSFORM_DATA));   
     2302      ProposalData = (IKEV2_PROPOSAL_DATA*)((UINT8*)(ProposalData + 1) +
     2303                     ProposalData->NumTransforms * sizeof (IKEV2_TRANSFORM_DATA));
    23042304    }
    23052305
     
    23132313        IkeSaSession->SessionCommon.SaParams->IntegAlgId = PreferIntegrityAlgorithm;
    23142314        IkeSaSession->SessionCommon.PreferDhGroup        = PreferDhGroup;
    2315      
     2315
    23162316        return TRUE;
    23172317    }
     
    23222322/**
    23232323  Parse the received Authentication Exchange Packet.
    2324  
     2324
    23252325  This function parse the SA Payload and Key Payload to find out the cryptographic
    23262326  suite for the ESP and fill it into the Child SA Session's CommonSession->SaParams.
    2327  
    2328   @param[in, out]  ChildSaSession  Pointer to IKEV2_CHILD_SA_SESSION related to 
     2327
     2328  @param[in, out]  ChildSaSession  Pointer to IKEV2_CHILD_SA_SESSION related to
    23292329                                   this Authentication Exchange.
    23302330  @param[in]       SaPayload       The received packet.
    2331   @param[in]       Type            The IKE header's flag of received packet . 
    2332  
     2331  @param[in]       Type            The IKE header's flag of received packet .
     2332
    23332333  @retval          TRUE            If the SA proposal in Packet is acceptable.
    23342334  @retval          FALSE           If the SA proposal in Packet is not acceptable.
     
    23892389        // Don't support the ESN now.
    23902390        //
    2391         if (PreferEncryptAlgorithm != 0 && 
     2391        if (PreferEncryptAlgorithm != 0 &&
    23922392            PreferIntegrityAlgorithm != 0 &&
    23932393            !IsSupportEsn
    23942394            ) {
    23952395          //
    2396           // Find the matched one. 
     2396          // Find the matched one.
    23972397          //
    23982398          ChildSaSession->SessionCommon.SaParams = AllocateZeroPool (sizeof (IKEV2_SA_PARAMS));
     
    24172417          //
    24182418          // BUGBUG: Suppose there are 4 transforms in the matched proposal. If
    2419           // the matched Proposal has more than 4 transforms that means there 
     2419          // the matched Proposal has more than 4 transforms that means there
    24202420          // are more than one transform with same type.
    24212421          //
     
    24292429
    24302430          ((IKEV2_PROPOSAL_DATA *) (ChildSaSession->SaData + 1))->Spi = AllocateCopyPool (
    2431                                                                           sizeof (ChildSaSession->LocalPeerSpi), 
     2431                                                                          sizeof (ChildSaSession->LocalPeerSpi),
    24322432                                                                          &ChildSaSession->LocalPeerSpi
    24332433                                                                          );
     
    24442444      // Point to next Proposal
    24452445      //
    2446       ProposalData = (IKEV2_PROPOSAL_DATA *)((UINT8 *)(ProposalData + 1) + 
     2446      ProposalData = (IKEV2_PROPOSAL_DATA *)((UINT8 *)(ProposalData + 1) +
    24472447                     ProposalData->NumTransforms * sizeof (IKEV2_TRANSFORM_DATA));
    24482448    }
    24492449  } else if (Type == IKE_HEADER_FLAGS_RESPOND) {
    24502450    //
    2451     // First check the SA proposal's ProtoctolID and Transform Numbers. Since it is 
    2452     // the responded SA proposal, suppose it only has one proposal and the transform Numbers 
    2453     // is 3. 
     2451    // First check the SA proposal's ProtoctolID and Transform Numbers. Since it is
     2452    // the responded SA proposal, suppose it only has one proposal and the transform Numbers
     2453    // is 3.
    24542454    //
    24552455    ProposalData  = (IKEV2_PROPOSAL_DATA *)((IKEV2_SA_DATA *)SaPayload->PayloadBuf + 1);
     
    24752475    for (ProposalIndex = 0; ProposalIndex < ChildSaSession->SaData->NumProposals && (!IsMatch); ProposalIndex++) {
    24762476      Ikev2ParseProposalData (
    2477           ProposalData, 
     2477          ProposalData,
    24782478          &EncryptAlgorithm,
    24792479          &IntegrityAlgorithm,
     
    24872487          EncryptKeylength == PreferEncryptKeylength &&
    24882488          IntegrityAlgorithm == PreferIntegrityAlgorithm &&
    2489           IsSupportEsn == PreferIsSupportEsn         
     2489          IsSupportEsn == PreferIsSupportEsn
    24902490          ) {
    24912491        IsMatch = TRUE;
     
    24952495        IsSupportEsn             = TRUE;
    24962496      }
    2497        ProposalData = (IKEV2_PROPOSAL_DATA*)((UINT8*)(ProposalData + 1) + 
    2498                      ProposalData->NumTransforms * sizeof (IKEV2_TRANSFORM_DATA)); 
    2499     }
    2500  
     2497       ProposalData = (IKEV2_PROPOSAL_DATA*)((UINT8*)(ProposalData + 1) +
     2498                     ProposalData->NumTransforms * sizeof (IKEV2_TRANSFORM_DATA));
     2499    }
     2500
    25012501    ProposalData  = (IKEV2_PROPOSAL_DATA *)((IKEV2_SA_DATA *)SaPayload->PayloadBuf + 1);
    25022502    if (IsMatch) {
     
    25172517  Generate Key buffer from fragments.
    25182518
    2519   If the digest length of specified HashAlgId is larger than or equal with the 
    2520   required output key length, derive the key directly. Otherwise, Key Material 
    2521   needs to be PRF-based concatenation according to 2.13 of RFC 4306: 
     2519  If the digest length of specified HashAlgId is larger than or equal with the
     2520  required output key length, derive the key directly. Otherwise, Key Material
     2521  needs to be PRF-based concatenation according to 2.13 of RFC 4306:
    25222522  prf+ (K,S) = T1 | T2 | T3 | T4 | ..., T1 = prf (K, S | 0x01),
    25232523  T2 = prf (K, T1 | S | 0x02), T3 = prf (K, T2 | S | 0x03),T4 = prf (K, T3 | S | 0x04)
    25242524  then derive the key from this key material.
    2525  
     2525
    25262526  @param[in]       HashAlgId        The Hash Algorithm ID used to generate key.
    25272527  @param[in]       HashKey          Pointer to a key buffer which contains hash key.
    25282528  @param[in]       HashKeyLength    The length of HashKey in bytes.
    2529   @param[in, out]  OutputKey        Pointer to buffer which is used to receive the 
     2529  @param[in, out]  OutputKey        Pointer to buffer which is used to receive the
    25302530                                    output key.
    25312531  @param[in]       OutputKeyLength  The length of OutPutKey buffer.
     
    25842584    Status = IpSecCryptoIoHmac (
    25852585               HashAlgId,
    2586                HashKey, 
    2587                HashKeyLength, 
    2588                (HASH_DATA_FRAGMENT *) Fragments, 
    2589                NumFragments, 
    2590                Digest, 
     2586               HashKey,
     2587               HashKeyLength,
     2588               (HASH_DATA_FRAGMENT *) Fragments,
     2589               NumFragments,
     2590               Digest,
    25912591               DigestSize
    25922592               );
     
    26202620  for (Index = 0; Index < NumFragments; Index++) {
    26212621    CopyMem (
    2622       LocalFragments[1].Data + FragmentsSize, 
     2622      LocalFragments[1].Data + FragmentsSize,
    26232623      Fragments[Index].Data,
    26242624      Fragments[Index].DataSize
     
    26432643  for (Index = 0; Index < Round; Index++) {
    26442644    Status = IpSecCryptoIoHmac (
    2645                HashAlgId, 
    2646                HashKey, 
    2647                HashKeyLength, 
     2645               HashAlgId,
     2646               HashKey,
     2647               HashKeyLength,
    26482648               (HASH_DATA_FRAGMENT *)(Index == 0 ? &LocalFragments[1] : LocalFragments),
    2649                Index == 0 ? 2 : 3, 
     2649               Index == 0 ? 2 : 3,
    26502650               Digest,
    26512651               DigestSize
     
    26552655    }
    26562656    CopyMem (
    2657       LocalFragments[0].Data, 
    2658       Digest, 
     2657      LocalFragments[0].Data,
     2658      Digest,
    26592659      DigestSize
    26602660      );
    26612661    if (OutputKeyLength > DigestSize * (Index + 1)) {
    26622662      CopyMem (
    2663         OutputKey + Index * DigestSize, 
    2664         Digest, 
     2663        OutputKey + Index * DigestSize,
     2664        Digest,
    26652665        DigestSize
    26662666        );
     
    26682668      TailData ++;
    26692669    } else {
    2670       // 
     2670      //
    26712671      // The last round
    26722672      //
    26732673      CopyMem (
    2674         OutputKey + Index * DigestSize, 
    2675         Digest, 
     2674        OutputKey + Index * DigestSize,
     2675        Digest,
    26762676        OutputKeyLength - Index * DigestSize
    26772677      );
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/Ikev2/Utility.h

    r48674 r58466  
    11/** @file
    2   The interfaces of IKE/Child session operations and payload related operations 
     2  The interfaces of IKE/Child session operations and payload related operations
    33  used by IKE Exchange Process.
    44
     
    7777
    7878  @param[in]  SaSessionList   Pointer to list to be inserted into.
    79   @param[in]  IkeSaSession    Pointer to IKEV2_SA_SESSION to be inserted. 
    80   @param[in]  RemotePeerIp    Pointer to EFI_IP_ADDRESSS to indicate the 
     79  @param[in]  IkeSaSession    Pointer to IKEV2_SA_SESSION to be inserted.
     80  @param[in]  RemotePeerIp    Pointer to EFI_IP_ADDRESSS to indicate the
    8181                              unique IKEV2_SA_SESSION.
    8282
     
    9595  @param[in]  RemotePeerIp    Pointer to EFI_IP_ADDRESS to use for SA Session search.
    9696
    97   @retval Pointer to IKEV2_SA_SESSION with the specified remote IP address. 
     97  @retval Pointer to IKEV2_SA_SESSION with the specified remote IP address.
    9898
    9999**/
     
    130130
    131131/**
    132   Free specified IKEV2 SA Session. 
     132  Free specified IKEV2 SA Session.
    133133
    134134  @param[in]    IkeSaSession   Pointer to IKEV2_SA_SESSION to be freed.
     
    141141
    142142/**
    143   Free specified Seession Common. The session common would belong to a IKE SA or 
     143  Free specified Seession Common. The session common would belong to a IKE SA or
    144144  a Child SA.
    145145
     
    165165/**
    166166  Allocate Momery for IKEV2 Child SA Session.
    167  
     167
    168168  @param[in]   UdpService     Pointer to IKE_UDP_SERVICE.
    169   @param[in]   IkeSaSession   Pointer to IKEV2_SA_SESSION related to this Child SA 
     169  @param[in]   IkeSaSession   Pointer to IKEV2_SA_SESSION related to this Child SA
    170170                              Session.
    171171
     
    180180
    181181/**
    182   Register a established IKEv2 Child SA into IkeSaSession->ChildSaEstablishSessionList. 
    183   If the there is IKEV2_CHILD_SA_SESSION with same remote peer IP, remove the old one 
     182  Register a established IKEv2 Child SA into IkeSaSession->ChildSaEstablishSessionList.
     183  If the there is IKEV2_CHILD_SA_SESSION with same remote peer IP, remove the old one
    184184  then register the new one.
    185185
     
    199199  This functin find a ChildSA session by searching the ChildSaSessionlist of
    200200  the input IKEV2_SA_SESSION by specified MessageID.
    201  
     201
    202202  @param[in]  SaSessionList      Pointer to List to be searched.
    203203  @param[in]  Spi                Specified SPI.
     
    242242/**
    243243  Remove the IKEV2_CHILD_SA_SESSION from IkeSaSessionList.
    244  
     244
    245245  @param[in]  SaSessionList      The SA Session List to be iterated.
    246246  @param[in]  Spi                Spi used to identify the IKEV2_CHILD_SA_SESSION.
    247   @param[in]  ListType           The type of the List to indicate whether it is a 
    248                                  Established. 
     247  @param[in]  ListType           The type of the List to indicate whether it is a
     248                                 Established.
    249249
    250250  @return The point to IKEV2_CHILD_SA_SESSION.
    251  
     251
    252252**/
    253253IKEV2_CHILD_SA_SESSION *
    254254Ikev2ChildSaSessionRemove (
    255255  IN LIST_ENTRY           *SaSessionList,
    256   IN UINT32               Spi, 
    257   IN UINT8                ListType 
     256  IN UINT32               Spi,
     257  IN UINT8                ListType
    258258  );
    259259
     
    272272
    273273/**
    274   Free the memory located for the specified IKEV2_CHILD_SA_SESSION. 
     274  Free the memory located for the specified IKEV2_CHILD_SA_SESSION.
    275275
    276276  @param[in]  ChildSaSession  Pointer to IKEV2_CHILD_SA_SESSION.
     
    286286
    287287  @param[in] DhBuffer   Pointer to IKEV2_DH_BUFFER to be freed.
    288  
     288
    289289**/
    290290VOID
     
    316316/**
    317317  This function is to parse a request IKE packet and return its request type.
    318   The request type is one of IKE CHILD SA creation, IKE SA rekeying and 
     318  The request type is one of IKE CHILD SA creation, IKE SA rekeying and
    319319  IKE CHILD SA rekeying.
    320320
     
    331331/**
    332332  This function finds the SPI from Create Child Sa Exchange Packet.
    333  
     333
    334334  @param[in] IkePacket       Pointer to IKE_PACKET to be searched.
    335335
     
    346346  Associate a SPD selector to the Child SA Session.
    347347
    348   This function is called when the Child SA is not the first child SA of its 
     348  This function is called when the Child SA is not the first child SA of its
    349349  IKE SA. It associate a SPD to this Child SA.
    350350
    351   @param[in, out]  ChildSaSession     Pointer to the Child SA Session to be associated to 
     351  @param[in, out]  ChildSaSession     Pointer to the Child SA Session to be associated to
    352352                                      a SPD selector.
    353353
     
    442442
    443443  @param[in] SessionSaData   The data used in SA payload.
    444   @param[in] NextPayload     The payload type presented in NextPayload field of 
     444  @param[in] NextPayload     The payload type presented in NextPayload field of
    445445                             SA Payload header.
    446446  @param[in] Type            The SA type. It MUST be neither (1) for IKE_SA or
     
    448448
    449449  @retval a Pointer to SA IKE payload.
    450  
     450
    451451**/
    452452IKE_PAYLOAD *
     
    461461
    462462  @param[in] CommonSession   Pointer to IKEV2_SESSION_COMMON related to ID payload.
    463   @param[in] NextPayload     The payload type presented in the NextPayload field 
     463  @param[in] NextPayload     The payload type presented in the NextPayload field
    464464                             of ID Payload header.
    465465
     
    477477
    478478  @param[in] CommonSession   Pointer to IKEV2_SESSION_COMMON related to ID payload.
    479   @param[in] NextPayload     The payload type presented in the NextPayload field 
     479  @param[in] NextPayload     The payload type presented in the NextPayload field
    480480                             of ID Payload header.
    481481  @param[in] InCert          Pointer to the Certificate which distinguished name
     
    489489Ikev2GenerateCertIdPayload (
    490490  IN IKEV2_SESSION_COMMON *CommonSession,
    491   IN UINT8                NextPayload, 
     491  IN UINT8                NextPayload,
    492492  IN UINT8                *InCert,
    493493  IN UINTN                CertSize
     
    497497  Generate a Nonce payload contenting the input parameter NonceBuf.
    498498
    499   @param[in]  NonceBuf       The nonce buffer content the whole Nonce payload block 
     499  @param[in]  NonceBuf       The nonce buffer content the whole Nonce payload block
    500500                            except the payload header.
    501501  @param[in]  NonceSize      The buffer size of the NonceBuf
    502   @param[in]  NextPayload   The payload type presented in the NextPayload field 
     502  @param[in]  NextPayload   The payload type presented in the NextPayload field
    503503                            of Nonce Payload header.
    504504
     
    517517
    518518  Since the structure of Notify payload which defined in RFC 4306 is simple, so
    519   there is no internal data structure for Notify payload. This function generate 
    520   Notify payload defined in RFC 4306, but all the fields in this payload are still 
    521   in host order and need call Ikev2EncodePayload() to convert those fields from 
     519  there is no internal data structure for Notify payload. This function generate
     520  Notify payload defined in RFC 4306, but all the fields in this payload are still
     521  in host order and need call Ikev2EncodePayload() to convert those fields from
    522522  the host order to network order beforing sending it.
    523523
     
    525525                                For IPsec SAs it MUST be neither (2) for AH or (3)
    526526                                for ESP.
    527   @param[in]  NextPayload       The next paylaod type in NextPayload field of 
     527  @param[in]  NextPayload       The next paylaod type in NextPayload field of
    528528                                the Notify payload.
    529529  @param[in]  SpiSize           Size of the SPI in SPI size field of the Notify Payload.
    530   @param[in]  MessageType       The message type in NotifyMessageType field of the 
     530  @param[in]  MessageType       The message type in NotifyMessageType field of the
    531531                                Notify Payload.
    532532  @param[in]  SpiBuf            Pointer to buffer contains the SPI value.
    533533  @param[in]  NotifyData        Pointer to buffer contains the notification data.
    534534  @param[in]  NotifyDataSize    The size of NotifyData in bytes.
    535  
     535
    536536
    537537  @retval Pointer to IKE Notify Payload.
     
    552552  Generate the Delete payload.
    553553
    554   Since the structure of Delete payload which defined in RFC 4306 is simple, 
    555   there is no internal data structure for Delete payload. This function generate 
    556   Delete payload defined in RFC 4306, but all the fields in this payload are still 
    557   in host order and need call Ikev2EncodePayload() to convert those fields from 
     554  Since the structure of Delete payload which defined in RFC 4306 is simple,
     555  there is no internal data structure for Delete payload. This function generate
     556  Delete payload defined in RFC 4306, but all the fields in this payload are still
     557  in host order and need call Ikev2EncodePayload() to convert those fields from
    558558  the host order to network order beforing sending it.
    559559
    560560  @param[in]  IkeSaSession      Pointer to IKE SA Session to be used of Delete payload generation.
    561   @param[in]  NextPayload       The next paylaod type in NextPayload field of 
     561  @param[in]  NextPayload       The next paylaod type in NextPayload field of
    562562                                the Delete payload.
    563563  @param[in]  SpiSize           Size of the SPI in SPI size field of the Delete Payload.
     
    574574  IN UINT8             SpiSize,
    575575  IN UINT16            SpiNum,
    576   IN UINT8             *SpiBuf 
     576  IN UINT8             *SpiBuf
    577577  );
    578578
     
    580580  Generate the Configuration payload.
    581581
    582   This function generates a configuration payload defined in RFC 4306, but all the 
    583   fields in this payload are still in host order and need call Ikev2EncodePayload() 
     582  This function generates a configuration payload defined in RFC 4306, but all the
     583  fields in this payload are still in host order and need call Ikev2EncodePayload()
    584584  to convert those fields from the host order to network order beforing sending it.
    585585
    586586  @param[in]  IkeSaSession      Pointer to IKE SA Session to be used for Delete payload
    587587                                generation.
    588   @param[in]  NextPayload       The next paylaod type in NextPayload field of 
     588  @param[in]  NextPayload       The next paylaod type in NextPayload field of
    589589                                the Delete payload.
    590590  @param[in]  CfgType           The attribute type in the Configuration attribute.
     
    603603  Generate a Authentication Payload.
    604604
    605   This function is used for both Authentication generation and verification. When the 
    606   IsVerify is TRUE, it create a Auth Data for verification. This function choose the 
     605  This function is used for both Authentication generation and verification. When the
     606  IsVerify is TRUE, it create a Auth Data for verification. This function choose the
    607607  related IKE_SA_INIT Message for Auth data creation according to the IKE Session's type
    608608  and the value of IsVerify parameter.
    609609
    610610  @param[in]  IkeSaSession  Pointer to IKEV2_SA_SESSION related to.
    611   @param[in]  IdPayload     Pointer to the ID payload to be used for Authentication 
     611  @param[in]  IdPayload     Pointer to the ID payload to be used for Authentication
    612612                            payload generation.
    613   @param[in]  NextPayload   The type filled into the Authentication Payload next 
     613  @param[in]  NextPayload   The type filled into the Authentication Payload next
    614614                            payload field.
    615615  @param[in]  IsVerify      If it is TURE, the Authentication payload is used for
     
    628628
    629629/**
    630   Generate a Authentication Payload for Certificate Auth method. 
    631 
    632   This function has two functions. One is creating a local Authentication 
    633   Payload for sending and other is creating the remote Authentication data 
     630  Generate a Authentication Payload for Certificate Auth method.
     631
     632  This function has two functions. One is creating a local Authentication
     633  Payload for sending and other is creating the remote Authentication data
    634634  for verification when the IsVerify is TURE.
    635635
    636636  @param[in]  IkeSaSession      Pointer to IKEV2_SA_SESSION related to.
    637   @param[in]  IdPayload         Pointer to the ID payload to be used for Authentication 
     637  @param[in]  IdPayload         Pointer to the ID payload to be used for Authentication
    638638                                payload generation.
    639   @param[in]  NextPayload       The type filled into the Authentication Payload 
     639  @param[in]  NextPayload       The type filled into the Authentication Payload
    640640                                next payload field.
    641   @param[in]  IsVerify          If it is TURE, the Authentication payload is used 
     641  @param[in]  IsVerify          If it is TURE, the Authentication payload is used
    642642                                for verification.
    643   @param[in]  UefiPrivateKey    Pointer to the UEFI private key. Ignore it when 
     643  @param[in]  UefiPrivateKey    Pointer to the UEFI private key. Ignore it when
    644644                                verify the authenticate payload.
    645   @param[in]  UefiPrivateKeyLen The size of UefiPrivateKey in bytes. Ignore it 
     645  @param[in]  UefiPrivateKeyLen The size of UefiPrivateKey in bytes. Ignore it
    646646                                when verify the authenticate payload.
    647   @param[in]  UefiKeyPwd        Pointer to the password of UEFI private key. 
     647  @param[in]  UefiKeyPwd        Pointer to the password of UEFI private key.
    648648                                Ignore it when verify the authenticate payload.
    649   @param[in]  UefiKeyPwdLen     The size of UefiKeyPwd in bytes.Ignore it when 
     649  @param[in]  UefiKeyPwdLen     The size of UefiKeyPwd in bytes.Ignore it when
    650650                                verify the authenticate payload.
    651651
     
    671671  If the next payload is Responder TS, gereate TSi Payload. Otherwise, generate
    672672  TSr payload
    673  
     673
    674674  @param[in] ChildSa        Pointer to IKEV2_CHILD_SA_SESSION related to this TS payload.
    675   @param[in] NextPayload    The payload type presented in the NextPayload field 
     675  @param[in] NextPayload    The payload type presented in the NextPayload field
    676676                            of ID Payload header.
    677677  @param[in] IsTunnel       It indicates that if the Ts Payload is after the CP payload.
     
    697697  the COOKIE, return EFI_INVALID_PARAMETER.
    698698
    699   @param[in]      IkeNCookie    Pointer to the IKE_PAYLOAD which contians the 
     699  @param[in]      IkeNCookie    Pointer to the IKE_PAYLOAD which contians the
    700700                                Notify Cookie payload.
    701701                                the Notify payload.
     
    716716  Generate the Certificate payload or Certificate Request Payload.
    717717
    718   Since the Certificate Payload structure is same with Certificate Request Payload, 
     718  Since the Certificate Payload structure is same with Certificate Request Payload,
    719719  the only difference is that one contains the Certificate Data, other contains
    720   the acceptable certificateion CA. This function generate Certificate payload 
    721   or Certificate Request Payload defined in RFC 4306, but all the fields 
    722   in the payload are still in host order and need call Ikev2EncodePayload() 
     720  the acceptable certificateion CA. This function generate Certificate payload
     721  or Certificate Request Payload defined in RFC 4306, but all the fields
     722  in the payload are still in host order and need call Ikev2EncodePayload()
    723723  to convert those fields from the host order to network order beforing sending it.
    724724
    725   @param[in]  IkeSaSession      Pointer to IKE SA Session to be used of Delete payload 
     725  @param[in]  IkeSaSession      Pointer to IKE SA Session to be used of Delete payload
    726726                                generation.
    727   @param[in]  NextPayload       The next paylaod type in NextPayload field of 
     727  @param[in]  NextPayload       The next paylaod type in NextPayload field of
    728728                                the Delete payload.
    729729  @param[in]  Certificate       Pointer of buffer contains the certification data.
     
    748748  IN BOOLEAN           IsRequest
    749749  );
    750  
     750
    751751/**
    752752  General interface of payload encoding.
    753753
    754   This function encode the internal data structure into payload which 
    755   is defined in RFC 4306. The IkePayload->PayloadBuf used to store both the input 
    756   payload and converted payload. Only the SA payload use the interal structure 
    757   to store the attribute. Other payload use structure which is same with the RFC 
    758   defined, for this kind payloads just do host order to network order change of 
     754  This function encode the internal data structure into payload which
     755  is defined in RFC 4306. The IkePayload->PayloadBuf used to store both the input
     756  payload and converted payload. Only the SA payload use the interal structure
     757  to store the attribute. Other payload use structure which is same with the RFC
     758  defined, for this kind payloads just do host order to network order change of
    759759  some fields.
    760760
     
    780780  @param[in]      SessionCommon     Pointer to IKE Session Common to use for decoding.
    781781  @param[in, out] IkePayload        Pointer to IKE payload to be decode as input, and
    782                                     store the decoded result as output. 
     782                                    store the decoded result as output.
    783783
    784784  @retval EFI_INVALID_PARAMETER  Meet error when decode the SA payload.
     
    797797  This function decrpt the Encrypted IKE packet and put the result into IkePacket->PayloadBuf.
    798798
    799   @param[in]      SessionCommon       Pointer to IKEV2_SESSION_COMMON containing 
     799  @param[in]      SessionCommon       Pointer to IKEV2_SESSION_COMMON containing
    800800                                      some parameter used during decrypting.
    801   @param[in, out] IkePacket           Point to IKE_PACKET to be decrypted as input, 
     801  @param[in, out] IkePacket           Point to IKE_PACKET to be decrypted as input,
    802802                                      and the decrypted reslult as output.
    803803  @param[in, out] IkeType             The type of IKE. IKE_SA_TYPE, IKE_INFO_TYPE and
    804804                                      IKE_CHILD_TYPE are supportted.
    805805
    806   @retval EFI_INVALID_PARAMETER      If the IKE packet length is zero or the 
     806  @retval EFI_INVALID_PARAMETER      If the IKE packet length is zero or the
    807807                                     IKE packet length is not Algorithm Block Size
    808808                                     alignment.
    809809  @retval EFI_SUCCESS                Decrypt IKE packet successfully.
    810  
     810
    811811**/
    812812EFI_STATUS
     
    822822  This function encrypt IKE packet before sending it. The Encrypted IKE packet
    823823  is put in to IKEV2 Encrypted Payload.
    824  
     824
    825825  @param[in]        SessionCommon     Pointer to IKEV2_SESSION_COMMON related to the IKE packet.
    826826  @param[in, out]   IkePacket         Pointer to IKE packet to be encrypted.
     
    841841  This function put all Payloads into one payload then encrypt it if needed.
    842842
    843   @param[in]      SessionCommon      Pointer to IKEV2_SESSION_COMMON containing 
     843  @param[in]      SessionCommon      Pointer to IKEV2_SESSION_COMMON containing
    844844                                     some parameter used during IKE packet encoding.
    845   @param[in, out] IkePacket          Pointer to IKE_PACKET to be encoded as input, 
     845  @param[in, out] IkePacket          Pointer to IKE_PACKET to be encoded as input,
    846846                                     and the encoded reslult as output.
    847847  @param[in]      IkeType            The type of IKE. IKE_SA_TYPE, IKE_INFO_TYPE and
     
    862862  Decode the IKE packet.
    863863
    864   This function first decrypts the IKE packet if needed , then separats the whole 
     864  This function first decrypts the IKE packet if needed , then separats the whole
    865865  IKE packet from the IkePacket->PayloadBuf into IkePacket payload list.
    866  
    867   @param[in]      SessionCommon          Pointer to IKEV1_SESSION_COMMON containing 
     866
     867  @param[in]      SessionCommon          Pointer to IKEV1_SESSION_COMMON containing
    868868                                         some parameter used by IKE packet decoding.
    869   @param[in, out] IkePacket              The IKE Packet to be decoded on input, and 
     869  @param[in, out] IkePacket              The IKE Packet to be decoded on input, and
    870870                                         the decoded result on return.
    871871  @param[in]      IkeType                The type of IKE. IKE_SA_TYPE, IKE_INFO_TYPE and
     
    905905  @param[in]  SessionCommon     Pointer to IKEV1_SESSION_COMMON related to the IKE packet.
    906906  @param[in]  IkePacket         Pointer to IKE_PACKET to be sent out.
    907   @param[in]  IkeType           The type of IKE to point what's kind of the IKE 
    908                                 packet is to be sent out. IKE_SA_TYPE, IKE_INFO_TYPE 
     907  @param[in]  IkeType           The type of IKE to point what's kind of the IKE
     908                                packet is to be sent out. IKE_SA_TYPE, IKE_INFO_TYPE
    909909                                and IKE_CHILD_TYPE are supportted.
    910910
     
    924924  Callback function for the IKE life time is over.
    925925
    926   This function will mark the related IKE SA Session as deleting and trigger a 
     926  This function will mark the related IKE SA Session as deleting and trigger a
    927927  Information negotiation.
    928928
    929929  @param[in]    Event     The time out event.
    930930  @param[in]    Context   Pointer to data passed by caller.
    931  
     931
    932932**/
    933933VOID
     
    953953
    954954/**
    955   Generate a Key Exchange payload according to the DH group type and save the 
     955  Generate a Key Exchange payload according to the DH group type and save the
    956956  public Key into IkeSaSession IkeKey field.
    957957
    958958  @param[in, out] IkeSaSession    Pointer of the IKE_SA_SESSION.
    959   @param[in]      NextPayload     The payload type presented in the NextPayload field of Key 
     959  @param[in]      NextPayload     The payload type presented in the NextPayload field of Key
    960960                                  Exchange Payload header.
    961961
     
    965965IKE_PAYLOAD *
    966966Ikev2GenerateKePayload (
    967   IN OUT IKEV2_SA_SESSION *IkeSaSession, 
    968   IN     UINT8            NextPayload     
     967  IN OUT IKEV2_SA_SESSION *IkeSaSession,
     968  IN     UINT8            NextPayload
    969969  );
    970970
     
    973973
    974974  This function is the subfunction of Ikev1AssociateSpdEntry(). It is the call
    975   back function of IpSecVisitConfigData(). 
    976  
     975  back function of IpSecVisitConfigData().
     976
    977977
    978978  @param[in]  Type               Type of the input Config Selector.
    979   @param[in]  Selector           Pointer to the Configure Selector to be checked. 
    980   @param[in]  Data               Pointer to the Configure Selector's Data passed 
     979  @param[in]  Selector           Pointer to the Configure Selector to be checked.
     980  @param[in]  Data               Pointer to the Configure Selector's Data passed
    981981                                 from the caller.
    982982  @param[in]  SelectorSize       The buffer size of Selector.
     
    985985                                 SA Session in this context.
    986986
    987   @retval EFI_SUCCESS        The SPD Selector is not related to the Child SA Session. 
    988   @retval EFI_ABORTED        The SPD Selector is related to the Child SA session and 
     987  @retval EFI_SUCCESS        The SPD Selector is not related to the Child SA Session.
     988  @retval EFI_ABORTED        The SPD Selector is related to the Child SA session and
    989989                             set the ChildSaSession->Spd to point to this SPD Selector.
    990990
     
    10341034/**
    10351035  Parse the received Initial Exchange Packet.
    1036  
    1037   This function parse the SA Payload and Key Payload to find out the cryptographic 
    1038   suite for the further IKE negotiation and fill it into the IKE SA Session's 
     1036
     1037  This function parse the SA Payload and Key Payload to find out the cryptographic
     1038  suite for the further IKE negotiation and fill it into the IKE SA Session's
    10391039  CommonSession->SaParams.
    10401040
    10411041  @param[in, out]  IkeSaSession  Pointer to related IKEV2_SA_SESSION.
    10421042  @param[in]       SaPayload     The received packet.
    1043   @param[in]       Type          The received packet IKE header flag. 
     1043  @param[in]       Type          The received packet IKE header flag.
    10441044
    10451045  @retval          TRUE          If the SA proposal in Packet is acceptable.
     
    10561056/**
    10571057  Parse the received Authentication Exchange Packet.
    1058  
     1058
    10591059  This function parse the SA Payload and Key Payload to find out the cryptographic
    10601060  suite for the ESP and fill it into the Child SA Session's CommonSession->SaParams.
    1061  
    1062   @param[in, out]  ChildSaSession  Pointer to IKEV2_CHILD_SA_SESSION related to 
     1061
     1062  @param[in, out]  ChildSaSession  Pointer to IKEV2_CHILD_SA_SESSION related to
    10631063                                   this Authentication Exchange.
    10641064  @param[in]       SaPayload       The received packet.
    1065   @param[in]       Type            The IKE header's flag of received packet . 
    1066  
     1065  @param[in]       Type            The IKE header's flag of received packet .
     1066
    10671067  @retval          TRUE            If the SA proposal in Packet is acceptable.
    10681068  @retval          FALSE           If the SA proposal in Packet is not acceptable.
     
    10791079  Generate Key buffer from fragments.
    10801080
    1081   If the digest length of specified HashAlgId is larger than or equal with the 
    1082   required output key length, derive the key directly. Otherwise, Key Material 
    1083   needs to be PRF-based concatenation according to 2.13 of RFC 4306: 
     1081  If the digest length of specified HashAlgId is larger than or equal with the
     1082  required output key length, derive the key directly. Otherwise, Key Material
     1083  needs to be PRF-based concatenation according to 2.13 of RFC 4306:
    10841084  prf+ (K,S) = T1 | T2 | T3 | T4 | ..., T1 = prf (K, S | 0x01),
    10851085  T2 = prf (K, T1 | S | 0x02), T3 = prf (K, T2 | S | 0x03),T4 = prf (K, T3 | S | 0x04)
    10861086  then derive the key from this key material.
    1087  
     1087
    10881088  @param[in]       HashAlgId        The Hash Algorithm ID used to generate key.
    10891089  @param[in]       HashKey          Pointer to a key buffer which contains hash key.
    10901090  @param[in]       HashKeyLength    The length of HashKey in bytes.
    1091   @param[in, out]  OutputKey        Pointer to buffer which is used to receive the 
     1091  @param[in, out]  OutputKey        Pointer to buffer which is used to receive the
    10921092                                    output key.
    10931093  @param[in]       OutputKeyLength  The length of OutPutKey buffer.
     
    11161116
    11171117  ChildSaSession->SpdSelector stores the real Spdselector for its SA. Sometime,
    1118   the SpdSelector in ChildSaSession is more accurated or the scope is smaller 
     1118  the SpdSelector in ChildSaSession is more accurated or the scope is smaller
    11191119  than the one in ChildSaSession->Spd, especially for the tunnel mode.
    1120    
     1120
    11211121  @param[in, out]  ChildSaSession  Pointer to IKEV2_CHILD_SA_SESSION related to.
    1122  
     1122
    11231123**/
    11241124VOID
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IpSecConfigImpl.c

    r48674 r58466  
    9898  to the internal data structure.
    9999
    100   This founction is called by IpSecConfigInitialize() that is to intialize the 
     100  This founction is called by IpSecConfigInitialize() that is to intialize the
    101101  IPsecConfiguration Protocol.
    102102
     
    122122  @retval  TRUE    The specified AddressInfo is in the AddressInfoList.
    123123  @retval  FALSE   The specified AddressInfo is not in the AddressInfoList.
    124  
     124
    125125**/
    126126BOOLEAN
     
    153153          &AddressInfoList[Index].Address,
    154154          sizeof (EFI_IP_ADDRESS)
    155           ) == 0 && 
     155          ) == 0 &&
    156156          AddressInfo->PrefixLength == AddressInfoList[Index].PrefixLength
    157           ) { 
     157          ) {
    158158       return TRUE;
    159159     }
     
    161161  return FALSE;
    162162}
    163  
     163
    164164/**
    165165  Compare two SPD Selectors.
    166166
    167167  Compare two SPD Selector by the fields of LocalAddressCount/RemoteAddressCount/
    168   NextLayerProtocol/LocalPort/LocalPortRange/RemotePort/RemotePortRange and the 
     168  NextLayerProtocol/LocalPort/LocalPortRange/RemotePort/RemotePortRange and the
    169169  Local Addresses and remote Addresses.
    170170
     
    174174  @retval  TRUE    This two Selector have the same value in above fields.
    175175  @retval  FALSE   Not all above fields have the same value in these two Selectors.
    176  
     176
    177177**/
    178178BOOLEAN
     
    194194  // Compare the LocalAddressCount/RemoteAddressCount/NextLayerProtocol/
    195195  // LocalPort/LocalPortRange/RemotePort/RemotePortRange fields in the
    196   // two Spdselectors. Since the SPD supports two directions, it needs to 
     196  // two Spdselectors. Since the SPD supports two directions, it needs to
    197197  // compare two directions.
    198198  //
     
    210210    return IsMatch;
    211211  }
    212  
     212
    213213  //
    214214  // Compare the all LocalAddress fields in the two Spdselectors.
    215   // First, SpdSel1->LocalAddress to SpdSel2->LocalAddress && Compare 
     215  // First, SpdSel1->LocalAddress to SpdSel2->LocalAddress && Compare
    216216  // SpdSel1->RemoteAddress to SpdSel2->RemoteAddress. If all match, return
    217217  // TRUE.
     
    264264  }
    265265  //
    266   // Finish the one direction compare. If it is matched, return; otherwise, 
     266  // Finish the one direction compare. If it is matched, return; otherwise,
    267267  // compare the other direction.
    268268  //
     
    271271  }
    272272  //
    273   // Secondly, the SpdSel1->LocalAddress doesn't equal to  SpdSel2->LocalAddress and 
     273  // Secondly, the SpdSel1->LocalAddress doesn't equal to  SpdSel2->LocalAddress and
    274274  // SpdSel1->RemoteAddress doesn't equal to SpdSel2->RemoteAddress. Try to compare
    275275  // the RemoteAddress to LocalAddress.
     
    329329
    330330  Compare two SPD Selector by the fields of LocalAddressCount/RemoteAddressCount/
    331   NextLayerProtocol/LocalPort/LocalPortRange/RemotePort/RemotePortRange and the 
     331  NextLayerProtocol/LocalPort/LocalPortRange/RemotePort/RemotePortRange and the
    332332  Local Addresses and remote Addresses.
    333333
     
    336336
    337337  @retval  TRUE    The first SPD Selector is subordinate Selector of second SPD Selector.
    338   @retval  FALSE   The first SPD Selector is not subordinate Selector of second 
     338  @retval  FALSE   The first SPD Selector is not subordinate Selector of second
    339339                   SPD Selector.
    340  
     340
    341341**/
    342342BOOLEAN
     
    358358  // Compare the LocalAddressCount/RemoteAddressCount/NextLayerProtocol/
    359359  // LocalPort/LocalPortRange/RemotePort/RemotePortRange fields in the
    360   // two Spdselectors. Since the SPD supports two directions, it needs to 
     360  // two Spdselectors. Since the SPD supports two directions, it needs to
    361361  // compare two directions.
    362362  //
     
    371371    IsMatch = FALSE;
    372372  }
    373  
     373
    374374  //
    375375  // Compare the all LocalAddress fields in the two Spdselectors.
    376   // First, SpdSel1->LocalAddress to SpdSel2->LocalAddress && Compare 
     376  // First, SpdSel1->LocalAddress to SpdSel2->LocalAddress && Compare
    377377  // SpdSel1->RemoteAddress to SpdSel2->RemoteAddress. If all match, return
    378378  // TRUE.
     
    406406    return IsMatch;
    407407  }
    408  
     408
    409409  //
    410410  //
     
    413413  // Compare the LocalAddressCount/RemoteAddressCount/NextLayerProtocol/
    414414  // LocalPort/LocalPortRange/RemotePort/RemotePortRange fields in the
    415   // two Spdselectors. Since the SPD supports two directions, it needs to 
     415  // two Spdselectors. Since the SPD supports two directions, it needs to
    416416  // compare two directions.
    417417  //
     
    428428    return IsMatch;
    429429  }
    430  
     430
    431431  //
    432432  // Compare the all LocalAddress fields in the two Spdselectors.
    433   // First, SpdSel1->LocalAddress to SpdSel2->LocalAddress && Compare 
     433  // First, SpdSel1->LocalAddress to SpdSel2->LocalAddress && Compare
    434434  // SpdSel1->RemoteAddress to SpdSel2->RemoteAddress. If all match, return
    435435  // TRUE.
     
    459459  }
    460460  return IsMatch;
    461  
     461
    462462}
    463463
     
    470470  @retval  TRUE    This two Selectors have the same SA ID.
    471471  @retval  FALSE   This two Selecotrs don't have the same SA ID.
    472  
     472
    473473**/
    474474BOOLEAN
     
    501501  @retval  TRUE    This two Selectors have the same PAD ID.
    502502  @retval  FALSE   This two Selecotrs don't have the same PAD ID.
    503  
     503
    504504**/
    505505BOOLEAN
     
    590590  BOOLEAN                   IsZero;
    591591  EFI_IPSEC_CONFIG_SELECTOR ZeroSelector;
    592  
     592
    593593  IsZero    = FALSE;
    594594
     
    637637  @param[in, out] DstSel             Pointer of Destination SPD Selector.
    638638  @param[in]      SrcSel             Pointer of Source SPD Selector.
    639   @param[in, out] Size               The size of the Destination SPD Selector. If it 
    640                                      not NULL and its value less than the size of 
    641                                      Source SPD Selector, the value of Source SPD 
     639  @param[in, out] Size               The size of the Destination SPD Selector. If it
     640                                     not NULL and its value less than the size of
     641                                     Source SPD Selector, the value of Source SPD
    642642                                     Selector's size will be passed to caller by this
    643643                                     parameter.
    644644
    645645  @retval EFI_INVALID_PARAMETER  If the Destination or Source SPD Selector is NULL
    646   @retval EFI_BUFFER_TOO_SMALL   If the input Size is less than size of the Source SPD Selector. 
     646  @retval EFI_BUFFER_TOO_SMALL   If the input Size is less than size of the Source SPD Selector.
    647647  @retval EFI_SUCCESS            Copy Source SPD Selector to the Destination SPD
    648648                                 Selector successfully.
     
    703703  @param[in, out] DstSel             Pointer of Destination SA ID.
    704704  @param[in]      SrcSel             Pointer of Source SA ID.
    705   @param[in, out] Size               The size of the Destination SA ID. If it 
    706                                      not NULL and its value less than the size of 
    707                                      Source SA ID, the value of Source SA ID's size 
     705  @param[in, out] Size               The size of the Destination SA ID. If it
     706                                     not NULL and its value less than the size of
     707                                     Source SA ID, the value of Source SA ID's size
    708708                                     will be passed to caller by this parameter.
    709709
    710710  @retval EFI_INVALID_PARAMETER  If the Destination or Source SA ID is NULL.
    711   @retval EFI_BUFFER_TOO_SMALL   If the input Size less than size of source SA ID. 
     711  @retval EFI_BUFFER_TOO_SMALL   If the input Size less than size of source SA ID.
    712712  @retval EFI_SUCCESS            Copy Source SA ID  to the Destination SA ID successfully.
    713713
     
    745745  @param[in, out] DstSel             Pointer of Destination PAD ID.
    746746  @param[in]      SrcSel             Pointer of Source PAD ID.
    747   @param[in, out] Size               The size of the Destination PAD ID. If it 
    748                                      not NULL and its value less than the size of 
    749                                      Source PAD ID, the value of Source PAD ID's size 
     747  @param[in, out] Size               The size of the Destination PAD ID. If it
     748                                     not NULL and its value less than the size of
     749                                     Source PAD ID, the value of Source PAD ID's size
    750750                                     will be passed to caller by this parameter.
    751751
     
    783783
    784784/**
    785   Fix the value of some members of SPD Selector. 
    786 
    787   This function is called by IpSecCopyPolicyEntry()which copy the Policy 
    788   Entry into the Variable. Since some members in SPD Selector are pointers, 
    789   a physical address to relative address convertion is required before copying 
     785  Fix the value of some members of SPD Selector.
     786
     787  This function is called by IpSecCopyPolicyEntry()which copy the Policy
     788  Entry into the Variable. Since some members in SPD Selector are pointers,
     789  a physical address to relative address convertion is required before copying
    790790  this SPD entry into the variable.
    791791
     
    818818
    819819/**
    820   Fix the value of some members of SA ID. 
    821 
    822   This function is called by IpSecCopyPolicyEntry()which copy the Policy 
    823   Entry into the Variable. Since some members in SA ID are pointers, 
    824   a physical address to relative address conversion is required before copying 
     820  Fix the value of some members of SA ID.
     821
     822  This function is called by IpSecCopyPolicyEntry()which copy the Policy
     823  Entry into the Variable. Since some members in SA ID are pointers,
     824  a physical address to relative address conversion is required before copying
    825825  this SAD into the variable.
    826826
     
    859859
    860860/**
    861   Fix the value of some members of PAD ID. 
    862 
    863   This function is called by IpSecCopyPolicyEntry()which copy the Policy 
    864   Entry into the Variable. Since some members in PAD ID are pointers, 
     861  Fix the value of some members of PAD ID.
     862
     863  This function is called by IpSecCopyPolicyEntry()which copy the Policy
     864  Entry into the Variable. Since some members in PAD ID are pointers,
    865865  a physical address to relative address conversion is required before copying
    866866  this PAD into the variable.
     
    891891
    892892/**
    893   Recover the value of some members of SPD Selector. 
     893  Recover the value of some members of SPD Selector.
    894894
    895895  This function is corresponding to FixSpdEntry(). It recovers the value of members
     
    919919    }
    920920  }
    921  
    922 }
    923 
    924 /**
    925   Recover the value of some members of SA ID. 
     921
     922}
     923
     924/**
     925  Recover the value of some members of SA ID.
    926926
    927927  This function is corresponding to FixSadEntry(). It recovers the value of members
     
    962962
    963963/**
    964   Recover the value of some members of PAD ID. 
     964  Recover the value of some members of PAD ID.
    965965
    966966  This function is corresponding to FixPadEntry(). It recovers the value of members
     
    994994  Set the security policy information for the EFI IPsec driver.
    995995
    996   The IPsec configuration data has a unique selector/identifier separately to 
     996  The IPsec configuration data has a unique selector/identifier separately to
    997997  identify a data entry.
    998998
    999   @param[in]  Selector           Pointer to an entry selector on operated 
    1000                                  configuration data specified by DataType. 
    1001                                  A NULL Selector causes the entire specified-type 
     999  @param[in]  Selector           Pointer to an entry selector on operated
     1000                                 configuration data specified by DataType.
     1001                                 A NULL Selector causes the entire specified-type
    10021002                                 configuration information to be flushed.
    1003   @param[in]  Data               The data buffer to be set. The structure 
     1003  @param[in]  Data               The data buffer to be set. The structure
    10041004                                 of the data buffer should be EFI_IPSEC_SPD_DATA.
    1005   @param[in]  Context            Pointer to one entry selector that describes 
    1006                                  the expected position the new data entry will 
     1005  @param[in]  Context            Pointer to one entry selector that describes
     1006                                 the expected position the new data entry will
    10071007                                 be added. If Context is NULL, the new entry will
    10081008                                 be appended the end of database.
    10091009
    10101010  @retval EFI_INVALID_PARAMETER  One or more of the following are TRUE:
    1011                                    - Selector is not NULL and its LocalAddress 
     1011                                   - Selector is not NULL and its LocalAddress
    10121012                                     is NULL or its RemoteAddress is NULL.
    1013                                    - Data is not NULL and its Action is Protected 
     1013                                   - Data is not NULL and its Action is Protected
    10141014                                     and its plolicy is NULL.
    10151015                                   - Data is not NULL, its Action is not protected,
    10161016                                     and its policy is not NULL.
    1017                                    - The Action of Data is Protected, its policy 
     1017                                   - The Action of Data is Protected, its policy
    10181018                                     mode is Tunnel, and its tunnel option is NULL.
    1019                                    - The Action of Data is protected and its policy 
     1019                                   - The Action of Data is protected and its policy
    10201020                                     mode is not Tunnel and it tunnel option is not NULL.
    10211021  @retval EFI_OUT_OF_RESOURCED  The required system resource could not be allocated.
     
    10831083    SpdEntry = IPSEC_SPD_ENTRY_FROM_LIST (Entry);
    10841084
    1085     if (SpdSel == NULL || 
     1085    if (SpdSel == NULL ||
    10861086        CompareSpdSelector ((EFI_IPSEC_CONFIG_SELECTOR *) SpdEntry->Selector, (EFI_IPSEC_CONFIG_SELECTOR *) SpdSel)
    10871087        ) {
     
    10961096      //
    10971097      SpdSas = &SpdEntry->Data->Sas;
    1098      
     1098
    10991099      //
    11001100      // TODO: Deleted the related SAs.
     
    11041104        SadEntry->Data->SpdEntry  = NULL;
    11051105      }
    1106      
     1106
    11071107      //
    11081108      // Free the existed SPD entry
     
    12061206          (EFI_IPSEC_CONFIG_SELECTOR *)SpdEntry->Selector,
    12071207          NULL
    1208           );             
     1208          );
    12091209      }
    12101210    }
     
    12211221  Set the security association information for the EFI IPsec driver.
    12221222
    1223   The IPsec configuration data has a unique selector/identifier separately to 
     1223  The IPsec configuration data has a unique selector/identifier separately to
    12241224  identify a data entry.
    12251225
    1226   @param[in]  Selector           Pointer to an entry selector on operated 
    1227                                  configuration data specified by DataType. 
    1228                                  A NULL Selector causes the entire specified-type 
     1226  @param[in]  Selector           Pointer to an entry selector on operated
     1227                                 configuration data specified by DataType.
     1228                                 A NULL Selector causes the entire specified-type
    12291229                                 configuration information to be flushed.
    1230   @param[in]  Data               The data buffer to be set. The structure 
     1230  @param[in]  Data               The data buffer to be set. The structure
    12311231                                 of the data buffer should be EFI_IPSEC_SA_DATA.
    1232   @param[in]  Context            Pointer to one entry selector which describes 
    1233                                  the expected position the new data entry will 
     1232  @param[in]  Context            Pointer to one entry selector which describes
     1233                                 the expected position the new data entry will
    12341234                                 be added. If Context is NULL,the new entry will
    12351235                                 be appended the end of database.
     
    12571257  LIST_ENTRY        *EntryInsertBefore;
    12581258  UINTN             SadEntrySize;
    1259  
     1259
    12601260  SaId          = (Selector == NULL) ? NULL : &Selector->SaId;
    12611261  SaData        = (Data == NULL) ? NULL : (EFI_IPSEC_SA_DATA2 *) Data;
     
    12751275    SadEntry = IPSEC_SAD_ENTRY_FROM_LIST (Entry);
    12761276
    1277     if (SaId == NULL || 
     1277    if (SaId == NULL ||
    12781278        CompareSaId (
    12791279          (EFI_IPSEC_CONFIG_SELECTOR *) SadEntry->Id,
     
    13261326  SadEntrySize  = ALIGN_VARIABLE (SadEntrySize + sizeof (EFI_IPSEC_SA_ID));
    13271327  SadEntrySize  = ALIGN_VARIABLE (SadEntrySize + sizeof (IPSEC_SAD_DATA));
    1328  
     1328
    13291329  if (SaId->Proto == EfiIPsecAH) {
    13301330    SadEntrySize += SaData->AlgoInfo.AhAlgoInfo.AuthKeyLength;
     
    13831383    if (SadEntry->Data->AlgoInfo.EspAlgoInfo.EncKeyLength != 0) {
    13841384      SadEntry->Data->AlgoInfo.EspAlgoInfo.EncKey = (VOID *) ALIGN_POINTER (
    1385                                                                ((UINT8 *) (SadEntry->Data + 1) + 
     1385                                                               ((UINT8 *) (SadEntry->Data + 1) +
    13861386                                                                 SadEntry->Data->AlgoInfo.EspAlgoInfo.AuthKeyLength),
    13871387                                                                 sizeof (UINTN)
     
    14571457  Set the peer authorization configuration information for the EFI IPsec driver.
    14581458
    1459   The IPsec configuration data has a unique selector/identifier separately to 
     1459  The IPsec configuration data has a unique selector/identifier separately to
    14601460  identify a data entry.
    14611461
    1462   @param[in]  Selector           Pointer to an entry selector on operated 
    1463                                  configuration data specified by DataType. 
    1464                                  A NULL Selector causes the entire specified-type 
     1462  @param[in]  Selector           Pointer to an entry selector on operated
     1463                                 configuration data specified by DataType.
     1464                                 A NULL Selector causes the entire specified-type
    14651465                                 configuration information to be flushed.
    1466   @param[in]  Data               The data buffer to be set. The structure 
     1466  @param[in]  Data               The data buffer to be set. The structure
    14671467                                 of the data buffer should be EFI_IPSEC_PAD_DATA.
    1468   @param[in]  Context            Pointer to one entry selector that describes 
    1469                                  the expected position the new data entry will 
     1468  @param[in]  Context            Pointer to one entry selector that describes
     1469                                 the expected position the new data entry will
    14701470                                 be added. If Context is NULL, the new entry will
    14711471                                 be appended the end of database.
     
    14911491  LIST_ENTRY          *EntryInsertBefore;
    14921492  UINTN               PadEntrySize;
    1493    
     1493
    14941494  PadId         = (Selector == NULL) ? NULL : &Selector->PadId;
    14951495  PadData       = (Data == NULL) ? NULL : (EFI_IPSEC_PAD_DATA *) Data;
     
    15091509    PadEntry = IPSEC_PAD_ENTRY_FROM_LIST (Entry);
    15101510
    1511     if (PadId == NULL || 
     1511    if (PadId == NULL ||
    15121512        ComparePadId ((EFI_IPSEC_CONFIG_SELECTOR *) PadEntry->Id, (EFI_IPSEC_CONFIG_SELECTOR *) PadId)
    15131513        ) {
     
    16091609
    16101610/**
    1611   This function lookup the data entry from IPsec SPD. Return the configuration 
     1611  This function lookup the data entry from IPsec SPD. Return the configuration
    16121612  value of the specified SPD Entry.
    16131613
    1614   @param[in]      Selector      Pointer to an entry selector which is an identifier 
     1614  @param[in]      Selector      Pointer to an entry selector which is an identifier
    16151615                                of the SPD entry.
    16161616  @param[in, out] DataSize      On output the size of data returned in Data.
    1617   @param[out]     Data          The buffer to return the contents of the IPsec 
    1618                                 configuration data. The type of the data buffer 
    1619                                 is associated with the DataType. 
    1620  
     1617  @param[out]     Data          The buffer to return the contents of the IPsec
     1618                                configuration data. The type of the data buffer
     1619                                is associated with the DataType.
     1620
    16211621  @retval EFI_SUCCESS           The specified configuration data was obtained successfully.
    16221622  @retval EFI_INVALID_PARAMETER Data is NULL and *DataSize is not zero.
     
    17101710
    17111711/**
    1712   This function lookup the data entry from IPsec SAD. Return the configuration 
     1712  This function lookup the data entry from IPsec SAD. Return the configuration
    17131713  value of the specified SAD Entry.
    17141714
    1715   @param[in]      Selector      Pointer to an entry selector which is an identifier 
     1715  @param[in]      Selector      Pointer to an entry selector which is an identifier
    17161716                                of the SAD entry.
    17171717  @param[in, out] DataSize      On output, the size of data returned in Data.
    1718   @param[out]     Data          The buffer to return the contents of the IPsec 
    1719                                 configuration data. The type of the data buffer 
    1720                                 is associated with the DataType. 
    1721  
     1718  @param[out]     Data          The buffer to return the contents of the IPsec
     1719                                configuration data. The type of the data buffer
     1720                                is associated with the DataType.
     1721
    17221722  @retval EFI_SUCCESS           The specified configuration data was obtained successfully.
    17231723  @retval EFI_NOT_FOUND         The configuration data specified by Selector is not found.
     
    17601760      // |AuthKey
    17611761      // |EncryptKey  (Optional)
    1762       // |SpdSelector (Optional)     
    1763       // 
     1762      // |SpdSelector (Optional)
     1763      //
    17641764      RequiredSize  = ALIGN_VARIABLE (sizeof (EFI_IPSEC_SA_DATA2));
    17651765
     
    17741774        RequiredSize += SIZE_OF_SPD_SELECTOR (SadEntry->Data->SpdSelector);
    17751775      }
    1776      
     1776
    17771777      if (*DataSize < RequiredSize) {
    17781778        *DataSize = RequiredSize;
    17791779        return EFI_BUFFER_TOO_SMALL;
    17801780      }
    1781      
     1781
    17821782      //
    17831783      // Fill the data fields of SAD entry.
     
    18721872                                SIZE_OF_SPD_SELECTOR (SadEntry->Data->SpdSelector)
    18731873                                );
    1874        
     1874
    18751875        DuplicateSpdSelector (
    18761876          (EFI_IPSEC_CONFIG_SELECTOR *) SaData->SpdSelector,
     
    18941894
    18951895/**
    1896   This function lookup the data entry from IPsec PAD. Return the configuration 
     1896  This function lookup the data entry from IPsec PAD. Return the configuration
    18971897  value of the specified PAD Entry.
    18981898
    1899   @param[in]      Selector      Pointer to an entry selector which is an identifier 
     1899  @param[in]      Selector      Pointer to an entry selector which is an identifier
    19001900                                of the PAD entry.
    19011901  @param[in, out] DataSize      On output the size of data returned in Data.
    1902   @param[out]     Data          The buffer to return the contents of the IPsec 
    1903                                 configuration data. The type of the data buffer 
    1904                                 is associated with the DataType. 
    1905  
     1902  @param[out]     Data          The buffer to return the contents of the IPsec
     1903                                configuration data. The type of the data buffer
     1904                                is associated with the DataType.
     1905
    19061906  @retval EFI_SUCCESS           The specified configuration data was obtained successfully.
    19071907  @retval EFI_NOT_FOUND         The configuration data specified by Selector is not found.
     
    20662066/**
    20672067  Calculate the a whole size of IPSEC_SPD_DATA which includes the buffer size pointed
    2068   to by the pointer members and the buffer size used by the Sa List. 
     2068  to by the pointer members and the buffer size used by the Sa List.
    20692069
    20702070  @param[in]  SpdData       Pointer to the specified IPSEC_SPD_DATA.
     
    21022102
    21032103  Get the all variables which start with the string contained in VaraiableName.
    2104   Since all IPsec related variable store in continual space, those kinds of 
    2105   variable can be searched by the EfiGetNextVariableName. Those variables also are 
     2104  Since all IPsec related variable store in continual space, those kinds of
     2105  variable can be searched by the EfiGetNextVariableName. Those variables also are
    21062106  returned in a continual buffer.
    2107  
     2107
    21082108  @param[in]      VariableName          Pointer to a specified Variable Name.
    21092109  @param[in]      VendorGuid            Pointer to a specified Vendor Guid.
    2110   @param[in]      Attributes            Point to memory location to return the attributes 
    2111                                         of variable. If the point is NULL, the parameter 
     2110  @param[in]      Attributes            Point to memory location to return the attributes
     2111                                        of variable. If the point is NULL, the parameter
    21122112                                        would be ignored.
    2113   @param[in, out] DataSize              As input, point to the maximum size of return 
    2114                                         Data-Buffer. As output, point to the actual 
     2113  @param[in, out] DataSize              As input, point to the maximum size of return
     2114                                        Data-Buffer. As output, point to the actual
    21152115                                        size of the returned Data-Buffer.
    21162116  @param[in]      Data                  Point to return Data-Buffer.
    2117        
     2117
    21182118  @retval  EFI_ABORTED           If the Variable size which contained in the variable
    2119                                  structure doesn't match the variable size obtained 
     2119                                 structure doesn't match the variable size obtained
    21202120                                 from the EFIGetVariable.
    21212121  @retval  EFI_BUFFER_TOO_SMALL  The DataSize is too small for the result. DataSize has
    2122                                  been updated with the size needed to complete the request.   
     2122                                 been updated with the size needed to complete the request.
    21232123  @retval  EFI_SUCCESS           The function completed successfully.
    21242124  @retval  others                Other errors found during the variable getting.
     
    21532153  VariableNameI       = AllocateZeroPool (VariableNameISize);
    21542154  ASSERT (VariableNameI != NULL);
    2155  
     2155
    21562156  //
    21572157  // Construct the varible name of ipsecconfig meta data.
     
    22922292                            Null-Terminated Unicode String.
    22932293  @param[in]  VendorGuid    Unify identifier for vendor.
    2294   @param[in]  Attributes    Point to memory location to return the attributes of 
     2294  @param[in]  Attributes    Point to memory location to return the attributes of
    22952295                            variable. If the point is NULL, the parameter would be ignored.
    22962296  @param[in]  DataSize      The size in bytes of Data-Buffer.
     
    22992299  @retval  EFI_SUCCESS      The firmware successfully stored the variable and its data, as
    23002300                            defined by the Attributes.
    2301   @retval  others           Storing the variables failed.     
     2301  @retval  others           Storing the variables failed.
    23022302
    23032303**/
     
    23292329    return Status;
    23302330  }
    2331  
     2331
    23322332  //
    23332333  // "VariableName + Info/0001/0002/... + NULL"
     
    23462346  UnicodeSPrint (VariableNameI, VariableNameSize, L"%s%s", VariableName, L"Info");
    23472347  MaximumVariableSize -= VariableNameSize;
    2348  
     2348
    23492349  IpSecVariableInfo.VariableCount       = (UINT32) ((DataSize + (UINTN) MaximumVariableSize - 1) / (UINTN) MaximumVariableSize);
    23502350  IpSecVariableInfo.VariableSize        = (UINT32) DataSize;
     
    23712371    // The index of variable name begin from 0001, and the varaible name
    23722372    // likes "VariableName0001", "VaraiableName0002"....
    2373     // 
     2373    //
    23742374    UnicodeSPrint (VariableNameI, VariableNameSize, L"%s%04d", VariableName, VariableIndex + 1);
    23752375    Status = gRT->SetVariable (
     
    23982398
    23992399/**
    2400   Return the configuration value for the EFI IPsec driver. 
     2400  Return the configuration value for the EFI IPsec driver.
    24012401
    24022402  This function lookup the data entry from IPsec database or IKEv2 configuration
    24032403  information. The expected data type and unique identification are described in
    2404   DataType and Selector parameters.       
     2404  DataType and Selector parameters.
    24052405
    24062406  @param[in]      This          Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
    24072407  @param[in]      DataType      The type of data to retrieve.
    2408   @param[in]      Selector      Pointer to an entry selector that is an identifier of the IPsec 
     2408  @param[in]      Selector      Pointer to an entry selector that is an identifier of the IPsec
    24092409                                configuration data entry.
    24102410  @param[in, out] DataSize      On output the size of data returned in Data.
    2411   @param[out]     Data          The buffer to return the contents of the IPsec configuration data. 
    2412                                 The type of the data buffer associated with the DataType. 
    2413  
     2411  @param[out]     Data          The buffer to return the contents of the IPsec configuration data.
     2412                                The type of the data buffer associated with the DataType.
     2413
    24142414  @retval EFI_SUCCESS           The specified configuration data was obtained successfully.
    24152415  @retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
     
    24512451/**
    24522452  Set the security association, security policy and peer authorization configuration
    2453   information for the EFI IPsec driver. 
     2453  information for the EFI IPsec driver.
    24542454
    24552455  This function is used to set the IPsec configuration information of type DataType for
     
    24582458  a data entry. The selector structure depends on DataType's definition.
    24592459  Using SetData() with a Data of NULL causes the IPsec configuration data entry identified
    2460   by DataType and Selector to be deleted.       
     2460  by DataType and Selector to be deleted.
    24612461
    24622462  @param[in] This               Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
    24632463  @param[in] DataType           The type of data to be set.
    2464   @param[in] Selector           Pointer to an entry selector on operated configuration data 
    2465                                 specified by DataType. A NULL Selector causes the entire 
     2464  @param[in] Selector           Pointer to an entry selector on operated configuration data
     2465                                specified by DataType. A NULL Selector causes the entire
    24662466                                specified-type configuration information to be flushed.
    2467   @param[in] Data               The data buffer to be set. The structure of the data buffer is 
     2467  @param[in] Data               The data buffer to be set. The structure of the data buffer is
    24682468                                associated with the DataType.
    24692469  @param[in] InsertBefore       Pointer to one entry selector which describes the expected
    24702470                                position the new data entry will be added. If InsertBefore is NULL,
    24712471                                the new entry will be appended to the end of the database.
    2472  
     2472
    24732473  @retval EFI_SUCCESS           The specified configuration entry data was set successfully.
    24742474  @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
     
    24972497    return EFI_UNSUPPORTED;
    24982498  }
    2499  
     2499
    25002500  Status = mSetPolicyEntry[DataType](Selector, Data, InsertBefore);
    25012501
     
    25112511
    25122512/**
    2513   Enumerates the current selector for IPsec configuration data entry. 
     2513  Enumerates the current selector for IPsec configuration data entry.
    25142514
    25152515  This function is called multiple times to retrieve the entry Selector in IPsec
    2516   configuration database. On each call to GetNextSelector(), the next entry 
     2516  configuration database. On each call to GetNextSelector(), the next entry
    25172517  Selector are retrieved into the output interface.
    2518  
    2519   If the entire IPsec configuration database has been iterated, the error 
     2518
     2519  If the entire IPsec configuration database has been iterated, the error
    25202520  EFI_NOT_FOUND is returned.
    2521   If the Selector buffer is too small for the next Selector copy, an 
    2522   EFI_BUFFER_TOO_SMALL error is returned, and SelectorSize is updated to reflect 
     2521  If the Selector buffer is too small for the next Selector copy, an
     2522  EFI_BUFFER_TOO_SMALL error is returned, and SelectorSize is updated to reflect
    25232523  the size of buffer needed.
    25242524
    25252525  On the initial call to GetNextSelector() to start the IPsec configuration database
    2526   search, a pointer to the buffer with all zero value is passed in Selector. Calls 
    2527   to SetData() between calls to GetNextSelector may produce unpredictable results.         
     2526  search, a pointer to the buffer with all zero value is passed in Selector. Calls
     2527  to SetData() between calls to GetNextSelector may produce unpredictable results.
    25282528
    25292529  @param[in]      This          Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
    25302530  @param[in]      DataType      The type of IPsec configuration data to retrieve.
    25312531  @param[in, out] SelectorSize  The size of the Selector buffer.
    2532   @param[in, out] Selector      On input, supplies the pointer to last Selector that was 
     2532  @param[in, out] Selector      On input, supplies the pointer to last Selector that was
    25332533                                returned by GetNextSelector().
    25342534                                On output, returns one copy of the current entry Selector
    2535                                 of a given DataType. 
    2536  
     2535                                of a given DataType.
     2536
    25372537  @retval EFI_SUCCESS           The specified configuration data was obtained successfully.
    25382538  @retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
     
    25432543  @retval EFI_UNSUPPORTED       The specified DataType is not supported.
    25442544  @retval EFI_BUFFER_TOO_SMALL  The SelectorSize is too small for the result. This parameter
    2545                                 has been updated with the size needed to complete the search 
     2545                                has been updated with the size needed to complete the search
    25462546                                request.
    25472547
     
    25922592/**
    25932593  Register an event that is to be signaled whenever a configuration process on the
    2594   specified IPsec configuration information is done. 
     2594  specified IPsec configuration information is done.
    25952595
    25962596  The register function is not surpport now and always returns EFI_UNSUPPORTED.
    2597  
     2597
    25982598  @param[in] This               Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
    25992599  @param[in] DataType           The type of data to be registered the event for.
    26002600  @param[in] Event              The event to be registered.
    2601  
     2601
    26022602  @retval EFI_SUCCESS           The event is registered successfully.
    26032603  @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
     
    26202620/**
    26212621  Remove the specified event that was previously registered on the specified IPsec
    2622   configuration data. 
     2622  configuration data.
    26232623
    26242624  This function is not support now and alwasy return EFI_UNSUPPORTED.
     
    26272627  @param[in] DataType           The configuration data type to remove the registered event for.
    26282628  @param[in] Event              The event to be unregistered.
    2629  
     2629
    26302630  @retval EFI_SUCCESS           The event was removed successfully.
    2631   @retval EFI_NOT_FOUND         The Event specified by DataType could not be found in the 
     2631  @retval EFI_NOT_FOUND         The Event specified by DataType could not be found in the
    26322632                                database.
    26332633  @retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
     
    26512651
    26522652  This function is a caller defined function, and it is called by the IpSecVisitConfigData().
    2653   The orignal caller is IpSecConfigSave(), which calls the IpsecVisitConfigData() to 
     2653  The orignal caller is IpSecConfigSave(), which calls the IpsecVisitConfigData() to
    26542654  copy all types of IPsec Config datas into one buffer and store this buffer into firmware in
    26552655  the form of several variables.
    2656  
     2656
    26572657  @param[in]      Type              A specified IPSEC_CONFIG_DATA_TYPE.
    26582658  @param[in]      Selector          Points to a EFI_IPSEC_CONFIG_SELECTOR to be copied
     
    26822682  UINTN                 EntrySize;
    26832683  UINT8                 *TempPoint;
    2684  
     2684
    26852685  if (Type == IPsecConfigDataTypeSad) {
    26862686    //
     
    26982698  EntrySize  = ALIGN_VARIABLE (EntrySize + sizeof (SelectorHeader));
    26992699  EntrySize  = ALIGN_VARIABLE (EntrySize + DataSize);
    2700  
     2700
    27012701  //EntrySize = SelectorSize + DataSize + 2 * sizeof (SelectorHeader);
    27022702  if (Buffer->Capacity - Buffer->Size < EntrySize) {
     
    27062706    Buffer->Capacity += EntrySize;
    27072707    TempPoint         = AllocatePool (Buffer->Capacity);
    2708    
     2708
    27092709    if (TempPoint == NULL) {
    27102710      return EFI_OUT_OF_RESOURCES;
     
    27152715    CopyMem (TempPoint, Buffer->Ptr, Buffer->Size);
    27162716    FreePool (Buffer->Ptr);
    2717    
    2718     Buffer->Ptr       =  TempPoint;   
     2717
     2718    Buffer->Ptr       =  TempPoint;
    27192719  }
    27202720
     
    27332733    );
    27342734  Buffer->Size  = ALIGN_VARIABLE (Buffer->Size + sizeof (SelectorHeader));
    2735  
     2735
    27362736  //
    27372737  // Copy the selector into buffer.
     
    27652765    );
    27662766  Buffer->Size  = ALIGN_VARIABLE (Buffer->Size + DataSize);
    2767  
     2767
    27682768  mUnfixPolicyEntry[Type](Selector, Data);
    27692769
     
    29762976  to the internal data structure.
    29772977
    2978   This founction is called by IpSecConfigInitialize() which is to intialize the 
     2978  This founction is called by IpSecConfigInitialize() which is to intialize the
    29792979  IPsecConfiguration Protocol.
    29802980
     
    30543054      Type    = (EFI_IPSEC_CONFIG_DATA_TYPE) (Header->Type & IPSEC_VAR_ITEM_HEADER_CONTENT_BIT);
    30553055      ASSERT (((Header->Type & 0x80) == IPSEC_VAR_ITEM_HEADER_LOGO_BIT) && (Type < IPsecConfigDataTypeMaximum));
    3056      
     3056
    30573057      Selector  = (EFI_IPSEC_CONFIG_SELECTOR *) ALIGN_POINTER (Header + 1, sizeof (UINTN));
    30583058      Header    = (IPSEC_VAR_ITEM_HEADER *) ALIGN_POINTER (
    3059                                               (UINT8 *) Selector + Header->Size, 
     3059                                              (UINT8 *) Selector + Header->Size,
    30603060                                              sizeof (UINTN)
    30613061                                              );
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IpSecConfigImpl.h

    r48674 r58466  
    346346
    347347  Compare two SPD Selector by the fields of LocalAddressCount/RemoteAddressCount/
    348   NextLayerProtocol/LocalPort/LocalPortRange/RemotePort/RemotePortRange and the 
     348  NextLayerProtocol/LocalPort/LocalPortRange/RemotePort/RemotePortRange and the
    349349  Local Addresses and remote Addresses.
    350350
     
    353353
    354354  @retval  TRUE    The first SPD Selector is subordinate Selector of second SPD Selector.
    355   @retval  FALSE   The first SPD Selector is not subordinate Selector of second 
     355  @retval  FALSE   The first SPD Selector is not subordinate Selector of second
    356356                   SPD Selector.
    357  
     357
    358358**/
    359359BOOLEAN
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IpSecCryptIo.c

    r58459 r58466  
    2020GLOBAL_REMOVE_IF_UNREFERENCED ENCRYPT_ALGORITHM mIpsecEncryptAlgorithmList[IPSEC_ENCRYPT_ALGORITHM_LIST_SIZE] = {
    2121  {IKE_EALG_NULL, 0, 0, 1, NULL, NULL, NULL, NULL},
    22   {IKE_EALG_NONE, 0, 0, 1, NULL, NULL, NULL, NULL}, 
     22  {IKE_EALG_NONE, 0, 0, 1, NULL, NULL, NULL, NULL},
    2323  {IKE_EALG_3DESCBC, 24, 8, 8, TdesGetContextSize, TdesInit, TdesCbcEncrypt, TdesCbcDecrypt},
    2424  {IKE_EALG_AESCBC, 16, 16, 16, AesGetContextSize, AesInit, AesCbcEncrypt, AesCbcDecrypt}
     
    187187    return IpSecCryptoIoGenerateRandomBytes (IvBuffer, IvSize);
    188188  }
    189  
     189
    190190  return EFI_SUCCESS;
    191191}
     
    197197
    198198  @return the index.
    199  
     199
    200200**/
    201201UINTN
     
    205205{
    206206  UINT8 Index;
    207  
     207
    208208  for (Index = 0; Index < IPSEC_ENCRYPT_ALGORITHM_LIST_SIZE; Index++) {
    209209    if (AlgorithmId == mIpsecEncryptAlgorithmList[Index].AlgorithmId) {
     
    211211    }
    212212  }
    213  
     213
    214214  return (UINTN) -1;
    215215}
     
    221221
    222222  @return the index.
    223  
     223
    224224**/
    225225UINTN
     
    229229{
    230230  UINT8 Index;
    231  
     231
    232232  for (Index = 0; Index < IPSEC_AUTH_ALGORITHM_LIST_SIZE; Index++) {
    233233    if (AlgorithmId == mIpsecAuthAlgorithmList[Index].AlgorithmId) {
     
    238238    }
    239239  }
    240  
     240
    241241  return (UINTN) -1;
    242242}
     
    276276     OUT   UINT8      *OutData
    277277  )
    278 { 
     278{
    279279  UINTN         Index;
    280280  UINTN         ContextSize;
    281281  UINT8         *Context;
    282282  EFI_STATUS    Status;
    283  
     283
    284284  Status = EFI_UNSUPPORTED;
    285  
     285
    286286  switch (AlgorithmId) {
    287287
     
    324324    FreePool (Context);
    325325  }
    326  
     326
    327327  return Status;
    328328}
     
    362362     OUT   UINT8      *OutData
    363363  )
    364 { 
     364{
    365365  UINTN         Index;
    366366  UINTN         ContextSize;
     
    398398    if (mIpsecEncryptAlgorithmList[Index].CipherInitiate (Context, Key, KeyBits)) {
    399399      if (mIpsecEncryptAlgorithmList[Index].CipherDecrypt (Context, InData, InDataLength, Ivec, OutData)) {
    400         Status = EFI_SUCCESS;     
     400        Status = EFI_SUCCESS;
    401401      }
    402402    }
     
    421421  the result into the OutData buffer. If the OutDataSize is larger than the related
    422422  HMAC alogrithm output size, return EFI_INVALID_PARAMETER.
    423  
     423
    424424  @param[in]      AlgorithmId     The authentication Identification.
    425425  @param[in]      Key             Pointer of the authentication key.
     
    520520
    521521      goto Exit;
    522     }   
    523      
     522    }
     523
    524524  default:
    525525    return Status;
     
    578578  Status      = EFI_UNSUPPORTED;
    579579  OutHashData = NULL;
    580  
     580
    581581  OutHashSize = IpSecGetHmacDigestLength (AlgorithmId);
    582582  //
    583583  // If the expected hash data size is larger than the related Hash algorithm
    584   // output length, return EFI_INVALID_PARAMETER. 
     584  // output length, return EFI_INVALID_PARAMETER.
    585585  //
    586586  if (OutDataSize > OutHashSize) {
     
    591591    return EFI_OUT_OF_RESOURCES;
    592592  }
    593  
     593
    594594  switch (AlgorithmId) {
    595595
     
    612612      goto Exit;
    613613    }
    614    
     614
    615615    //
    616616    // Initiate Hash context and hash the input data.
     
    632632        // the key length size, so copy the part of hash data to the OutData.
    633633        //
    634         CopyMem (OutData, OutHashData, OutDataSize);           
     634        CopyMem (OutData, OutHashData, OutDataSize);
    635635        Status = EFI_SUCCESS;
    636636      }
    637      
    638       goto Exit;       
    639     }   
    640    
     637
     638      goto Exit;
     639    }
     640
    641641  default:
    642642    return Status;
     
    686686     OUT   UINT8  *PublicKey,
    687687  IN OUT   UINTN  *PublicKeySize
    688   ) 
     688  )
    689689{
    690690  EFI_STATUS   Status;
    691  
     691
    692692  *DhContext = DhNew ();
    693693  ASSERT (*DhContext != NULL);
     
    708708    DhContext = NULL;
    709709  }
    710  
     710
    711711  return Status;
    712712}
     
    732732EFI_STATUS
    733733IpSecCryptoIoDhComputeKey (
    734   IN   OUT   UINT8  *DhContext,     
     734  IN   OUT   UINT8  *DhContext,
    735735  IN   CONST UINT8  *PeerPublicKey,
    736736  IN         UINTN  PeerPublicKeySize,
     
    753753  @retval EFI_SUCCESS              The operation perfoms successfully.
    754754  @retval EFI_INVALID_PARAMETER    The DhContext is NULL.
    755  
     755
    756756**/
    757757EFI_STATUS
     
    759759  IN   OUT   UINT8  **DhContext
    760760  )
    761 { 
     761{
    762762  if (*DhContext == NULL) {
    763763    return EFI_INVALID_PARAMETER;
     
    808808  @param[out]     OutData         The pointer to the signed data.
    809809  @param[in, out] OutDataSize     Pointer to contain the size of out data.
    810  
     810
    811811**/
    812812VOID
     
    825825  UINT8         *Signature;
    826826  UINTN         SigSize;
    827    
     827
    828828  SigSize   = 0;
    829829  RsaContext = NULL;
     
    845845  // Sign data
    846846  //
    847   Signature = NULL; 
     847  Signature = NULL;
    848848  if (!RsaPkcs1Sign (RsaContext, InData, InDataSize, Signature, &SigSize)) {
    849849    Signature = AllocateZeroPool (SigSize);
    850850  } else {
    851851    return;
    852   } 
     852  }
    853853
    854854  RsaPkcs1Sign (RsaContext, InData, InDataSize, Signature, &SigSize);
     
    877877  @retval  TRUE   Valid signature encoded in PKCS1-v1_5.
    878878  @retval  FALSE  Invalid signature or invalid RSA context.
    879  
     879
    880880**/
    881881BOOLEAN
     
    913913  //
    914914  RsaGetPublicKeyFromX509 ((CONST UINT8 *)InCert, CertLen, (VOID **)&RsaContext);
    915  
     915
    916916  //
    917917  // Verify data
     
    965965
    966966  *PublicKeyLen = 0;
    967  
     967
    968968  RsaGetKey (RsaContext, RsaKeyN, NULL, PublicKeyLen);
    969  
     969
    970970  *PublicKey = AllocateZeroPool (*PublicKeyLen);
    971971  ASSERT (*PublicKey != NULL);
     
    990990  @param[out]    CertSubject       Pointer to the retrieved certificate subject.
    991991  @param[out]    SubjectSize       The size of Certificate Subject in bytes.
    992  
     992
    993993  @retval  EFI_SUCCESS            Retrieved the certificate subject successfully.
    994994  @retval  EFI_INVALID_PARAMETER  The certificate is malformed.
    995  
     995
    996996**/
    997997EFI_STATUS
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IpSecCryptIo.h

    r48674 r58466  
    4848/**
    4949  Prototype of HMAC GetContextSize.
    50  
     50
    5151  Retrieves the size, in bytes, of the context buffer required.
    52  
     52
    5353  @return  The size, in bytes, of the context buffer required.
    5454
     
    6262/**
    6363  Prototype of HMAC Operation Initiating.
    64  
     64
    6565  Initialization with a new context.
    6666
     
    6868  @param[in]      Key      Pointer to the key for HMAC.
    6969  @param[in]      KeySize  The length of the Key in bytes.
    70  
     70
    7171  @retval TRUE  Initialization Successfully.
    7272
     
    252252/**
    253253  Prototype of Hash Update
    254  
     254
    255255  Digests the input data and updates hash context.
    256256
     
    355355  //
    356356  // The Key length of the Algorithm
    357   // 
     357  //
    358358  UINTN                    DigestLength;
    359359  //
     
    579579  the result into the OutData buffer. If the OutDataSize is larger than the related
    580580  HMAC alogrithm output size, return EFI_INVALID_PARAMETER.
    581  
     581
    582582  @param[in]      AlgorithmId     The authentication Identification.
    583583  @param[in]      Key             Pointer of the authentication key.
     
    705705  @retval EFI_SUCCESS              The operation perfoms successfully.
    706706  @retval EFI_INVALID_PARAMETER    The DhContext is NULL.
    707  
     707
    708708**/
    709709EFI_STATUS
     
    741741  @param[out]     OutData         The pointer to the signed data.
    742742  @param[in, out] OutDataSize     Pointer to contain the size of out data.
    743  
     743
    744744**/
    745745VOID
     
    770770  @retval  TRUE   Valid signature encoded in PKCS1-v1_5.
    771771  @retval  FALSE  Invalid signature or invalid RSA context.
    772  
     772
    773773**/
    774774BOOLEAN
     
    811811  @param[out]    CertSubject       Pointer to the retrieved certificate subject.
    812812  @param[out]    SubjectSize       The size of Certificate Subject in bytes.
    813  
     813
    814814  @retval  EFI_SUCCESS            Retrieved the certificate subject successfully.
    815815  @retval  EFI_INVALID_PARAMETER  The certificate is malformed.
    816  
     816
    817817**/
    818818EFI_STATUS
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IpSecDebug.c

    r58459 r58466  
    168168{
    169169  if (Previous >= IKE_STATE_NUM || Current >= IKE_STATE_NUM) {
    170     return; 
    171   }
    172  
     170    return;
     171  }
     172
    173173  if (Previous == Current) {
    174174    if (IkeVersion == 1) {
     
    176176    } else if (IkeVersion == 2) {
    177177      DEBUG ((DEBUG_INFO, "\n****Current state is %a\n", mIkev2StateStr[Previous]));
    178     }   
     178    }
    179179  } else {
    180180    if (IkeVersion == 1) {
     
    182182    } else {
    183183      DEBUG ((DEBUG_INFO, "\n****Change state from %a to %a\n", mIkev2StateStr[Previous], mIkev2StateStr[Current]));
    184     }   
     184    }
    185185  }
    186186}
     
    224224    TypeStr = mExchangeStr[2];
    225225    break;
    226    
     226
    227227  case IKE_XCG_TYPE_SA_INIT:
    228228    TypeStr = mExchangeStr[3];
     
    240240    TypeStr = mExchangeStr[6];
    241241    break;
    242    
     242
    243243  default:
    244244    TypeStr = mExchangeStr[7];
     
    276276  @param[in]  IkePayload  Point to payload to be printed.
    277277  @param[in]  IkeVersion  The specified version of IKE.
    278  
     278
    279279**/
    280280VOID
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IpSecDebug.h

    r58459 r58466  
    5858IkeDumpState (
    5959  IN UINT32              Previous,
    60   IN UINT32              Current, 
     60  IN UINT32              Current,
    6161  IN UINT8               IkeVersion
    6262  );
     
    8282  @param[in]  IkePayload  Point to payload to be printed.
    8383  @param[in]  IkeVersion  The specified version of IKE.
    84  
     84
    8585**/
    8686VOID
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IpSecDriver.c

    r58459 r58466  
    2929                                   device to start.
    3030  @param[in]  IpVersion            IP_VERSION_4 or IP_VERSION_6.
    31  
     31
    3232  @retval EFI_SUCCES           This driver supports this device.
    3333  @retval EFI_ALREADY_STARTED  This driver is already running on this device.
     
    4646  EFI_STATUS  Status;
    4747  EFI_GUID    *UdpServiceBindingGuid;
    48  
     48
    4949  if (IpVersion == IP_VERSION_4) {
    5050    UdpServiceBindingGuid  = &gEfiUdp4ServiceBindingProtocolGuid;
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IpSecDxe.inf

    r58459 r58466  
    6464  Ikev2/Payload.c
    6565  Ikev2/Exchange.c
    66  
     66
    6767
    6868
     
    8686  DpcLib
    8787  UdpIoLib
    88   NetLib 
     88  NetLib
    8989  PcdLib
    90  
     90
    9191[Protocols]
    9292  gEfiIp4ConfigProtocolGuid                     ## SOMETIMES_CONSUMES
    93   gEfiUdp4ServiceBindingProtocolGuid            ## SOMETIMES_CONSUMES 
     93  gEfiUdp4ServiceBindingProtocolGuid            ## SOMETIMES_CONSUMES
    9494  gEfiUdp4ProtocolGuid                          ## SOMETIMES_CONSUMES
    95   gEfiUdp6ServiceBindingProtocolGuid            ## SOMETIMES_CONSUMES 
     95  gEfiUdp6ServiceBindingProtocolGuid            ## SOMETIMES_CONSUMES
    9696  gEfiUdp6ProtocolGuid                          ## SOMETIMES_CONSUMES
    9797  gEfiIpSecConfigProtocolGuid                   ## PRODUCES
    9898  gEfiIpSec2ProtocolGuid                        ## PRODUCES
    99  
     99
    100100[Pcd]
    101101  gEfiNetworkPkgTokenSpaceGuid.PcdIpsecCertificateEnabled       ## SOMETIMES_CONSUMES
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IpSecImpl.h

    r48674 r58466  
    151151  This function processes the inbound traffic with IPsec.
    152152
    153   It checks the received packet security property, trims the ESP/AH header, and then 
     153  It checks the received packet security property, trims the ESP/AH header, and then
    154154  returns without an IPsec protected IP Header and FragmentTable.
    155  
     155
    156156  @param[in]      IpVersion          The version of IP.
    157   @param[in, out] IpHead             Points to IP header containing the ESP/AH header 
     157  @param[in, out] IpHead             Points to IP header containing the ESP/AH header
    158158                                     to be trimed on input, and without ESP/AH header
    159159                                     on return.
     
    281281  IN     UINT8                   *IpPayload,
    282282  IN     UINT8                   Protocol,
    283   IN     BOOLEAN                 IsOutbound, 
     283  IN     BOOLEAN                 IsOutbound,
    284284     OUT EFI_IPSEC_ACTION        *Action
    285285  );
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/IpSecDxe/IpSecMain.c

    r48674 r58466  
    7171  BOOLEAN                IsOutbound;
    7272
    73   if (OptionsBuffer == NULL || 
    74       OptionsLength == NULL || 
    75       FragmentTable == NULL || 
     73  if (OptionsBuffer == NULL ||
     74      OptionsLength == NULL ||
     75      FragmentTable == NULL ||
    7676      FragmentCount == NULL
    7777      ) {
     
    8484  *RecycleSignal  = NULL;
    8585  SpdList         = &mConfigData[IPsecConfigDataTypeSpd];
    86  
     86
    8787  if (!IsOutbound) {
    8888    //
     
    109109
    110110    if (Status == EFI_SUCCESS) {
    111      
     111
    112112      //
    113113      // Check the spd entry if the packet is accessible.
     
    121121      NET_LIST_FOR_EACH (Entry, SpdList) {
    122122        SpdEntry = IPSEC_SPD_ENTRY_FROM_LIST (Entry);
    123         if (IsSubSpdSelector (               
     123        if (IsSubSpdSelector (
    124124              (EFI_IPSEC_CONFIG_SELECTOR *) SpdSelector,
    125125              (EFI_IPSEC_CONFIG_SELECTOR *) SpdEntry->Selector
     
    127127          Status = EFI_SUCCESS;
    128128        }
    129       }     
    130       goto ON_EXIT;
    131     }       
    132   }
    133 
    134   Status  = EFI_ACCESS_DENIED; 
     129      }
     130      goto ON_EXIT;
     131    }
     132  }
     133
     134  Status  = EFI_ACCESS_DENIED;
    135135
    136136  NET_LIST_FOR_EACH (Entry, SpdList) {
     
    146146                     IpPayload,
    147147                     OldLastHead,
    148                      IsOutbound, 
     148                     IsOutbound,
    149149                     &Action
    150150                     ))) {
     
    223223
    224224    case EfiIPsecActionDiscard:
    225       goto ON_EXIT;   
    226     }
    227   }
    228    
     225      goto ON_EXIT;
     226    }
     227  }
     228
    229229  //
    230230  // If don't find the related SPD entry, return the EFI_ACCESS_DENIED and discard it.
    231231  // But it the packet is NS/NA, it should be by passed even not find the related SPD entry.
    232232  //
    233   if (OldLastHead == IP6_ICMP && 
     233  if (OldLastHead == IP6_ICMP &&
    234234      (*IpPayload == ICMP_V6_NEIGHBOR_SOLICIT || *IpPayload == ICMP_V6_NEIGHBOR_ADVERTISE)
    235235      ){
    236236    Status = EFI_SUCCESS;
    237237  }
    238  
     238
    239239ON_EXIT:
    240240  return Status;
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Mtftp6Dxe/ComponentName.c

    r58459 r58466  
    234234  @param  Mtftp6[in]                A pointer to the EFI_MTFTP6_PROTOCOL.
    235235
    236  
     236
    237237  @retval EFI_SUCCESS               Update the ControllerNameTable of this instance successfully.
    238238  @retval EFI_INVALID_PARAMETER     The input parameter is invalid.
    239  
     239
    240240**/
    241241EFI_STATUS
     
    262262      return Status;
    263263    }
    264     UnicodeSPrint (HandleName, sizeof (HandleName), 
     264    UnicodeSPrint (HandleName, sizeof (HandleName),
    265265      L"MTFTPv6(ServerIp=%s, InitialServerPort=%d)",
    266266      Address,
     
    275275    gMtftp6ControllerNameTable = NULL;
    276276  }
    277  
     277
    278278  Status = AddUnicodeString2 (
    279279             "eng",
     
    286286    return Status;
    287287  }
    288  
     288
    289289  return AddUnicodeString2 (
    290290           "en",
     
    384384    return EFI_UNSUPPORTED;
    385385  }
    386  
    387   // 
    388   // Make sure this driver produced ChildHandle 
    389   // 
     386
     387  //
     388  // Make sure this driver produced ChildHandle
     389  //
    390390  Status = EfiTestChildHandle (
    391391             ControllerHandle,
    392              ChildHandle, 
     392             ChildHandle,
    393393             &gEfiUdp6ProtocolGuid
    394394             );
     
    417417  Status = UpdateName (Mtftp6);
    418418  if (EFI_ERROR (Status)) {
    419     return Status; 
     419    return Status;
    420420  }
    421421
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Mtftp6Dxe/Mtftp6Driver.c

    r58459 r58466  
    239239/**
    240240  Callback function which provided by user to remove one node in NetDestroyLinkList process.
    241  
     241
    242242  @param[in]    Entry           The entry to be removed.
    243243  @param[in]    Context         Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
     
    474474  LIST_ENTRY                                 *List;
    475475  MTFTP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT Context;
    476  
     476
    477477  //
    478478  // Locate the Nic handle to retrieve the Mtftp6 private data.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/NetworkPkg.dec

    • Property svn:eol-style set to native
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/NetworkPkg.dsc

    r58459 r58466  
    4747  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
    4848  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
    49   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf 
     49  DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
    5050
    5151[LibraryClasses.common.UEFI_DRIVER]
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/TcpDxe/ComponentName.c

    r58459 r58466  
    232232  @param  Tcp4[in]                   A pointer to the EFI_TCP4_PROTOCOL.
    233233
    234  
     234
    235235  @retval EFI_SUCCESS                Update the ControllerNameTable of this instance successfully.
    236236  @retval EFI_INVALID_PARAMETER      The input parameter is invalid.
    237  
     237
    238238**/
    239239EFI_STATUS
     
    277277    gTcpControllerNameTable = NULL;
    278278  }
    279  
     279
    280280  Status = AddUnicodeString2 (
    281281             "eng",
     
    288288    return Status;
    289289  }
    290  
     290
    291291  return AddUnicodeString2 (
    292292           "en",
     
    303303  @param  Tcp6[in]                   A pointer to the EFI_TCP6_PROTOCOL.
    304304
    305  
     305
    306306  @retval EFI_SUCCESS                Update the ControllerNameTable of this instance successfully.
    307307  @retval EFI_INVALID_PARAMETER      The input parameter is invalid.
    308  
     308
    309309**/
    310310EFI_STATUS
     
    344344    gTcpControllerNameTable = NULL;
    345345  }
    346  
     346
    347347  Status = AddUnicodeString2 (
    348348             "eng",
     
    355355    return Status;
    356356  }
    357  
     357
    358358  return AddUnicodeString2 (
    359359           "en",
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/TcpDxe/TcpDispatcher.c

    r58459 r58466  
    360360    IpProtocolGuid = &gEfiIp6ProtocolGuid;
    361361  }
    362  
     362
    363363  Tcb = AllocateZeroPool (sizeof (TCP_CB));
    364364
     
    398398    return Status;
    399399  }
    400  
     400
    401401  InitializeListHead (&Tcb->List);
    402402  InitializeListHead (&Tcb->SndQue);
     
    430430    IpProtocolGuid = &gEfiIp6ProtocolGuid;
    431431  }
    432  
     432
    433433  ProtoData = (TCP_PROTO_DATA *) Sk->ProtoReserved;
    434434  Tcb       = ProtoData->TcpPcb;
     
    447447         Sk->SockHandle
    448448         );
    449  
     449
    450450  IpIoRemoveIp (ProtoData->TcpService->IpIo, Tcb->IpInfo);
    451451
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/TcpDxe/TcpDriver.c

    r58459 r58466  
    366366/**
    367367  Callback function which provided by user to remove one node in NetDestroyLinkList process.
    368  
     368
    369369  @param[in]    Entry           The entry to be removed.
    370370  @param[in]    Context         Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
     
    411411                                 of children is zero stop the entire bus driver.
    412412  @param[in]  ChildHandleBuffer  An array of child handles to be freed. May be NULL
    413                                  if NumberOfChildren is 0. 
     413                                 if NumberOfChildren is 0.
    414414  @param[in]  IpVersion          IP_VERSION_4 or IP_VERSION_6
    415415
     
    546546    return EFI_ALREADY_STARTED;
    547547  }
    548  
     548
    549549  //
    550550  // Test for the Ip4ServiceBinding Protocol
     
    663663    return EFI_ALREADY_STARTED;
    664664  }
    665  
     665
    666666  //
    667667  // Test for the Ip6ServiceBinding Protocol
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/TcpDxe/TcpDxe.inf

    r58459 r58466  
    33#
    44#  This module provides EFI TCPv4 Protocol and EFI TCPv6 Protocol to send and receive data stream.
    5 #  It might provide TCPv4 Protocol or TCPv6 Protocol or both of them that depends on 
     5#  It might provide TCPv4 Protocol or TCPv6 Protocol or both of them that depends on
    66#  which network stack has been loaded in system.
    77#
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Udp6Dxe/ComponentName.c

    r58459 r58466  
    238238  @param  Udp6[in]                  A pointer to the EFI_UDP6_PROTOCOL.
    239239
    240  
     240
    241241  @retval EFI_SUCCESS               Update the ControllerNameTable of this instance successfully.
    242242  @retval EFI_INVALID_PARAMETER     The input parameter is invalid.
    243  
     243
    244244**/
    245245EFI_STATUS
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Udp6Dxe/Udp6Driver.c

    r58459 r58466  
    179179/**
    180180  Callback function which provided by user to remove one node in NetDestroyLinkList process.
    181  
     181
    182182  @param[in]    Entry           The entry to be removed.
    183183  @param[in]    Context         Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
     
    297297           NULL
    298298           );
    299  
     299
    300300    Udp6CleanService (Udp6Service);
    301301
     
    409409    goto ON_ERROR;
    410410  }
    411  
     411
    412412  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
    413413
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Udp6Dxe/Udp6Dxe.inf

    r58459 r58466  
    11## @file Udp6Dxe.inf
    22#  UDP packet service based on IPv6 stack.
    3 # 
     3#
    44#  This module produces EFI UDPv6 Protocol which provides simple packet-oriented
    55#  services to transmit and receive UDP packets.
    6 #                                                                               
     6#
    77#  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
    88#
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Udp6Dxe/Udp6Impl.c

    r58459 r58466  
    365365  IpIoDestroy (Udp6Service->IpIo);
    366366  Udp6Service->IpIo = NULL;
    367  
     367
    368368  return Status;
    369369}
     
    391391  IpIoDestroy (Udp6Service->IpIo);
    392392  Udp6Service->IpIo = NULL;
    393  
     393
    394394  ZeroMem (Udp6Service, sizeof (UDP6_SERVICE_DATA));
    395395}
     
    19321932  )
    19331933{
    1934 } 
     1934}
    19351935
    19361936/**
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Udp6Dxe/Udp6Impl.h

    r58459 r58466  
    145145  IN EFI_HANDLE         ControllerHandle
    146146  );
    147  
     147
    148148/**
    149149  This function cleans the udp instance.
     
    156156  IN OUT UDP6_INSTANCE_DATA  *Instance
    157157  );
    158  
     158
    159159/**
    160160  This function intializes the new created udp instance.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/Udp6Dxe/Udp6Main.c

    r58459 r58466  
    285285    ASSERT (IsListEmpty (&Instance->DeliveredDgramQue));
    286286  }
    287  
     287
    288288ON_EXIT:
    289289
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/UefiPxeBcDxe/ComponentName.c

    r58459 r58466  
    325325    return EFI_UNSUPPORTED;
    326326  }
    327  
     327
    328328  NicHandle = PxeBcGetNicByIp4Children (ControllerHandle);
    329329  if (NicHandle == NULL) {
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c

    r58459 r58466  
    102102  // According to the PXE specification 2.1, Table 2-1 PXE DHCP Options,
    103103  // we must not consider a boot prompt or boot menu if all of the following hold:
    104   //   - the PXE_DISCOVERY_CONTROL tag(6) is present inside the Vendor Options(43), and has bit 3 set 
     104  //   - the PXE_DISCOVERY_CONTROL tag(6) is present inside the Vendor Options(43), and has bit 3 set
    105105  //   - a boot file name has been presented in the initial DHCP or ProxyDHCP offer packet.
    106106  //
     
    109109    return EFI_ABORTED;
    110110  }
    111  
     111
    112112  if (!IS_VALID_BOOT_PROMPT (VendorOpt->BitMap)) {
    113113    return EFI_TIMEOUT;
     
    471471  PXEBC_VENDOR_OPTION         *VendorOpt;
    472472  PXEBC_BOOT_SVR_ENTRY        *Entry;
    473  
     473
    474474  PxeBc       = &Private->PxeBc;
    475475  Mode        = PxeBc->Mode;
     
    779779        *DiscoverInfo = AllocatePool (sizeof (*Info) + (Info->IpCnt - 1) * sizeof (**SrvList));
    780780        if (*DiscoverInfo == NULL) {
    781           return EFI_OUT_OF_RESOURCES;       
    782         }     
     781          return EFI_OUT_OF_RESOURCES;
     782        }
    783783        CopyMem (*DiscoverInfo, Info, sizeof (*Info));
    784784        Info = *DiscoverInfo;
     
    941941          &Mode->PxeReply.Dhcpv4,
    942942          Private->PxeReply.Dhcp4.Packet.Ack.Length
    943           );     
     943          );
    944944      }
    945945      Mode->ProxyOfferReceived = TRUE;
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c

    r58459 r58466  
    483483  }
    484484  //
    485   // Second, Check if bootfilename and serverhostname is overloaded to carry DHCP options refers to rfc-2132. 
     485  // Second, Check if bootfilename and serverhostname is overloaded to carry DHCP options refers to rfc-2132.
    486486  // If yes, try to parse options from the BootFileName field, then ServerName field.
    487487  //
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.h

    r58459 r58466  
    149149#define IS_VALID_BOOT_SERVERS(x) \
    150150  ((((x)[0]) & BIT (PXEBC_VENDOR_TAG_BOOT_SERVERS)) \
    151    == BIT (PXEBC_VENDOR_TAG_BOOT_SERVERS)) 
     151   == BIT (PXEBC_VENDOR_TAG_BOOT_SERVERS))
    152152
    153153#define IS_VALID_BOOT_PROMPT(x) \
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c

    r58459 r58466  
    720720    return EFI_NOT_FOUND;
    721721  }
    722  
     722
    723723  //
    724724  // Add Server ID Option.
     
    748748
    749749  //
    750   // Update Elapsed option in the package 
     750  // Update Elapsed option in the package
    751751  //
    752752  Option = PxeBcDhcp6SeekOption (
     
    758758    CalcElapsedTime (Private);
    759759    WriteUnaligned16 ((UINT16*)(Option + 4), HTONS((UINT16) Private->ElapsedTime));
    760   } 
     760  }
    761761
    762762  Status = PxeBc->UdpWrite (
     
    792792    return Status;
    793793  }
    794    
     794
    795795  Status = PxeBc->UdpRead (
    796796                    PxeBc,
     
    16671667    return Status;
    16681668  }
    1669  
     1669
    16701670  Status = PxeBc->UdpRead (
    16711671                    PxeBc,
     
    18171817
    18181818    do {
    1819      
     1819
    18201820      TimerStatus = gBS->CheckEvent (Timer);
    18211821      if (!EFI_ERROR (TimerStatus)) {
     
    18231823      }
    18241824    } while (TimerStatus == EFI_NOT_READY);
    1825    
     1825
    18261826    gBS->CloseEvent (Timer);
    18271827  }
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c

    r58459 r58466  
    255255           );
    256256
    257     if (Private->Snp != NULL) { 
     257    if (Private->Snp != NULL) {
    258258      //
    259259      // Close SNP from the child virtual handle
     
    265265             Private->Ip4Nic->Controller
    266266             );
    267              
     267
    268268      gBS->UninstallProtocolInterface (
    269269             Private->Ip4Nic->Controller,
     
    702702
    703703    //
    704     // Open SNP on the child handle BY_DRIVER. It will prevent any additionally 
     704    // Open SNP on the child handle BY_DRIVER. It will prevent any additionally
    705705    // layering to perform the experiment.
    706706    //
     
    839839    for (Index = 0; Index < Private->Snp->Mode->HwAddressSize; Index++) {
    840840      Private->IaId |= (Private->Snp->Mode->CurrentAddress.Addr[Index] << ((Index << 3) & 31));
    841     } 
     841    }
    842842  }
    843843
     
    10041004    goto ON_ERROR;
    10051005  }
    1006  
     1006
    10071007  if (Private->Snp != NULL) {
    10081008    //
     
    10211021
    10221022    //
    1023     // Open SNP on the child handle BY_DRIVER. It will prevent any additionally 
     1023    // Open SNP on the child handle BY_DRIVER. It will prevent any additionally
    10241024    // layering to perform the experiment.
    10251025    //
     
    11461146                                  device to be started.
    11471147  @param[in]  IpVersion           IP_VERSION_4 or IP_VERSION_6.
    1148  
     1148
    11491149  @retval EFI_SUCCESS         This driver supports this device.
    11501150  @retval EFI_UNSUPPORTED     This driver does not support this device.
     
    11631163  EFI_GUID                        *DhcpServiceBindingGuid;
    11641164  EFI_GUID                        *MtftpServiceBindingGuid;
    1165  
     1165
    11661166  if (IpVersion == IP_VERSION_4) {
    11671167    DhcpServiceBindingGuid  = &gEfiDhcp4ServiceBindingProtocolGuid;
     
    13061306    //
    13071307    // Install PxeBaseCodePrivate protocol onto the real NIC handler.
    1308     // PxeBaseCodePrivate protocol is only used to keep the relationship between 
     1308    // PxeBaseCodePrivate protocol is only used to keep the relationship between
    13091309    // NIC handle and virtual child handles.
    13101310    // gEfiCallerIdGuid will be used as its protocol guid.
     
    13231323    // Try to locate SNP protocol.
    13241324    //
    1325     NetLibGetSnpHandle(ControllerHandle, &Private->Snp);   
     1325    NetLibGetSnpHandle(ControllerHandle, &Private->Snp);
    13261326  }
    13271327
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c

    r58459 r58466  
    9292      goto ON_ERROR;
    9393    }
    94    
     94
    9595    //
    9696    // Configure block size for TFTP as a default value to handle all link layers.
     
    137137      goto ON_ERROR;
    138138    }
    139    
     139
    140140    //
    141141    // Configure block size for TFTP as a default value to handle all link layers.
     
    725725    FreePool (NewCreatedInfo);
    726726  }
    727  
     727
    728728  if (Mode->UsingIpv6) {
    729729    Private->Udp6Read->Configure (Private->Udp6Read, &Private->Udp6CfgData);
     
    731731    Private->Udp4Read->Configure (Private->Udp4Read, &Private->Udp4CfgData);
    732732  }
    733  
     733
    734734  //
    735735  // Dhcp(), Discover(), and Mtftp() set the IP filter, and return with the IP
     
    16221622      //
    16231623      Private->Udp4Read->Configure (Private->Udp4Read, NULL);
    1624  
     1624
    16251625      //
    16261626      // Configure the UDP instance with the new configuration.
     
    16321632        return Status;
    16331633      }
    1634  
     1634
    16351635      //
    16361636      // In not Promiscuous mode, need to join the new multicast group.
     
    16611661      //
    16621662      Private->Udp6Read->Configure (Private->Udp6Read, NULL);
    1663  
     1663
    16641664      //
    16651665      // Configure the UDP instance with the new configuration.
     
    16701670        return Status;
    16711671      }
    1672  
     1672
    16731673      //
    16741674      // In not Promiscuous mode, need to join the new multicast group.
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h

    r58459 r58466  
    102102
    103103  PXEBC_PRIVATE_PROTOCOL                    Id;
    104   EFI_SIMPLE_NETWORK_PROTOCOL               *Snp; 
     104  EFI_SIMPLE_NETWORK_PROTOCOL               *Snp;
    105105
    106106  PXEBC_VIRTUAL_NIC                         *Ip4Nic;
  • trunk/src/VBox/Devices/EFI/Firmware/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf

    r58459 r58466  
    11## @file
    22#  Access PXE-compatible devices for network access and network booting.
    3 # 
     3#
    44#  This driver provides PXE Base Code Protocol which is used to accessing
    55#  PXE-compatible device for network access or booting. It could work together
     
    7474  ## TO_START
    7575  ## SOMETIMES_CONSUMES
    76   gEfiDevicePathProtocolGuid                           
     76  gEfiDevicePathProtocolGuid
    7777  gEfiNetworkInterfaceIdentifierProtocolGuid_31        ## SOMETIMES_CONSUMES
    7878  gEfiArpServiceBindingProtocolGuid                    ## TO_START
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette