Wednesday, August 13, 2008

Common filesystem layouts for m0n0wall, pfSense

Our first real post will start off with file system locations and what each of the files do.

A majority of the files that you will be working with live in two locations: /etc/inc and /usr/local/wwww

/etc/inc contains files that are included/required (include/require in php speak) that contains a lot of backend logic. Genreally no web presentation code is present in /etc/inc files.

/usr/local/www contains the web related files that help present the m0n0 framework to the user. These files will generally include files from /etc/inc to assist with PHP logic.

Let's go over some of the basic files in /etc/inc:













FileFunction
functions.incMaster file that automatically includes other common /etc/inc/*.inc files
config.incFile containing the logic that handles config.xml data manipulation and configuration adjustments
xmlparse.incFile containing the logic that parses config.xml and returns the parsed code back to config.inc as an array ($config)

Some common files that we will be using in /usr/local/www are:







FileFunction
guiconfig.incMaster GUI file that contains a number of useful functions that we will commonly use

The above three files are required to parse the config.xml structure and turn it into a PHP array ($config).

Our next post will go into the basics of reading in config.xml and being able to access the data within.

Stay tuned!

No comments: