180 • Application Examples
Example Program for a CGI Application
WAGO-I/O-SYSTEM 750
Linux Fieldbus Coupler
The function main_ether() calls the above-mentioned functions and writes
the HTML code to the standard console stdout. HTML shows the network
configuration in a form. The form has the SUBMIT button SAVE
CONFIGURATION which transfers a changed network configuration to the
Linux fieldbus coupler in a QUERY_STRING. You have to enter a user with
root privileges and the corresponding password.
These entries are authenticated in the crypt.c file. After successful
authentication, the SAVE CONFIGURATION query string is analyzed and, if a
value is changed, the appropriate write_...- function is called.
Source code description: restart.c
The restart page of the Linux fieldbus coupler is generated in the restart.c file.
The file includes the function
main_restart()
main_restart() writes the HTML code to the standard console stdout.
Furthermore, the query string including the password is analyzed. After
entering a user with root privileges and the corresponding password
(default:user name: root, password: wago) and clicking the REBOOT button,
reboot will be called which will reboot the operating system.