OpenCALEA
Date Prev | Date Next |
Date Index |
Thread Index |
Author Index |
Historical
Re: [OpenCALEA] config file [was iniParser]
- From: Jesse Norell
- Date: Thu Mar 22 19:18:49 2007
Hello,
Do you have a preference of a single config file with a different
section for each program (where relevant), vs. a separate config file
for each program? My personal preference isn't an option with glib's
ini parser, which would be an /etc/opencalea/opencalea.conf that has a
general section, then something like:
include "/etc/opencalea/tap.conf"
include "/etc/opencalea/lea_collector.conf"
include "/etc/opencalea/controller.conf"
include "/etc/opencalea/collector.conf"
If there become a lot of options, a single config file can get pretty
large, and also may be largely unused for eg. a remote machine running
only tap.
As to format, something like:
[OpenCALEA]
cmii_port = 41800 # 6666 is reserved for irc
cmc_port = 41801
user = calea
pass = calea
sendmail = /usr/sbin/sendmail
TRACE_SYSLOG = 3
TRACE_STDERR = 1
logfile = /var/log/opencalea/opencalea.log
errorlog = /var/log/opencalea/opencalea.err
pid_directory = /var/run
state_directory = /var/run
[LEA_COLLECTOR]
capturefile_directory = /var/lib/opencalea
logfile = /var/log/opencalea/lea_collector.log
errorlog = /var/log/opencalea/lea_collector.err
[TAP]
interface = "eth0"
IAPSystemID = "IAP-1"
lea_collector = 127.0.0.1
Maybe be a little more consistent in upper/lowercase, etc., but you get
the drift.
Also need to consider a directory structure for the capture files.
Maybe
/var/lib/opencalea/<caseID>/CmC.pcap
/var/lib/opencalea/<caseID>/CmII.txt
And consider whether to overwrite or append to existing file (or maybe
just exit). It may be good if one lea_collector could tell if another
were already running for that case (or just error if the file exists or
you can't bind to the socket?).
Jesse
On Wed, 2007-03-21 at 18:54 -0400, Manish Karir wrote:
> no I have no particular preference on directory hierarchy of /etc or
> source files(pick something). what settings did you want to include
> in the config file? if you have a example file in your mind you can post
> that to the list as well?
>
> -manish
>
>
> On Wed, 21 Mar 2007, Jesse Norell wrote:
>
> > Ok, that should work. Any further discussion you had in mind?
> > Directory hierarchy (of both the source files and /etc files), etc.?
> > I've not done a great deal with autotools offhand.
> >
> > As for /etc files .. I'd prefer a /etc/opencalea/ directory with config
> > files under there. I don't think glib currently supports "include"
> > directives in ini files, but maybe it will some day, and that can make
> > packaging easier.
> >
> >
> > On Wed, 2007-03-21 at 17:59 -0400, Manish Karir wrote:
> >> I think a glib dependency is okay....and we will probably end up using
> >> something from it sooner or later. the config file parsing seems to be
> >> a good reason to include it by itself.
> >>
> >> -manish
> >>
> >> On Wed, 21 Mar 2007, Jesse Norell wrote:
> >>
> >>>> I was considering it. If you want to bring glib in we might as well use
> >>>> it for that .. were you planning on adding that as a dependency (eg. for
> >>>> other reasons as well)?
> >>>>
> >>>>
> >>>>
> >>>> On Wed, 2007-03-21 at 16:57 -0400, Manish Karir wrote:
> >>>>> I would prefer to use the glib functions for this. If you are going to
> >>>>> implement this lets discuss this in detail first please.
> >>>>>
> >>>>> thanks
> >>>>> manish
> >>>>>
> >>>>>
> >>>>> On Wed, 21 Mar 2007, Jesse Norell wrote:
> >>>>>
> >>>>>>
> >>>>>> Hello,
> >>>>>>
> >>>>>> Any preferences on a piece to do config file parsing? In a little
> >>>>>> searching I found http://ndevilla.free.fr/iniparser/ .. it's pretty
> >>>>>> simple and would at least work to get started.
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> Jesse Norell - jesse@kci.net
> >>>>>> Kentec Communications, Inc.
> >>>>>>
> >>>>>>
> >>>> --
> >>>> Jesse Norell - jesse@kci.net
> >>>> Kentec Communications, Inc.
> >>>>
> >>>>
> >>>
> > --
> > Jesse Norell - jesse@kci.net
> > Kentec Communications, Inc.
> >
> >
--
Jesse Norell - jesse@kci.net
Kentec Communications, Inc.
|