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:

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 as an array ($config)

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

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!

Welcome to Programming with pfSense and m0n0wall!

Hi and welcome to Programming with pfSense and m0n0wall!

In this blog I hope to describe common programming practices in use in the m0n0wall platform being used today by many open source projects: Askozia, FreeNAS, pfSense, etc.

We will be starting from scratch going over the file system structure layout and common files progressing into reading and manipulating the config.xml database. After we are comfortable in this arena we will move on to further challenges such as input validation, configuration arrays and many other topics that might be of interest to folks wishing to get started on this fantastic framework.

Check back often for new articles and be sure to leave comments about what you would like to see featured here on this blog.

Happy m0n0Platform coding!