/*@@ @file Processors.c @date Wed Nov 8 2000 @author Gabrielle Allen @desc Pages about processors @enddesc @version $Header$ @@*/ #include #include "cctk.h" #include "util_String.h" #include "CactusConnect/HTTPD/src/http_Request.h" #include "CactusConnect/HTTPD/src/http_Content.h" #include "httpextra_HostNames.h" static char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusConnect_HTTPDExtra_Processors_c) /******************************************************************** ********************* Local Data Types *********************** ********************************************************************/ /******************************************************************** ********************* Local Routine Prototypes ********************* ********************************************************************/ static int ProcessorsPage(cGH *cctkGH, httpRequest *request, void *data); /******************************************************************** ********************* Other Routine Prototypes ********************* ********************************************************************/ /******************************************************************** ********************* Local Data ***************************** ********************************************************************/ /******************************************************************** ********************* External Routines ********************** ********************************************************************/ /*@@ @routine HTTPDExtra_RegisterProcessorsPages @date Wed Sep 14 11:29:43 2000 @author Gabrielle Allen @desc Httpd utils registration routine. @enddesc @calls @calledby @history @endhistory @@*/ int HTTPDExtra_RegisterProcessorsPages(void) { /* Register the group info page. */ HTTP_RegisterPage("/Processors", ProcessorsPage, NULL); HTTP_ContentLink("/Processors/index.html", "Processor Information", "Processor layout and properties", HTTP_QUICKLINK); return 0; } /******************************************************************** ********************* Local Routines ************************* ********************************************************************/ /****************************************************************************** ***************************** Groups Page ************************************** ******************************************************************************/ /*@@ @routine ProcessorsPage @date Thu Sep 14 23:47:43 2000 @author Gabrielle Allen @desc Displays the processor description page. @enddesc @calls @calledby @@*/ static int ProcessorsPage(cGH *cctkGH, httpRequest *request, void *data) { int retval; int nprocs,np; char message[4098]; /* Status message */ strcpy(message,"HTTP/1.0 200 OK\r\n"); HTTP_Write(request, message, strlen(message)); /* Content-Type */ strcpy(message,"Content-Type: text/html\r\n\r\n"); HTTP_Write(request, message, strlen(message)); /* Start the page */ strcpy(message,"Cactus Simulation Processor Information\n"); HTTP_Write(request, message, strlen(message)); /* HTTP_Write out the header part. */ HTTP_ContentHeader(cctkGH,0,strlen(message),message,NULL); retval = HTTP_Write(request, message, strlen(message)); strcpy(message, "

Processor Information

\n"); retval = HTTP_Write(request, message, strlen(message)); strcpy(message, "
\n\n" "" "\n" "\n" ""); retval = HTTP_Write(request, message, strlen(message)); nprocs = CCTK_nProcs(cctkGH); for (np=0;np" "" "" "\n", np, HTTPDExtra_RemoteHostName(np) ); retval = HTTP_Write(request, message, strlen(message)); } strcpy(message, "
NumberMachine Name
%d%s
\n
\n"); retval = HTTP_Write(request, message, strlen(message)); /* Write out the footer part. */ HTTP_ContentFooter(cctkGH,0,strlen(message),message); retval = HTTP_Write(request, message, strlen(message)); return retval; }