MAC and IP-Address of client using RomPager WebServer

In my application I would like to konow the clients MAC- and IP-address. As webserver I use RomPager. Is it possible to generate a Reply-page containing the MAC- and IP-address of the client?

This would only be done in the application level such that with the advanced web server, the remote host IP address can be determined in the application layer. In the server implementation, when it receives a connection, the server will find the wanted object using the URL through the gRpObjectList which is maintained in the application layer. If the object is found, the server will check if there is an optional extension structure ( rpObjectExtentionPtr points to it) involved in this object. If so, the server continues to check if there is an optional processing routine in the extension structure, then calls it by passing pointer to rpData structure when finding it. The optional extension structure and the processing routine can be coded in the application layer. The rpData structure contains the information about the server. The customer can implement any task to communicate with the server in the optional processing routine. For example, remote host IP address determination task, the customer can code it in C:
etos\src\examples
ahttp_pb\pbuilder
etarm1_v.c file as follows. void getremoteIP(void theTaskDataPtr, Signed16Ptr theIndexValuesPtr) { / This function is called prior to the page being served / unsigned long theDataPtr; /needed/ theDataPtr=(unsigned long )theTaskDataPtr; / casting is needed */ printf("the host ip address is %u
",RpHSRemoteAddress(theDataPtr)); return; } Then put this processing routine name in an corresponding optional extension structure in C:
etos\src\examples
ahttp_pb\pbuilder\html
etarm1.c. extern void getremoteIP(void theTaskDataPtr, Signed16Ptr theIndexValuesPtr); /declaration needed/ / the following is the optional extension structure called Pgnetarm_ObjectExtension */ static rpObjectExtension Pgnetarm_ObjectExtension = { getremoteIP, /processing routine/ (rpObjectDescriptionPtr) 0, (rpObjectDescriptionPtr) 0, 0, kRpObjFlags_None }; and put the address of the optional extension structure in the corresponding object structure. rpObjectDescription Pgnetarm1 = { “/netarm1.htm”, Pgnetarm1_Items, &Pgnetarm_ObjectExtension, /optional extension structure/ (Unsigned32) 0, kRpPageAccess_Unprotected, eRpDataTypeHtml, eRpObjectTypeDynamic }; So when some clients connect to the server and want to retrieve the web page netarm1.htm, the application layer can get the remote host IP address. For using user exit cgi situation, it’s much simple. The customer just implements the routine RpExternalCgi in C:
etos\src\rphttpd\cgi.c or in the corresponding example application directory. The default of RpExternalCgi is void RpExternalCgi(void theDataPtr, void theCgiPtr) { return; }

Thanks a lot! I got the output: the host ip address is: 2523148592. I don’t know the format of this number, yet. (My Client’s IP is 150.100.49.48) What documentation file (pdf) do you use? Kind regards, chris fahrni

It works with %x in the printf-function. Now I can do all I need. Thanks a lot for your support!