2 This file contains an 'Intel UEFI Application' and is
3 licensed for Intel CPUs and chipsets under the terms of your
4 license agreement with Intel or your vendor. This file may
5 be modified by the user, subject to additional terms of the
10 Copyright (c) 2011 Intel Corporation. All rights reserved
11 This software and associated documentation (if any) is furnished
12 under a license and may only be used or copied in accordance
13 with the terms of the license. Except as permitted by such
14 license, no part of this software or documentation may be
15 reproduced, stored in a retrieval system, or transmitted in any
16 form or by any means without the express written consent of
26 #include <WebServer.h>
30 Respond with the Ports page
32 @param [in] SocketFD The socket's file descriptor to add to the list.
33 @param [in] pPort The WSDT_PORT structure address
34 @param [out] pbDone Address to receive the request completion status
36 @retval EFI_SUCCESS The request was successfully processed
46 socklen_t AddressLength
;
47 struct sockaddr_in6 LocalAddress
;
48 DT_WEB_SERVER
* pWebServer
;
54 // Send the Hello World page
56 pWebServer
= &mWebServer
;
59 // Send the page header
61 Status
= HttpPageHeader ( SocketFD
, pPort
, L
"Ports" );
62 if ( EFI_ERROR ( Status
)) {
69 Status
= HttpSendAnsiString ( SocketFD
,
71 "<h1>Web-Server Ports</h1>\r\n" );
72 if ( EFI_ERROR ( Status
)) {
79 if ( -1 != pWebServer
->HttpListenPort
) {
80 AddressLength
= sizeof ( LocalAddress
);
81 if ( 0 == getsockname ( pWebServer
->HttpListenPort
,
82 (struct sockaddr
*)&LocalAddress
,
84 Status
= HttpSendAnsiString ( SocketFD
,
86 "<a href=\"http://" );
87 if ( EFI_ERROR ( Status
)) {
90 Status
= HttpSendIpAddress ( SocketFD
,
93 if ( EFI_ERROR ( Status
)) {
96 Status
= HttpSendAnsiString ( SocketFD
,
98 "\">Tcp4</a><br>\r\n" );
99 if ( EFI_ERROR ( Status
)) {
108 if ( -1 != pWebServer
->HttpListenPort6
) {
109 AddressLength
= sizeof ( LocalAddress
);
110 if ( 0 == getsockname ( pWebServer
->HttpListenPort6
,
111 (struct sockaddr
*)&LocalAddress
,
113 Status
= HttpSendAnsiString ( SocketFD
,
115 "<a href=\"http://" );
116 if ( EFI_ERROR ( Status
)) {
119 Status
= HttpSendIpAddress ( SocketFD
,
122 if ( EFI_ERROR ( Status
)) {
125 Status
= HttpSendAnsiString ( SocketFD
,
127 "\">Tcp6</a><br>\r\n" );
128 if ( EFI_ERROR ( Status
)) {
135 // Send the page trailer
137 Status
= HttpPageTrailer ( SocketFD
, pPort
, pbDone
);
142 // Return the operation status
144 DBG_EXIT_STATUS ( Status
);