What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Understanding the router's webpage source code

makkie2002

Occasional Visitor
Hello,

I'm just starting to digg around in the source code of Merlin.
I'm trying to get my head around the /www folder and how it creates the webinterface of the router that we all love so much.

I started by looking at the index.asp.
First hurdle that I found was that I can not anywhere find the definition of nvram_get() or login_state_hook() or any other function that is enclosed by <% and %>

I somehow have the feeling that these are "server side" generated functions but they should somewhere showup in the source code of the router. I searched through the git repository but no avail ... I can not find any definition of these functions.

Who can help ?

Marc
 
Last edited:
Hello,

I'm just starting to digg around in the source code of Merlin.
I'm trying to get my head around the /www folder and how it creates the webinterface of the router that we all love so much.

I started by looking at the index.asp.
First hurdle that I found was that I can not anywhere find the definition of nvram_get() or login_state_hook() or any other function that is enclosed by <% and %>

I somehow have the feeling that these are "server side" generated functions but they should somewhere showup in the source code of the router. I searched through the git repository but no avail ... I can not find any definition of these functions.

These are indeed replaced on-the-fly by the httpd daemon as it parses the page before sending it to the client. See the ej_handlers[] array found in router/httpd/web.c for the list of supported handlers, and which httpd function gets called in relation to these.
 
These are indeed replaced on-the-fly by the httpd daemon as it parses the page before sending it to the client. See the ej_handlers[] array found in router/httpd/web.c for the list of supported handlers, and which httpd function gets called in relation to these.

Thanks Merlin,

Clean, mean and to the point answer !
Saved me a lot of searching and frustration.

Marc
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top