Use embedded Linux and open-source software to build a networked audio appliance.
ZFS is often looked upon as an advanced, superior file-system and one of the strong points of the Solaris/OpenSolaris platform while most feel that only recently has Linux been able to catch-up on the file-system front with EXT4 and the still-experimental Btrfs.
It runs on computers based on the 32-bit Intel x86 architecture, or on 64-bit AMD processors in 32-bit mode.
By Source Seeker on Wed, 07/28/10 - 5:55pm. Yesterday SAP took another step into the open source world by signing on to use the Black Duck Suite .
WikiLeaks is currently in the news because its Afghan War logs comprise one of the largest and most controversial intelligence leaks to date.
Convirture has unveiled a management tool for open source hypervisors. It's been clear from the beginning of the server virtualization wave that eventually the hypervisor would become commoditized and that the real action, in terms of functionality as well as in money, would come with the management tools that wrap around the hypervisor and make it ...
May 4, 2009 ... As an alternative to downloading the files, the HCPM/HAI Synthesis Cost Proxy Model may be obtained from the FCC's duplicating contractor, ... http://www.fcc.gov/ccb/apd/hcpm/ Patent Database Notices and Status The database servers are now capable of processing approximately 300 simultaneous searches.
Marvell announced the availability of an open source installer, simplifying software deployment on its Linux-based Plug Computer reference design.
July 28, 2010, 09:59 AM - Computerworld - Google on Monday patched five vulnerabilities in Chrome by issuing a new "stable" build of the browser.
| Browse in : |
All
> Documents
> Man Pages
> File Formats (375)
|
An ACL entry contains an entry tag type, an optional entry tag qualifier, and a set of permissions. We use the term qualifier to denote the entry tag qualifier of an ACL entry.
The qualifier denotes the identifier of a user or a group, for entries with tag types of ACL_USER or ACL_GROUP, respectively. Entries with tag types other than ACL_USER or ACL_GROUP have no defined qualifiers.
The following entry tag types are defined:
When an access check is performed, the ACL_USER_OBJ and ACL_USER entries are tested against the effective user ID. The effective group ID, as well as all supplementary group IDs are tested against the ACL_GROUP_OBJ and ACL_GROUP entries.
All user ID qualifiers must be unique among all entries of ACL_USER tag type, and all group IDs must be unique among all entries of ACL_GROUP tag type.
The Fn acl_get_file function returns an ACL with zero ACL entries as the default ACL of a directory, if the directory is not associated with a default ACL. The Fn acl_set_file function also accepts an ACL with zero ACL entries as a valid default ACL for directories, denoting that the directory shall not be associated with a default ACL. This is equivalent to using the Fn acl_delete_def_file function.
Modification of the file permission bits results in the modification of the permissions in the associated ACL entries. Modification of the permissions in the ACL entries results in the modification of the file permission bits.
If no default ACL is associated with a directory, the mode parameter to the functions creating file objects and the file creation mask (see umask(2)) are used to determine the ACL of the new object:
if the ACL_USER_OBJ entry contains the requested permissions, access is granted,
else access is denied.
if the matching ACL_USER entry and the ACL_MASK entry contain the requested permissions, access is granted,
else access is denied.
if the ACL contains an ACL_MASK entry, then if the ACL_MASK entry and any of the matching ACL_GROUP_OBJ or ACL_GROUP entries contain the requested permissions, access is granted,
else access is denied.
else (note that there can be no ACL_GROUP entries without an ACL_MASK entry) if the ACL_GROUP_OBJ entry contains the requested permissions, access is granted,
else access is denied.
The second field contains the user or group identifier of the user or group associated with the ACL entry for entries of entry tag type ACL_USER or ACL_GROUP, and is empty for all other entries. A user identifier can be a user name or a user ID number in decimal form. A group identifier can be a group name or a group ID number in decimal form.
The third field contains the discretionary access permissions. The read, write and search/execute permissions are represented by the r w and x characters, in this order. Each of these characters is replaced by the - character to denote that a permission is absent in the ACL entry. When converting from the text form to the internal representation, permissions that are absent need not be specified.
White space is permitted at the beginning and end of each ACL entry, and immediately before and after a field separator (the colon character).
user::rw- user:lisa:rw- #effective:r-- group::r-- group:toolies:rw- #effective:r-- mask::r-- other::r--
u::rw-,u:lisa:rw-,g::r--,g:toolies:rw-,m::r--,o::r-- g:toolies:rw,u:lisa:rw,u::wr,g::r,o::r,m::r
The effect of the chmod(1) utility, and of the chmod(2) system call, on the access ACL is described in Sx CORRESPONDENCE BETWEEN ACL ENTRIES AND FILE PERMISSION BITS .
Linux Access Control Lists implement the full set of functions and utilities defined for Access Control Lists in POSIX.1e, and several extensions. The implementation is fully compliant with POSIX.1e draft 17; extensions are marked as such. The Access Control List manipulation functions are defined in the ACL library (libacl, -lacl). The POSIX compliant interfaces are declared in the <sys/acl.h> header. Linux-specific extensions to these functions are declared in the <acl/libacl.h> header.
acl_add_perm3, acl_calc_mask3, acl_clear_perms3, acl_delete_perm3, acl_get_permset3, acl_set_permset3
acl_get_qualifier3, acl_get_tag_type3, acl_set_qualifier3, acl_set_tag_type3
acl_delete_def_file3, acl_dup3, acl_free3, acl_from_text3, acl_get_fd3, acl_get_file3, acl_init3, acl_set_fd3, acl_set_file3, acl_to_text3, acl_valid3
acl_add_perm3, acl_calc_mask3, acl_clear_perms3, acl_copy_entry3, acl_copy_ext3, acl_copy_int3, acl_create_entry3, acl_delete_entry3, acl_delete_perm3, acl_get_entry3, acl_get_permset3, acl_get_qualifier3, acl_get_tag_type3, acl_set_permset3, acl_set_qualifier3, acl_set_tag_type3, acl_size3
acl_check3, acl_cmp3, acl_entries3, acl_equiv_mode3, acl_error3, acl_extended_fd3, acl_extended_file3, acl_from_mode3, acl_get_perm3, acl_to_any_text3
Any line not prefixed with # is interpreted. The configuration lines are composed like:
server name [ options ]
The path name must be a fully qualified path name, or a path name using either the ~ shell shorthand or any of the substitution variables, which are listed below.
The possible options and their meanings are:
uams_dhx_passwd.so or uams_dhx_pam.so - allows logins using Diffie-Hellman eXchange (DHX)
uams_guest.so - allows guest logins
uams_passwd.so or uams_pam.so - allows logins with clear text passwords
uams_randum.so - allows Random Number and Two-Way Random Number Exchange for authentication (requires /etc/atalk//afppaswd file)
The name is the name to alias, and the addr_n are the aliases for that name. addr_n can be another alias, a local username, a local filename, a command, an include file, or an external address.
Lines beginning with white space are continuation lines. Another way to continue lines is by placing a backslash directly before a newline. Lines beginning with # are comments.
Aliasing occurs only on local names. Loops can not occur, since no message will be sent to any person more than once.
If an alias is found for name, sendmail then checks for an alias for owner-name. If it is found and the result of the lookup expands to a single address, the envelope sender address of the message is rewritten to that address. If it is found and the result expands to more than one address, the envelope sender address is changed to owner-name.
After aliasing has been done, local and valid recipients who have a ``.forward`` file in their home directory have messages forwarded to the list of users defined in that file.
This is only the raw data file; the actual aliasing information is placed into a binary format in the file /etc/mail/aliases.db using the program newaliases(1). A newaliases command should be executed each time the aliases file is changed for the change to take effect.
SENDMAIL Installation and Operation Guide.
SENDMAIL An Internetwork Mail Router.
Job-description lines are of the form:
period delay job-identifier command
The period is specified in days, the delay in minutes. The job-identifier can contain any non-blank character, except slashes. It is used to identify the job in Anacron messages, and as the name for the job`s timestamp file. The command can be any shell command.
Environment assignment lines are of the form:
VAR = VALUE
Spaces around VAR are removed. No spaces around VALUE are allowed (unless you want them to be part of the value). The assignment takes effect from the next line to the end of the file, or to the next assignment of the same variable.
Empty lines are either blank lines, line containing white-space only, or lines with white-space followed by a `#` followed by an arbitrary comment.
# # comments # [<where>] [-np #] [-s <where>] [-wd <dir>] [-x <env>] <program> [<args>] [<where>] [-np #] [-s <where>] [-wd <dir>] [-x <env>] <program> [<args>] ...
The meaning of the options is the same as in mpirun(1). See the mpirun(1) man page for a lengthy discussion of the nomenclature used for <where>. Note, however, that if -wd is used in the application schema file, it will override any -wd value specified on the command line.
For each program line, processes will be created on LAM nodes according to the presence of <where> and the process count option (-np).
# # Example application schema # Note that it may be necessary to specify the entire pathname for # "master" and "slave" if you get "File not found" errors from # mpirun(1). # # This schema starts a "master" process on CPU 0 with the argument # "42.0", and then 10 "slave" processes (that are all sent from the # local node) scheduled across all available CPUs. # c0 master 42.0 C -np 10 -s h slave
Any line not prefixed with # is interpreted. The configuration lines are composed like:
interface [ options ]
The interface is the network interface that this to work over, such as eth0 for Linux, or le0 for Sun.
The possible options and their meanings are:
The format of the files is a list of usernames, one on each line. Whitespace is not permitted.
The superuser may always use at.
If the file /etc/at.allow exists, only usernames mentioned in it are allowed to use at.
If /etc/at.allow does not exist, /etc/at.deny is checked.
Maps can be changed on the fly and the automouter will recognize those changes on the next operation it performs on that map. This is not true for the auto.master map!
For direct mounts this is the full path of the mountpoint. This map is always associated with the /- mountpoint in the master map.
kernel -ro,soft,intr ftp.kernel.org:/pub/linux boot -fstype=ext2 :/dev/hda1 windoze -fstype=smbfs ://windoze/c removable -fstype=ext2 :/dev/hdd cd -fstype=iso9660,ro :/dev/hdc floppy -fstype=auto :/dev/fd0 server -rw,hard,intr / -ro myserver.me.org:/ /usr myserver.me.org:/usr /home myserver.me.org:/home
In the first line we have a NFS remote mount of the kernel directory on ftp.kernel.org. This is mounted read-only. The second line mounts an ext2 volume on a local ide drive. The third makes a share exported from a Windows machine available for automounting. The rest should be fairly self-explanatory. The last entry (the last three lines) is an example of a multi-map (see below).
If you use the automounter for a filesystem without access permissions (like vfat), users usually can`t write on such a filesystem because it is mounted as user root. You can solve this problem by passing the option gid=<gid>, e. g. gid=floppy. The filesystem is then mounted as group floppy instead of root. Then you can add the users to this group, and they can write to the filesystem. Here`s an example entry for an autofs map:
floppy-vfat -fstype=vfat,sync,gid=floppy,umask=002 :/dev/fd0
* &:/home/&
This will enable you to access all the home directory of local hosts using the path /mountpoint/hostname/local-path.
ARCH Architecture (uname -m) CPU Processor Type HOST Hostname (uname -n) OSNAME Operating System (uname -s) OSREL Release of OS (uname -r) OSVERS Version of OS (uname -v)
Additional entries can be defined with the -Dvariable=Value map-option to automount(8).
key [-options] [mountpoint [-options] location...]...
This may extend over multiple lines, quoting the line-breaks with ``. If present, the per-mountpoint mount-options are appended to the default mount-options.
Multiple replicated hosts, same path: <path> host1,host2,hostn:/path/path Multiple hosts, some with same path, some with another <path> host1,host2:/blah host3:/some/other/path Multiple replicated hosts, different (potentially) paths: <path> host1:/path/pathA host2:/path/pathB Mutliple weighted, replicated hosts same path: <path> host1(5),host2(6),host3(1):/path/path Multiple weighted, replicated hosts different (potentially) paths: <path> host1(3):/path/pathA host2(5):/path/pathB Anything else is questionable and unsupported, but these variations will also work: <path> host1(3),host:/blah
Buffindexed is one of ovmethod which is specified in inn.conf(5). It uses preconfigured buffer files which are used to store overview data and index, and never needs more disk space other than those files. The files are devided 8KB block internally and the block is allocated for each purpose; overview index and overview data. The block is never shared by each newsgroup, so owned by one newsgroup. There is a database file: <pathdb in inn.conf>/group.index which includes the information of the newsgroup; the pointer to the index block for the group, high mark, low mark, flag of the group, the number of the articles and etc. This file is created automatically when all buffers are initialized and must not be edited manually. If all buffers are filled up, innd(8) throttles itself. Note that the buffer files are never rolled over and overwritten the way CNFS does. You need to append another buffer file in the case. You can see the buffer usage with inndf(8) with ``-o`` option.
The file consists of a series of lines; blank lines and lines beginning with a number sign (``#``) are ignored. There is only one kind of configuration line. The order of lines in this file is not important.
index:file_name:buffer_size
``Index`` is an index of overview buffer. ``Index`` must be between 0 and 65535. ``File_name`` is the path to overview buffer file. The length of this path should be within 63 letters. ``Buffer_size`` is the length of buffer file in kilobytes in decimal (1KB = 1024 bytes). If the ``file_name`` is not a special device, actucal file size must be buffer_size * 1024 bytes. You can NOT use buffers over 2GB even if you specify <--with-largefiles at configure>. Or buffers will be broken. It`ll be fixed in the future.
To create new overview buffer, there are two different methods for creating the files.
#!/bin/sh disk=$1 major=`ls -l /dev/dsk/$disk | awk `{print $5}` | tr -d ,` minor=`ls -l /dev/dsk/$disk | awk `{print $6}` mkdir /ovbuff mknod /ovbuff/$disk b $major $minor
The created device files themselves consume very little space.In either case, make certain that each overview buffer file is owned by <USER specified with --with-news-user at configure>, <GROUP specified with --with-news-group at configure>, and has read/write modes for the owner and group (mode ``0664`` or ``0660``).
When you first start innd(8) and everything is configured properly, you should see messages in <pathlog in inn.conf>/news.notice which look like:
Aug 27 00:00:00 kevlar innd: buffindexed: No magic cookie found for buffindexed 0, initializing
You MUST recreate whole overview, if you remove or relpace buffers. You need not recreate, if you just append new buffers. And whenever recreate overview data base, you need to clean all buffers.
The charmap-definition itself starts with the keyword CHARMAP in column 1.
The following lines may have one of the two following forms to define the character-encodings:
The last line in a charmap-definition file must contain END CHARMAP.
Each line in the file can be a configuration directive, a blank line, or a comment. Comment lines start with the # character.
The basic operations are defined on z = a+b*i and w = c+d*i as:
Nearly all math function have a complex counterpart but there are some complex only functions.
/* check that exp(i*pi) == -1 */ #include <math.h> /* for atan */ #include <complex.h> main() { double pi = 4*atan(1); complex z = cexp(I*pi); printf("%f+%f*i ", creal(z), cimag(z)); }
A configuration file is divided into a number of sections. Each section starts with a line [ section_name ] and ends when a new section is started or end of file is reached. A section name can consist of alphanumeric characters and underscores.
The first section of a configuration file is special and is referred to as the default section this is usually unnamed and is from the start of file until the first named section. When a name is being looked up it is first looked up in a named section (if any) and then the default section.
The environment is mapped onto a section called <FONT SIZE="-1">ENV</FONT>.
Comments can be included by preceding them with the # character
Each section in a configuration file consists of a number of name and value pairs of the form name=value
The name string can contain any alphanumeric characters as well as a few punctuation symbols such as . , ; and _.
The value string consists of the string following the = character until end of line with any leading and trailing white space removed.
The value string undergoes variable expansion. This can be done by including the form $var or ${var}: this will substitute the value of the named variable in the current section. It is also possible to substitute a value from another section using the syntax $section::name or ${section::name}. By using the form $ENV::name environment variables can be substituted. It is also possible to assign values to environment variables by using the name ENV::name, this will work if the program looks up environment variables using the <FONT SIZE="-1">CONF</FONT> library instead of calling getenv() directly.
It is possible to escape certain characters by using any kind of quote or the character. By making the last character of a line a a value string can be spread across multiple lines. In addition the sequences , , and are recognized.
To enable library configuration the default section needs to contain an appropriate line which points to the main configuration section. The default name is openssl_conf which is used by the openssl utility. Other applications may use an alternative name such as myapplicaton_conf.
The configuration section should consist of a set of name value pairs which contain specific module configuration information. The name represents the name of the configuration module the meaning of the value is module specific: it may, for example, represent a further configuration section containing configuration module specific information. E.g.
openssl_conf = openssl_init
[openssl_init]
oid_section = new_oids engines = engine_section
[new_oids]
... new oids here ...
[engine_section]
... engine stuff here ...
Currently there are two configuration modules. One for <FONT SIZE="-1">ASN1</FONT> objects another for <FONT SIZE="-1">ENGINE</FONT> configuration.
[new_oids]
some_new_oid = 1.2.3.4 some_other_oid = 1.2.3.5
The section pointed to by engines is a table of engine names (though see engine_id below) and further sections containing configuration informations specific to each <FONT SIZE="-1">ENGINE</FONT>.
Each <FONT SIZE="-1">ENGINE</FONT> specific section is used to set default algorithms, load dynamic, perform initialization and send ctrls. The actual operation performed depends on the command name which is the name of the name value pair. The currently supported commands are listed below.
For example:
[engine_section]
# Configure ENGINE named "foo" foo = foo_section # Configure ENGINE named "bar" bar = bar_section
[foo_section] ... foo ENGINE specific commands ...
[bar_section] ... "bar" ENGINE specific commands ...
The command engine_id is used to give the <FONT SIZE="-1">ENGINE</FONT> name. If used this command must be first. For example:
[engine_section] # This would normally handle an ENGINE named "foo" foo = foo_section
[foo_section] # Override default name and use "myfoo" instead. engine_id = myfoo
The command dynamic_path loads and adds an <FONT SIZE="-1">ENGINE</FONT> from the given path. It is equivalent to sending the ctrls <FONT SIZE="-1">SO_PATH</FONT> with the path argument followed by <FONT SIZE="-1">LIST_ADD</FONT> with value 2 and <FONT SIZE="-1">LOAD</FONT> to the dynamic <FONT SIZE="-1">ENGINE</FONT>. If this is not the required behaviour then alternative ctrls can be sent directly to the dynamic <FONT SIZE="-1">ENGINE</FONT> using ctrl commands.
The command init determines whether to initialize the <FONT SIZE="-1">ENGINE</FONT>. If the value is 0 the <FONT SIZE="-1">ENGINE</FONT> will not be initialized, if 1 and attempt it made to initialized the <FONT SIZE="-1">ENGINE</FONT> immediately. If the init command is not present then an attempt will be made to initialize the <FONT SIZE="-1">ENGINE</FONT> after all commands in its section have been processed.
The command default_algorithms sets the default algorithms an <FONT SIZE="-1">ENGINE</FONT> will supply using the functions ENGINE_set_default_string()
If the name matches none of the above command names it is assumed to be a ctrl command which is sent to the <FONT SIZE="-1">ENGINE</FONT>. The value of the command is the argument to the ctrl command. If the value is the string <FONT SIZE="-1">EMPTY</FONT> then no value is sent to the command.
For example:
[engine_section]
# Configure ENGINE named "foo" foo = foo_section
[foo_section] # Load engine from DSO dynamic_path = /some/path/fooengine.so # A foo specific ctrl. some_ctrl = some_value # Another ctrl that doesn`t take a value. other_ctrl = EMPTY # Supply all default algorithms default_algorithms = ALL
This can be worked around by including a default section to provide a default value: then if the environment lookup fails the default value will be used instead. For this to work properly the default value must be defined earlier in the configuration file than the expansion. See the <FONT SIZE="-1">EXAMPLES</FONT> section for an example of how to do this.
If the same variable exists in the same section then all but the last value will be silently ignored. In certain circumstances such as with DNs the same field may occur multiple times. This is usually worked around by ignoring any characters before an initial . e.g.
1.OU="My first OU" 2.OU="My Second OU"
# This is the default section.
HOME=/temp RANDFILE= ${ENV::HOME}/.rnd configdir=$ENV::HOME/config
[ section_one ]
# We are now in section one.
# Quotes permit leading and trailing whitespace any = " any variable name "
other = A string that can cover several lines by including \ characters
message = Hello World
[ section_two ]
greeting = $section_one::message
This next example shows how to expand environment variables safely.
Suppose you want a variable called tmpfile to refer to a temporary filename. The directory it is placed in can determined by the the <FONT SIZE="-1">TEMP</FONT> or <FONT SIZE="-1">TMP</FONT> environment variables but they may not be set to any value at all. If you just include the environment variable names and the variable doesn`t exist then this will cause an error when an attempt is made to load the configuration file. By making use of the default section both values can be looked up with <FONT SIZE="-1">TEMP</FONT> taking priority and /tmp used if neither is defined:
TMP=/tmp # The above value is used if TMP isn`t in the environment TEMP=$ENV::TMP # The above value is used if TEMP isn`t in the environment tmpfile=${ENV::TEMP}/tmp.filename
The escaping isn`t quite right: if you want to use sequences like you can`t use any quote escaping on the same line.
Files are loaded in a single pass. This means that an variable expansion will only work if the variables referenced are defined earlier in the file.
The file consists of a series of lines; blank lines and lines beginning with a number sign (``#``) are ignored. All other lines consist of four fields separated by a colon:
The first field is the name of the message for which this line is valid. It should be either the name of the control message or the word ``all`` to mean that it is valid for all messages.
The second field is a shell-style pattern that matches the email address of the person posting the message. (The poster`s address is first converted to lowercase.) The matching is done using the shell`s case statement (or the equivalent); see sh(1) for details.
If the control message is ``newgroup`` or ``rmgroup`` then the third field specifies the shell-style pattern that must match the group being created or removed. If the control message is ``checkgroups`` then the third field specifies the shell-style pattern that is used to determine which newsgroups are processed for checking. If the control message is of a different type, then this field is ignored.
The fourth field specifies what action to take on control messages that match this line. The following actions are understood:
Processing of a ``checkgroups`` message will never actually change the active(5) file. The difference between an action of doit (or verify) and an action of mail for ``checkgroups`` control messages lies only in what mail is sent; doit will mail the news administrator a shell script to create, delete, or modify newsgroups to match the ``checkgroups`` message, whereas mail will just mail the entire message. In either case, the news administrator will have to take action to implement the ``checkgroups`` and if the mail is ignored, nothing will be changed.
Lines are matched in order; the last match found in the file is the one that is used. For example, with the following three lines:
newgroup:*:*:drop newgroup:group-admin@isc.org:comp.*|humanities.*|misc.*|news.*| rec.*|sci.*|soc.*|talk.*:verify-news.announce.newgroups newgroup:kre@munnari.oz.au:aus.*:mail
Use of the verify action for processing ``newgroup``, ``rmgroup``, and ``checkgroups`` messages is strongly recommended. Abuse of control messages is rampant, and authentication via PGP signatures is currently the only reliable way to be sure that a control message comes from who it claims to be from. Most major hierarchies are now using PGP-authenticated control messages.
In order to use verify actions, the PGP key ring of the news user must be populated with the PGP keys of the hierarchy maintainers whose control messages you want to honor. For more details on PGP-authenticated control messages and the URL for downloading the PGP keys of major hierarchies, see pgpverify(8).
Control messages of type ``cancel`` are handled internally by innd(8) and cannot be controlled by any of the mechanisms described here.
cvs manages source repositories, the directories containing master copies of the revision-controlled files, by copying particular revisions of the files to (and modifications back from) developers` private working directories. In terms of file structure, each individual source repository is an immediate subdirectory of $CVSROOT.
The files described here are supporting files; they do not have to exist for cvs to operate, but they allow you to make cvs operation more flexible.
You can use the `modules` file to define symbolic names for collections of source maintained with cvs. If there is no `modules` file, developers must specify complete path names (absolute, or relative to $CVSROOT) for the files they wish to manage with cvs commands.
You can use the `commitinfo` file to define programs to execute whenever `cvs commit` is about to execute. These programs are used for ``pre-commit`` checking to verify that the modified, added, and removed files are really ready to be committed. Some uses for this check might be to turn off a portion (or all) of the source repository from a particular person or group. Or, perhaps, to verify that the changed files conform to the site`s standards for coding practice.
You can use the `cvswrappers` file to record cvs wrapper commands to be used when checking files into and out of the repository. Wrappers allow the file or directory to be processed on the way in and out of CVS. The intended uses are many, one possible use would be to reformat a C file before the file is checked in, so all of the code in the repository looks the same.
You can use the `loginfo` file to define programs to execute after any commit, which writes a log entry for changes in the repository. These logging programs might be used to append the log message to a file. Or send the log message through electronic mail to a group of developers. Or, perhaps, post the log message to a particular newsgroup.
You can use the `taginfo` file to define programs to execute after any tagorrtag operation. These programs might be used to append a message to a file listing the new tag name and the programmer who created it, or send mail to a group of developers, or, perhaps, post a message to a particular newsgroup.
You can use the `rcsinfo` file to define forms for log messages.
You can use the `editinfo` file to define a program to execute for editing/validating `cvs commit` log entries. This is most useful when used with a `rcsinfo` forms specification, as it can verify that the proper fields of the form have been filled in by the user committing the change.
You can use the `cvsignore` file to specify the default list of files to ignore during update.
You can use the `history` file to record the cvs commands that affect the repository. The creation of this file enables history logging.
The `modules` file may contain blank lines and comments (lines beginning with `#`) as well as module definitions. Long lines can be continued on the next line by specifying a backslash (````) as the last character on the line.
A module definition is a single line of the `modules` file, in either of two formats. In both cases, mname represents the symbolic module name, and the remainder of the line is its definition.
mname -a aliases...
This represents the simplest way of defining a module mname. The `-a` flags the definition as a simple alias: cvs will treat any use of mname (as a command argument) as if the list of names aliases had been specified instead. aliases may contain either other module names or paths. When you use paths in aliases, `cvs checkout` creates all intermediate directories in the working directory, just as if the path had been specified explicitly in the cvs arguments.
mname [ options ] dir [ files... ] [ &module... ]
In the simplest case, this form of module definition reduces to `mname dir`. This defines all the files in directory dir as module mname. dir is a relative path (from $CVSROOT) to a directory of source in one of the source repositories. In this case, on checkout, a single directory called mname is created as a working directory; no intermediate directory levels are used by default, even if dir was a path involving several directory levels.
By explicitly specifying files in the module definition after dir, you can select particular files from directory dir. The sample definition for modules is an example of a module defined with a single file from a particular directory. Here is another example:
m4test unsupported/gnu/m4 foreach.m4 forloop.m4
With this definition, executing `cvs checkout m4test` will create a single working directory `m4test` containing the two files listed, which both come from a common directory several levels deep in the cvs source repository.
A module definition can refer to other modules by including `&module` in its definition. checkout creates a subdirectory for each such module, in your working directory.
New in cvs 1.3; avoid this feature if sharing module definitions with older versions of cvs.
Finally, you can use one or more of the following options in module definitions:
`-d name`, to name the working directory something other than the module name.
New in cvs 1.3; avoid this feature if sharing module definitions with older versions of cvs.
`-i prog` allows you to specify a program prog to run whenever files in a module are committed. prog runs with a single argument, the full pathname of the affected directory in a source repository. The `commitinfo`, `loginfo`, and `editinfo` files provide other ways to call a program on commit.
`-o prog` allows you to specify a program prog to run whenever files in a module are checked out. prog runs with a single argument, the module name.
`-e prog` allows you to specify a program prog to run whenever files in a module are exported. prog runs with a single argument, the module name.
`-t prog` allows you to specify a program prog to run whenever files in a module are tagged. prog runs with two arguments: the module name and the symbolic tag specified to rtag.
`-u prog` allows you to specify a program prog to run whenever `cvs update` is executed from the top-level directory of the checked-out module. prog runs with a single argument, the full path to the source repository for this module.
For `loginfo`, the rest of the line is a command-line template to execute. The templates can include not only a program name, but whatever list of arguments you wish. If you write `%s` somewhere on the argument list, cvs supplies, at that point, the list of files affected by the commit. The first entry in the list is the relative path within the source repository where the change is being made. The remaining arguments list the files that are being modified, added, or removed by this commit invocation.
For `taginfo`, the rest of the line is a command-line template to execute. The arguments passed to the command are, in order, the tagname , operation (i.e. add for `tag`, mov for `tag -F`, and del for `tag -d`), repository , and any remaining are pairs of filename revision . A non-zero exit of the filter program will cause the tag to be aborted.
For `commitinfo`, the rest of the line is a command-line template to execute. The template can include not only a program name, but whatever list of arguments you wish. The full path to the current source repository is appended to the template, followed by the file names of any files involved in the commit (added, removed, and modified files).
For `rcsinfo`, the rest of the line is the full path to a file that should be loaded into the log message template.
For `editinfo`, the rest of the line is a command-line template to execute. The template can include not only a program name, but whatever list of arguments you wish. The full path to the current log message template file is appended to the template.
You can use one of two special strings instead of a regular expression: `ALL` specifies a command line template that must always be executed, and `DEFAULT` specifies a command line template to use if no regular expression is a match.
The `commitinfo` file contains commands to execute before any other commit activity, to allow you to check any conditions that must be satisfied before commit can proceed. The rest of the commit will execute only if all selected commands from this file exit with exit status 0.
The `rcsinfo` file allows you to specify log templates for the commit logging session; you can use this to provide a form to edit when filling out the commit log. The field after the regular expression, in this file, contains filenames (of files containing the logging forms) rather than command templates.
The `editinfo` file allows you to execute a script before the commit starts, but after the log information is recorded. These "edit" scripts can verify information recorded in the log file. If the edit script exits with a non-zero exit status, the commit is aborted.
The `loginfo` file contains commands to execute at the end of a commit. The text specified as a commit log message is piped through the command; typical uses include sending mail, filing an article in a newsgroup, or appending to a central file.
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English.
The file consists of a series of lines; blank lines and lines beginning with a number sign (``#``) are ignored. There are four kinds of configuration lines: ``cycbuffupdate``, ``refreshinterval``, ``cycbuff`` and ``metacycbuff.`` The order of lines in this file is not important among the same kind of configuration line. But all ``cycbuff`` lines should be presented before any ``metacycbuff`` lines.
``Cycbuffupdate`` line is formatted as:
cycbuffupdate:update
``Update`` is how many article-stores between cycbuff header updates. This line can be omitted and the default value is ``25.``
``Refreshinterval`` line is formatted as:
refreshinterval:interval
``Inerval`` is what interval (seconds) between rereading cycbuff header if cycbuff is preopend. (This is in the case nnrpd(8) runs as a daemon.) This line can be omitted and the default value is ``30.``
``Cycbuff`` line is formatted as:
cycbuff:buffer_name:file_name:buffer_size
``Buffer_name`` is the symbolic name of the buffer. The length of this name should be within 7 letters. This name is referred at ``metacycbuff`` lines. ``File_name`` is the path to buffer file. The length of this path should be within 63 letters. ``Buffer_size`` is the length of buffer file in kilobytes in decimal (1KB = 1024 bytes). If the ``file_name`` is not a special device, the file should be buffer_size * 1024 bytes.
``Metacycbuff`` line is formatted as:
metacycbuff:meta_cyclic_buffer_name:buffer_names[:mode]
``Meta_cyclic_buffer_name`` is the symbolic name of meta-cyclic buffer. This name is referred at ``options`` field at ``cnfs`` entries in storage.conf(5). ``Buffer_names`` is comma separated list of symbolic names of ``cycbuff.`` These buffer names should be defined at ``cycbuff`` lines. If ``buffer_names`` has more than one buffer names, CNFS method stores articles into each ``cycbuff`` in order cyclically. ``Mode`` is the mode of storing article. Currently there are two mode; ``INTERLEAVE`` and ``SEQUENTIAL``. Mode ``INTERLEAVE`` is to store articles into each cycbuff in round robin way. Mode ``SEQUENTIAL`` is to store articles sequentially into one cycbuff until it is filled up. ``Mode`` is optional and the default value without this option is ``INTERLEAVE``.
Also it is necessary to set up ``options`` field at ``cnfs`` entries in storage.conf(5) to use CNFS method. That field should be one of ``meta_cyclic_buffer_name`` defined at ``metacycbuff`` lines.
To create new ``cycbuff``, there are two different methods for creating the cyclic buffer files.
#!/bin/sh disk=$1 link=`ls -l /dev/dsk/$disk | awk `{print $11}`` major=`ls -l /dev/dsk/$link | awk `{print $5}` | tr -d ,` minor=`ls -l /dev/dsk/$link | awk `{print $6}` mkdir /cycbuff mknod /cycbuff/$disk b $major $minor
The created device files themselves consume very little space.In either case, make certain that each overview buffer file is owned by <USER specified with --with-news-user at configure>, <GROUP specified with --with-news-group at configure>, and has read/write modes for the owner and group (mode ``0664`` or ``0660``).
When you first start innd and everything is configured properly, you should see messages in news.notice which look like:
Mar 1 00:00:00 kevlar innd: CNFS-sm No magic cookie found for cycbuff ONE, initializing
The /usr/share/gnome/default.session file contains a list of programs to be launched the first time a user logs into the GNOME environment.
The format of the file is the one used by the gnome_config libraries, and it looks like this:
[Section] SEQID,id=uniqueID SEQID,Priority=PRIO SEQID,RestartCommand=command num_clients=TOP
There are three possible names for Section And they are:
Default
Chooser
Warner
Since the gnome_config file format is not very flexible, an array of data is emulated by listing starting from 0 chunks of "id,Priority,RestartCommand", and at the end the num_clients variable lists the number of chunks listed.
The uniqueid key provides a name that is unique within this file and passed to the app as the client id which it must use to register with gnome-session.
The RestartCommand specifies the command to run from the $PATH.
The Priority determines the order in which the commands are started (with Priority = 0 first) and defaults to 50.
The clients must be numbered from 0 to the value of num_clients-1
The dhclient.conf file is a free-form ASCII text file. It is parsed by the recursive-descent parser built into dhclient. The file may contain extra tabs and newlines for formatting purposes. Keywords in the file are case-insensitive. Comments may be placed anywhere within the file (except within quotes). Comments begin with the # character and end at the end of the line.
The dhclient.conf file can be used to configure the behaviour of the client in a wide variety of ways: protocol timing, information requested from the server, information required of the server, defaults to use if the server does not provide certain information, values with which to override information provided by the server, or values to prepend or append to information provided by the server. The configuration file can also be preinitialized with addresses to use on networks that don`t have DHCP servers.
The following statements can be used to adjust the timing behaviour of the DHCP client if required, however:
The timeout statement
timeout time ;
The timeout statement determines the amount of time that must pass between the time that the client begins to try to determine its address and the time that it decides that it`s not going to be able to contact a server. By default, this timeout is sixty seconds. After the timeout has passed, if there are any static leases defined in the configuration file, or any leases remaining in the lease database that have not yet expired, the client will loop through these leases attempting to validate them, and if it finds one that appears to be valid, it will use that lease`s address. If there are no valid static leases or unexpired leases in the lease database, the client will restart the protocol after the defined retry interval.
The retry statement
retry time;
The retry statement determines the time that must pass after the client has determined that there is no DHCP server present before it tries again to contact a DHCP server. By default, this is five minutes.
The select-timeout statement
select-timeout time;
It is possible (some might say desirable) for there to be more than one DHCP server serving any given network. In this case, it is possible that a client may be sent more than one offer in response to its initial lease discovery message. It may be that one of these offers is preferable to the other (e.g., one offer may have the address the client previously used, and the other may not).
The select-timeout is the time after the client sends its first lease discovery request at which it stops waiting for offers from servers, assuming that it has received at least one such offer. If no offers have been received by the time the select-timeout has expired, the client will accept the first offer that arrives.
By default, the select-timeout is zero seconds - that is, the client will take the first offer it sees.
The reboot statement
reboot time;
When the client is restarted, it first tries to reacquire the last address it had. This is called the INIT-REBOOT state. If it is still attached to the same network it was attached to when it last ran, this is the quickest way to get started. The reboot statement sets the time that must elapse after the client first tries to reacquire its old address before it gives up and tries to discover a new address. By default, the reboot timeout is ten seconds.
The backoff-cutoff statement
backoff-cutoff time;
The client uses an exponential backoff algorithm with some randomness, so that if many clients try to configure themselves at the same time, they will not make their requests in lockstep. The backoff-cutoff statement determines the maximum amount of time that the client is allowed to back off. It defaults to two minutes.
The initial-interval statement
initial-interval time;
The initial-interval statement sets the amount of time between the first attempt to reach a server and the second attempt to reach a server. Each time a message is sent, the interval between messages is incremented by twice the current interval multiplied by a random number between zero and one. If it is greater than the backoff-cutoff amount, it is set to that amount. It defaults to ten seconds.
There is a variety of data contained in offers that DHCP servers send to DHCP clients. The data that can be specifically requested is what are called DHCP Options. DHCP Options are defined in
dhcp-options(5).
The request statement
request [ option ] [, ... option ];
The request statement causes the client to request that any server responding to the client send the client its values for the specified options. Only the option names should be specified in the request statement - not option parameters. By default, the DHCP server requests the subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name, nis-domain, nis-servers, and ntp-servers options.
In some cases, it may be desirable to send no parameter request list at all. To do this, simply write the request statement but specify no parameters:
request;
The require statement
require [ option ] [, ... option ];
The require statement lists options that must be sent in order for an offer to be accepted. Offers that do not contain all the listed options will be ignored.
The send statement
send { [ option declaration ] [, ... option declaration ]}
The send statement causes the client to send the specified options to the server with the specified values. These are full option declarations as described in dhcp-options(5). Options that are always sent in the DHCP protocol should not be specified here, except that the client can specify a requested-lease-time option other than the default requested lease time, which is two hours. The other obvious use for this statement is to send information to the server that will allow it to differentiate between this client and other clients or kinds of clients.
To make it work, you have to declare a key and zone as in the DHCP server (see dhcpd.conf(5) for details). You also need to configure the fqdn option on the client, as follows:
send fqdn.fqdn "grosse.fugue.com."; send fqdn.encoded on; send fqdn.server-update off;
The fqdn.fqdn option MUST be a fully-qualified domain name. You MUST define a zone statement for the zone to be updated. The fqdn.encoded option may need to be set to on or off, depending on the DHCP server you are using.
The do-forward-updates statement
do-forward-updates [ flag ] ;
If you want to do DNS updates in the DHCP client script (see dhclient-script(8)) rather than having the DHCP client do the update directly (for example, if you want to use SIG(0) authentication, which is not supported directly by the DHCP client, you can instruct the client not to do the update using the do-forward-updates statement. Flag should be true if you want the DHCP client to do the update, and false if you don`t want the DHCP client to do the update. By default, the DHCP client will do the DNS update.
The default statement
default [ option declaration ] ;
If for some option the client should use the value supplied by the server, but needs to use some default value if no value was supplied by the server, these values can be defined in the default statement.
The supersede statement
supersede [ option declaration ] ;
If for some option the client should always use a locally-configured value or values rather than whatever is supplied by the server, these values can be defined in the supersede statement.
The prepend statement
prepend [ option declaration ] ;
If for some set of options the client should use a value you supply, and then use the values supplied by the server, if any, these values can be defined in the prepend statement. The prepend statement can only be used for options which allow more than one value to be given. This restriction is not enforced - if you ignore it, the behaviour will be unpredictable.
The append statement
append [ option declaration ] ;
If for some set of options the client should first use the values supplied by the server, if any, and then use values you supply, these values can be defined in the append statement. The append statement can only be used for options which allow more than one value to be given. This restriction is not enforced - if you ignore it, the behaviour will be unpredictable.
The lease declaration
lease { lease-declaration [ ... lease-declaration ] }
The DHCP client may decide after some period of time (see PROTOCOL TIMING) that it is not going to succeed in contacting a server. At that time, it consults its own database of old leases and tests each one that has not yet timed out by pinging the listed router for that lease to see if that lease could work. It is possible to define one or more fixed leases in the client configuration file for networks where there is no DHCP or BOOTP service, so that the client can still automatically configure its address. This is done with the lease statement.
NOTE: the lease statement is also used in the dhclient.leases file in order to record leases that have been received from DHCP servers. Some of the syntax for leases as described below is only needed in the dhclient.leases file. Such syntax is documented here for completeness.
A lease statement consists of the lease keyword, followed by a left curly brace, followed by one or more lease declaration statements, followed by a right curly brace. The following lease declarations are possible:
bootp;
The bootp statement is used to indicate that the lease was acquired using the BOOTP protocol rather than the DHCP protocol. It is never necessary to specify this in the client configuration file. The client uses this syntax in its lease database file.
interface "string";
The interface lease statement is used to indicate the interface on which the lease is valid. If set, this lease will only be tried on a particular interface. When the client receives a lease from a server, it always records the interface number on which it received that lease. If predefined leases are specified in the dhclient.conf file, the interface should also be specified, although this is not required.
fixed-address ip-address;
The fixed-address statement is used to set the ip address of a particular lease. This is required for all lease statements. The IP address must be specified as a dotted quad (e.g., 12.34.56.78).
filename "string";
The filename statement specifies the name of the boot filename to use. This is not used by the standard client configuration script, but is included for completeness.
server-name "string";
The server-name statement specifies the name of the boot server name to use. This is also not used by the standard client configuration script.
option option-declaration;
The option statement is used to specify the value of an option supplied by the server, or, in the case of predefined leases declared in dhclient.conf, the value that the user wishes the client configuration script to use if the predefined lease is used.
script "script-name";
The script statement is used to specify the pathname of the dhcp client configuration script. This script is used by the dhcp client to set each interface`s initial configuration prior to requesting an address, to test the address once it has been offered, and to set the interface`s final configuration once a lease has been acquired. If no lease is acquired, the script is used to test predefined leases, if any, and also called once if no valid lease can be identified. For more information, see dhclient-script(8).
vendor option space "name";
The vendor option space statement is used to specify which option space should be used for decoding the vendor-encapsulate-options option if one is received. The dhcp-vendor-identifier can be used to request a specific class of vendor options from the server. See dhcp-options(5) for details.
medium "media setup";
The medium statement can be used on systems where network interfaces cannot automatically determine the type of network to which they are connected. The media setup string is a system-dependent parameter which is passed to the dhcp client configuration script when initializing the interface. On Unix and Unix-like systems, the argument is passed on the ifconfig command line when configuring the interface.
The dhcp client automatically declares this parameter if it uses a media type (see the media statement) when configuring the interface in order to obtain a lease. This statement should be used in predefined leases only if the network interface requires media type configuration.
renew date;
rebind date;
expire date;
The renew statement defines the time at which the dhcp client should begin trying to contact its server to renew a lease that it is using. The rebind statement defines the time at which the dhcp client should begin to try to contact any dhcp server in order to renew its lease. The expire statement defines the time at which the dhcp client must stop using a lease if it has not been able to contact a server in order to renew it.
These declarations are automatically set in leases acquired by the DHCP client, but must also be configured in predefined leases - a predefined lease whose expiry time has passed will not be used by the DHCP client.
Dates are specified as follows:
<weekday> <year>/<month>/<day> <hour>:<minute>:<second>
The weekday is present to make it easy for a human to tell when a lease expires - it`s specified as a number from zero to six, with zero being Sunday. When declaring a predefined lease, it can always be specified as zero. The year is specified with the century, so it should generally be four digits except for really long leases. The month is specified as a number starting with 1 for January. The day of the month is likewise specified starting with 1. The hour is a number between 0 and 23, the minute a number between 0 and 59, and the second also a number between 0 and 59.
Some DHCP clients running TCP/IP roaming protocols may require that in addition to the lease they may acquire via DHCP, their interface also be configured with a predefined IP alias so that they can have a permanent IP address even while roaming. The Internet Systems Consortium DHCP client doesn`t support roaming with fixed addresses directly, but in order to facilitate such experimentation, the dhcp client can be set up to configure an IP alias using the alias declaration.
The alias declaration resembles a lease declaration, except that options other than the subnet-mask option are ignored by the standard client configuration script, and expiry times are ignored. A typical alias declaration includes an interface declaration, a fixed-address declaration for the IP alias address, and a subnet-mask option declaration. A medium statement should never be included in an alias declaration.
The reject statement causes the DHCP client to reject offers from servers who use the specified address as a server identifier. This can be used to avoid being configured by rogue or misconfigured dhcp servers, although it should be a last resort - better to track down the bad DHCP server and fix it.
interface "name" { declarations ... }
A client with more than one network interface may require different behaviour depending on which interface is being configured. All timing parameters and declarations other than lease and alias declarations can be enclosed in an interface declaration, and those parameters will then be used only for the interface that matches the specified name. Interfaces for which there is no interface declaration will use the parameters declared outside of any interface declaration, or the default settings.
pseudo "name" "real-name" { declarations ... }
Under some circumstances it can be useful to declare a pseudo-interface and have the DHCP client acquire a configuration for that interface. Each interface that the DHCP client is supporting normally has a DHCP client state machine running on it to acquire and maintain its lease. A pseudo-interface is just another state machine running on the interface named real-name, with its own lease and its own state. If you use this feature, you must provide a client identifier for both the pseudo-interface and the actual interface, and the two identifiers must be different. You must also provide a separate client script for the pseudo-interface to do what you want with the IP address. For example:
interface "ep0" { send dhcp-client-identifier "my-client-ep0"; } pseudo "secondary" "ep0" { send dhcp-client-identifier "my-client-ep0-secondary"; script "/etc/dhclient-secondary"; }
The client script for the pseudo-interface should not configure the interface up or down - essentially, all it needs to handle are the states where a lease has been acquired or renewed, and the states where a lease has expired. See dhclient-script(8) for more information.
media "media setup" [ , "media setup", ... ];
The media statement defines one or more media configuration parameters which may be tried while attempting to acquire an IP address. The dhcp client will cycle through each media setup string on the list, configuring the interface using that setup and attempting to boot, and then trying the next one. This can be used for network interfaces which aren`t capable of sensing the media type unaided - whichever media type succeeds in getting a request to the server and hearing the reply is probably right (no guarantees).
The media setup is only used for the initial phase of address acquisition (the DHCPDISCOVER and DHCPOFFER packets). Once an address has been acquired, the dhcp client will record it in its lease database and will record the media type used to acquire the address. Whenever the client tries to renew the lease, it will use that same media type. The lease must expire before the client will go back to cycling through media types.
timeout 60; retry 60; reboot 10; select-timeout 5; initial-interval 2; reject 192.33.137.209; interface "ep0" { send host-name "andare.fugue.com"; send dhcp-client-identifier 1:0:a0:24:ab:fb:9c; send dhcp-lease-time 3600; supersede domain-name "fugue.com rc.vix.com home.vix.com"; prepend domain-name-servers 127.0.0.1; request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name; require subnet-mask, domain-name-servers; script "/sbin/dhclient-script"; media "media 10baseT/UTP", "media 10base2/BNC"; } alias { interface "ep0"; fixed-address 192.5.5.213; option subnet-mask 255.255.255.255; }
This is a very complicated dhclient.conf file - in general, yours should be much simpler. In many cases, it`s sufficient to just create an empty dhclient.conf file - the defaults are usually fine.
if option dhcp-user-class = "accounting" { max-lease-time 17600; option domain-name "accounting.example.org"; option domain-name-servers ns1.accounting.example.org, ns2.accounting.example.org; } elsif option dhcp-user-class = "sales" { max-lease-time 17600; option domain-name "sales.example.org"; option domain-name-servers ns1.sales.example.org, ns2.sales.example.org; } elsif option dhcp-user-class = "engineering" { max-lease-time 17600; option domain-name "engineering.example.org"; option domain-name-servers ns1.engineering.example.org, ns2.engineering.example.org; } else { max-lease-time 600; option domain-name "misc.example.org"; option domain-name-servers ns1.misc.example.org, ns2.misc.example.org; }
On the client side, an example of conditional evaluation might be:
# example.org filters DNS at its firewall, so we have to use their DNS # servers when we connect to their network. If we are not at # example.org, prefer our own DNS server. if not option domain-name = "example.org" { prepend domain-name-servers 127.0.0.1; }
The if statement and the elsif continuation statement both take boolean expressions as their arguments. That is, they take expressions that, when evaluated, produce a boolean result. If the expression evaluates to true, then the statements enclosed in braces following the if statement are executed, and all subsequent elsif and else clauses are skipped. Otherwise, each subsequent elsif clause`s expression is checked, until an elsif clause is encountered whose test evaluates to true. If such a clause is found, the statements in braces following it are executed, and then any subsequent elsif and else clauses are skipped. If all the if and elsif clauses are checked but none of their expressions evaluate true, then if there is an else clause, the statements enclosed in braces following the else are evaluated. Boolean expressions that evaluate to null are treated as false in conditionals.
data-expression-1 = data-expression-2
The = operator compares the values of two data expressions, returning true if they are the same, false if they are not. If either the left-hand side or the right-hand side are null, the result is also null.
boolean-expression-1 and boolean-expression-2
boolean-expression-1 or boolean-expression-2
not boolean-expression
exists option-name
substring (data-expr, offset, length)
suffix (data-expr, length)
option option-name
config-option option-name
hardware
packet (offset, length)
string
colon-separated hexadecimal list
concat (data-expr1, ..., data-exprN)
reverse (numeric-expr1, data-expr2)
leased-address
binary-to-ascii (numeric-expr1, numeric-expr2, data-expr1, data-expr2)
As an example of the preceding three types of expressions, to produce the name of a PTR record for the IP address being assigned to a client, one could write the following expression:
concat (binary-to-ascii (10, 8, ".", reverse (1, leased-address)), ".in-addr.arpa.");
encode-int (numeric-expr, width)
pick-first-value (data-expr1 [ ... exprn ] )
host-decl-name
extract-int (data-expr, width)
lease-time
number
client-state
log (priority, data-expr)
Logging statements take only a single data expression argument, so if you want to output multiple data values, you will need to use the concat operator to concatenate them.
The DHCP client and server have the ability to dynamically update the Domain Name System. Within the configuration files, you can define how you want the Domain Name System to be updated. These updates are RFC 2136 compliant so any DNS server supporting RFC 2136 should be able to accept updates from the DHCP server.
Dynamic DNS (DDNS) updates are performed by using the dns-update expression. The dns-update expression is a boolean expression that takes four parameters. If the update succeeds, the result is true. If it fails, the result is false. The four parameters that the are the resource record type (RR), the left hand side of the RR, the right hand side of the RR and the ttl that should be applied to the record. The simplest example of the use of the function can be found in the reference section of the dhcpd.conf file, where events are described. In this example several statements are being used to make the arguments to the dns-updateR.
In the example, the first argument to the first Bdns-update expression is a data expression that evaluates to the A RR type. The second argument is constructed by concatenating the DHCP host-name option with a text string containing the local domain, in this case "ssd.example.net". The third argument is constructed by converting the address the client has been assigned from a 32-bit number into an ascii string with each byte separated by a ".". The fourth argument, the TTL, specifies the amount of time remaining in the lease (note that this isn`t really correct, since the DNS server will pass this TTL out whenever a request comes in, even if that is only a few seconds before the lease expires).
If the first dns-update statement succeeds, it is followed up with a second update to install a PTR RR. The installation of a PTR record is similar to installing an A RR except that the left hand side of the record is the leased address, reversed, with ".in-addr.arpa" concatenated. The right hand side is the fully qualified domain name of the client to which the address is being leased.
STATEMENTS
interface <interface name> { [declarations] };
Write configurations for this interface in this statement. In [declarations], options can be specified.DECLARATIONS
send [dhcpoptions];
With this declaration, dhcp6c sends specified options. Currently rapid-commit is defined.send rapid-commit;
This declaration enables dhcp6c to request the dhcp6s server to perform a Rapid Commit.request [dhcpoptions];
This declaration enables dhcp6c to request specified options. Currently temp-address, domain-name-servers, and prefix-delegation are defined.request domain-name-servers;
The DHCPv6 mechanism provides a way to obtain configuration information such as a list of available DNS servers or NTP servers. This declaration enables dhcp6c to request a DNS server address from the DHCPv6 server.request prefix-delegation;
This declaration enables dhcp6c to request a Prefix Delegation to the DHCPv6 server. dhcp6c gets a prefix assignment from the DHCPv6 server.request temp-address;
This declaration enables dhcp6c to request temporary addresses. dhcp6c requests Non-temporary Addresses as default. This option makes dhcp6c request Temporary Addresses.information-only;
This declaration enables dhcp6c to request host configuration information from the DHCPv6 server. If dhcp6c doesn`t need to be assigned any addresses, this option should be specified.address { [<ipv6 address>/<prefix length>]; [prefer-life-time <preferred-lifetime>]; [valid-life-time <valid-lifetime>]; };
This declaration defines the dhcp6c client preferred IPv6 address, the preferred lifetime of the address, and the valid lifetime for this interface.prefix { [<ipv6 prefix>/<prefix length>]; [prefer-life-time <preferred-lifetime>]; [valid-life-time <valid-lifetime>]; };
This declaration defines the dhcp6c client acting as a requesting router for the preferred prefix, the prefix length, and the prefix`s preferred lifetime, and valid lifetime for this interface.prefer-life-time <preferred-lifetime>;
This declaration sets the preferred lifetime (in seconds) of the address or prefix. This declaration is valid only in address or prefix declarations.valid-life-time <valid-lifetime>;
This declaration sets the valid lifetime (in seconds) of the address or prefix. This declaration is valid only in address or prefix declarations.renew-time <renew-time>;
This declaration specifies the Renew Time (in seconds) for this Identity Association (IA). Renew Time is a T1 value in an IA option. dhcp6c sets the Renew Time in IA options to the specified value.rebind-time <rebind-time>;
This declaration specifies the Rebind Time (in seconds) for this IA. Rebind Time is T2 value in an IA option. dhcp6c sets the Rebind Time in IA options to the specified value.DHCPOPTIONS
rapid-commit
If this option is used in a "send [dhcpoptions];" declaration, dhcp6c sends DHCPv6 messages with a Rapid Commit option.domain-name-servers
If this option is used in a "request [dhcpoptions];" declaration, dhcp6c requests the DNS server address via the DHCPv6 mechanism.prefix-delegation
If this option is used in a "request [dhcpoptions];" declaration, dhcp6c requests a Prefix Delegation to the DHCPv6 servers.This is a sample of the dhcp6c.conf file.
interface eth0 { send rapid-commit; request prefix-delegation; request domain-name-servers; request temp-address; iaid 11111; address { 3ffe:10::10/64; prefer-life-time 6000; valid-life-time 8000; }; renew-time 11000; rebind-time 21000; };
Kazuo Hiekata <hiekata@yamato.ibm.com>
The dhcpd.conf file is a free-form ASCII text file. It is parsed by the recursive-descent parser built into dhcpd. The file may contain extra tabs and newlines for formatting purposes. Keywords in the file are case-insensitive. Comments may be placed anywhere within the file (except within quotes). Comments begin with the # character and end at the end of the line.
The file essentially consists of a list of statements. Statements fall into two broad categories - parameters and declarations.
Parameter statements either say how to do something (e.g., how long a lease to offer), whether to do something (e.g., should dhcpd provide addresses to unknown clients), or what parameters to provide to the client (e.g., use gateway 220.177.244.7).
Declarations are used to describe the topology of the network, to describe clients on the network, to provide addresses that can be assigned to clients, or to apply a group of parameters to a group of declarations. In any group of parameters and declarations, all parameters must be specified before any declarations which depend on those parameters may be specified.
Declarations about network topology include the shared-network and the subnet declarations. If clients on a subnet are to be assigned addresses dynamically, a range declaration must appear within the subnet declaration. For clients with statically assigned addresses, or for installations where only known clients will be served, each such client must have a host declaration. If parameters are to be applied to a group of declarations which are not related strictly on a per-subnet basis, the group declaration can be used.
For every subnet which will be served, and for every subnet to which the dhcp server is connected, there must be one subnet declaration, which tells dhcpd how to recognize that an address is on that subnet. A subnet declaration is required for each subnet even if no addresses will be dynamically allocated on that subnet.
Some installations have physical networks on which more than one IP subnet operates. For example, if there is a site-wide requirement that 8-bit subnet masks be used, but a department with a single physical ethernet network expands to the point where it has more than 254 nodes, it may be necessary to run two 8-bit subnets on the same ethernet until such time as a new physical network can be added. In this case, the subnet declarations for these two networks must be enclosed in a shared-network declaration.
Some sites may have departments which have clients on more than one subnet, but it may be desirable to offer those clients a uniform set of parameters which are different than what would be offered to clients from other departments on the same subnet. For clients which will be declared explicitly with host declarations, these declarations can be enclosed in a group declaration along with the parameters which are common to that department. For clients whose addresses will be dynamically assigned, class declarations and conditional declarations may be used to group parameter assignments based on information the client sends.
When a client is to be booted, its boot parameters are determined by consulting that client`s host declaration (if any), and then consulting any class declarations matching the client, followed by the pool, subnet and shared-network declarations for the IP address assigned to the client. Each of these declarations itself appears within a lexical scope, and all declarations at less specific lexical scopes are also consulted for client option declarations. Scopes are never considered twice, and if parameters are declared in more than one scope, the parameter declared in the most specific scope is the one that is used.
When dhcpd tries to find a host declaration for a client, it first looks for a host declaration which has a fixed-address declaration that lists an IP address that is valid for the subnet or shared network on which the client is booting. If it doesn`t find any such entry, it tries to find an entry which has no fixed-address declaration.
A typical dhcpd.conf file will look something like this:
global parameters... subnet 204.254.239.0 netmask 255.255.255.224 { subnet-specific parameters... range 204.254.239.10 204.254.239.30; } subnet 204.254.239.32 netmask 255.255.255.224 { subnet-specific parameters... range 204.254.239.42 204.254.239.62; } subnet 204.254.239.64 netmask 255.255.255.224 { subnet-specific parameters... range 204.254.239.74 204.254.239.94; } group { group-specific parameters... host zappo.test.isc.org { host-specific parameters... } host beppo.test.isc.org { host-specific parameters... } host harpo.test.isc.org { host-specific parameters... } } <CENTER> Figure 1
</CENTER>
Notice that at the beginning of the file, there`s a place for global parameters. These might be things like the organization`s domain name, the addresses of the name servers (if they are common to the entire organization), and so on. So, for example:
option domain-name "isc.org"; option domain-name-servers ns1.isc.org, ns2.isc.org; <CENTER> Figure 2
</CENTER>
As you can see in Figure 2, you can specify host addresses in parameters using their domain names rather than their numeric IP addresses. If a given hostname resolves to more than one IP address (for example, if that host has two ethernet interfaces), then where possible, both addresses are supplied to the client.
The most obvious reason for having subnet-specific parameters as shown in Figure 1 is that each subnet, of necessity, has its own router. So for the first subnet, for example, there should be something like:
option routers 204.254.239.1;
Note that the address here is specified numerically. This is not required - if you have a different domain name for each interface on your router, it`s perfectly legitimate to use the domain name for that interface instead of the numeric address. However, in many cases there may be only one domain name for all of a router`s IP addresses, and it would not be appropriate to use that name here.
In Figure 1 there is also a group statement, which provides common parameters for a set of three hosts - zappo, beppo and harpo. As you can see, these hosts are all in the test.isc.org domain, so it might make sense for a group-specific parameter to override the domain name supplied to these hosts:
option domain-name "test.isc.org";
Also, given the domain they`re in, these are probably test machines. If we wanted to test the DHCP leasing mechanism, we might set the lease timeout somewhat shorter than the default:
max-lease-time 120; default-lease-time 120;
You may have noticed that while some parameters start with the option keyword, some do not. Parameters starting with the option keyword correspond to actual DHCP options, while parameters that do not start with the option keyword either control the behavior of the DHCP server (e.g., how long a lease dhcpd will give out), or specify client parameters that are not optional in the DHCP protocol (for example, server-name and filename).
In Figure 1, each host had host-specific parameters. These could include such things as the hostname option, the name of a file to upload (the filename parameter) and the address of the server from which to upload the file (the next-server parameter). In general, any parameter can appear anywhere that parameters are allowed, and will be applied according to the scope in which the parameter appears.
Imagine that you have a site with a lot of NCD X-Terminals. These terminals come in a variety of models, and you want to specify the boot files for each model. One way to do this would be to have host declarations for each server and group them by model:
group { filename "Xncd19r"; next-server ncd-booter; host ncd1 { hardware ethernet 0:c0:c3:49:2b:57; } host ncd4 { hardware ethernet 0:c0:c3:80:fc:32; } host ncd8 { hardware ethernet 0:c0:c3:22:46:81; } } group { filename "Xncd19c"; next-server ncd-booter; host ncd2 { hardware ethernet 0:c0:c3:88:2d:81; } host ncd3 { hardware ethernet 0:c0:c3:00:14:11; } } group { filename "XncdHMX"; next-server ncd-booter; host ncd1 { hardware ethernet 0:c0:c3:11:90:23; } host ncd4 { hardware ethernet 0:c0:c3:91:a7:8; } host ncd8 { hardware ethernet 0:c0:c3:cc:a:8f; } }
The pool declaration can be used to specify a pool of addresses that will be treated differently than another pool of addresses, even on the same network segment or subnet. For example, you may want to provide a large set of addresses that can be assigned to DHCP clients that are registered to your DHCP server, while providing a smaller set of addresses, possibly with short lease times, that are available for unknown clients. If you have a firewall, you may be able to arrange for addresses from one pool to be allowed access to the Internet, while addresses in another pool are not, thus encouraging users to register their DHCP clients. To do this, you would set up a pair of pool declarations:
subnet 10.0.0.0 netmask 255.255.255.0 { option routers 10.0.0.254; # Unknown clients get this pool. pool { option domain-name-servers bogus.example.com; max-lease-time 300; range 10.0.0.200 10.0.0.253; allow unknown-clients; } # Known clients get this pool. pool { option domain-name-servers ns1.example.com, ns2.example.com; max-lease-time 28800; range 10.0.0.5 10.0.0.199; deny unknown-clients; } }
It is also possible to set up entirely different subnets for known and unknown clients - address pools exist at the level of shared networks, so address ranges within pool declarations can be on different subnets.
As you can see in the preceding example, pools can have permit lists that control which clients are allowed access to the pool and which aren`t. Each entry in a pool`s permit list is introduced with the allow or deny keyword. If a pool has a permit list, then only those clients that match specific entries on the permit list will be eligible to be assigned addresses from the pool. If a pool has a deny list, then only those clients that do not match any entries on the deny list will be eligible. If both permit and deny lists exist for a pool, then only clients that match the permit list and do not match the deny list will be allowed access.
If the server finds the address the client is requesting, and that address is available to the client, the server will send a DHCPACK. If the address is no longer available, or the client isn`t permitted to have it, the server will send a DHCPNAK. If the server knows nothing about the address, it will remain silent, unless the address is incorrect for the network segment to which the client has been attached and the server is authoritative for that network segment, in which case the server will send a DHCPNAK even though it doesn`t know about the address.
There may be a host declaration matching the client`s identification. If that host declaration contains a fixed-address declaration that lists an IP address that is valid for the network segment to which the client is connected. In this case, the DHCP server will never do dynamic address allocation. In this case, the client is required to take the address specified in the host declaration. If the client sends a DHCPREQUEST for some other address, the server will respond with a DHCPNAK.
When the DHCP server allocates a new address for a client (remember, this only happens if the client has sent a DHCPDISCOVER), it first looks to see if the client already has a valid lease on an IP address, or if there is an old IP address the client had before that hasn`t yet been reassigned. In that case, the server will take that address and check it to see if the client is still permitted to use it. If the client is no longer permitted to use it, the lease is freed if the server thought it was still in use - the fact that the client has sent a DHCPDISCOVER proves to the server that the client is no longer using the lease.
If no existing lease is found, or if the client is forbidden to receive the existing lease, then the server will look in the list of address pools for the network segment to which the client is attached for a lease that is not in use and that the client is permitted to have. It looks through each pool declaration in sequence (all range declarations that appear outside of pool declarations are grouped into a single pool with no permit list). If the permit list for the pool allows the client to be allocated an address from that pool, the pool is examined to see if there is an address available. If so, then the client is tentatively assigned that address. Otherwise, the next pool is tested. If no addresses are found that can be assigned to the client, no response is sent to the client.
If an address is found that the client is permitted to have, and that has never been assigned to any client before, the address is immediately allocated to the client. If the address is available for allocation but has been previously assigned to a different client, the server will keep looking in hopes of finding an address that has never before been assigned to a client.
The DHCP server generates the list of available IP addresses from a hash table. This means that the addresses are not sorted in any particular order, and so it is not possible to predict the order in which the DHCP server will allocate IP addresses. Users of previous versions of the ISC DHCP server may have become accustomed to the DHCP server allocating IP addresses in ascending order, but this is no longer possible, and there is no way to configure this behavior with version 3 of the ISC DHCP server.
If a response is received to an ICMP Echo request, the DHCP server assumes that there is a configuration error - the IP address is in use by some host on the network that is not a DHCP client. It marks the address as abandoned, and will not assign it to clients.
If a DHCP client tries to get an IP address, but none are available, but there are abandoned IP addresses, then the DHCP server will attempt to reclaim an abandoned IP address. It marks one IP address as free, and then does the same ICMP Echo request check described previously. If there is no answer to the ICMP Echo request, the address is assigned to the client.
The DHCP server does not cycle through abandoned IP addresses if the first IP address it tries to reclaim is free. Rather, when the next DHCPDISCOVER comes in from the client, it will attempt a new allocation using the same method described here, and will typically try a new IP address.
The failover protocol allows two DHCP servers (and no more than two) to share a common address pool. Each server will have about half of the available IP addresses in the pool at any given time for allocation. If one server fails, the other server will continue to renew leases out of the pool, and will allocate new addresses out of the roughly half of available addresses that it had when communications with the other server were lost.
It is possible during a prolonged failure to tell the remaining server that the other server is down, in which case the remaining server will (over time) reclaim all the addresses the other server had available for allocation, and begin to reuse them. This is called putting the server into the PARTNER-DOWN state.
You can put the server into the PARTNER-DOWN state either by using the omshell (1) command or by stopping the server, editing the last peer state declaration in the lease file, and restarting the server. If you use this last method, be sure to leave the date and time of the start of the state blank:
failover peer name state { my state partner-down; peer state state at date; }
When the other server comes back online, it should automatically detect that it has been offline and request a complete update from the server that was running in the PARTNER-DOWN state, and then both servers will resume processing together.
It is possible to get into a dangerous situation: if you put one server into the PARTNER-DOWN state, and then *that* server goes down, and the other server comes back up, the other server will not know that the first server was in the PARTNER-DOWN state, and may issue addresses previously issued by the other server to different clients, resulting in IP address conflicts. Before putting a server into PARTNER-DOWN state, therefore, make sure that the other server will not restart automatically.
The failover protocol defines a primary server role and a secondary server role. There are some differences in how primaries and secondaries act, but most of the differences simply have to do with providing a way for each peer to behave in the opposite way from the other. So one server must be configured as primary, and the other must be configured as secondary, and it doesn`t matter too much which one is which.
The initial recovery process is designed to ensure that when one failover peer loses its database and then resynchronizes, any leases that the failed server gave out before it failed will be honored. When the failed server starts up, it notices that it has no saved failover state, and attempts to contact its peer.
When it has established contact, it asks the peer for a complete copy its peer`s lease database. The peer then sends its complete database, and sends a message indicating that it is done. The failed server then waits until MCLT has passed, and once MCLT has passed both servers make the transition back into normal operation. This waiting period ensures that any leases the failed server may have given out while out of contact with its partner will have expired.
While the failed server is recovering, its partner remains in the partner-down state, which means that it is serving all clients. The failed server provides no service at all to DHCP clients until it has made the transition into normal operation.
In the case where both servers detect that they have never before communicated with their partner, they both come up in this recovery state and follow the procedure we have just described. In this case, no service will be provided to DHCP clients until MCLT has expired.
pool { failover peer "foo"; deny dynamic bootp clients; pool specific parameters };
Dynamic BOOTP leases are not compatible with failover, and, as such, you need to disallow BOOTP in pools that you are using failover for.
The server currently does very little sanity checking, so if you configure it wrong, it will just fail in odd ways. I would recommend therefore that you either do failover or don`t do failover, but don`t do any mixed pools. Also, use the same master configuration file for both servers, and have a separate file that contains the peer declaration and includes the master file. This will help you to avoid configuration mismatches. As our implementation evolves, this will become less of a problem. A basic sample dhcpd.conf file for a primary server might look like this:
failover peer "foo" { primary; address anthrax.rc.vix.com; port 519; peer address trantor.rc.vix.com; peer port 520; max-response-delay 60; max-unacked-updates 10; mclt 3600; split 128; load balance max seconds 3; } include "/etc/dhcpd.master";
The statements in the peer declaration are as follows:
The primary and secondary statements
[ primary | secondary ];
This determines whether the server is primary or secondary, as described earlier under DHCP FAILOVER.
The address statement
address address;
The address statement declares the IP address or DNS name on which the server should listen for connections from its failover peer, and also the value to use for the DHCP Failover Protocol server identifier. Because this value is used as an identifier, it may not be omitted.
The peer address statement
peer address address;
The peer address statement declares the IP address or DNS name to which the server should connect to reach its failover peer for failover messages.
The port statement
port port-number;
The port statement declares the TCP port on which the server should listen for connections from its failover peer. This statement may not currently be omitted, because the failover protocol does not yet have a reserved TCP port number.
The peer port statement
peer port port-number;
The peer port statement declares the TCP port to which the server should connect to reach its failover peer for failover messages. This statement may not be omitted because the failover protocol does not yet have a reserved TCP port number. The port number declared in the peer port statement may be the same as the port number declared in the port statement.
The max-response-delay statement
max-response-delay seconds;
The max-response-delay statement tells the DHCP server how many seconds may pass without receiving a message from its failover peer before it assumes that connection has failed. This number should be small enough that a transient network failure that breaks the connection will not result in the servers being out of communication for a long time, but large enough that the server isn`t constantly making and breaking connections. This parameter must be specified.
The max-unacked-updates statement
max-unacked-updates count;
The max-unacked-updates statement tells the DHCP server how many BNDUPD messages it can send before it receives a BNDACK from the failover peer. We don`t have enough operational experience to say what a good value for this is, but 10 seems to work. This parameter must be specified.
The mclt statement
mclt seconds;
The mclt statement defines the Maximum Client Lead Time. It must be specified on the primary, and may not be specified on the secondary. This is the length of time for which a lease may be renewed by either failover peer without contacting the other. The longer you set this, the longer it will take for the running server to recover IP addresses after moving into PARTNER-DOWN state. The shorter you set it, the more load your servers will experience when they are not communicating. A value of something like 3600 is probably reasonable, but again bear in mind that we have no real operational experience with this.
The split statement
split index;
The split statement specifies the split between the primary and secondary for the purposes of load balancing. Whenever a client makes a DHCP request, the DHCP server runs a hash on the client identification. If the hash comes out to less than the split value, the primary answers. If it comes out to equal to or more than the split, the secondary answers. The only meaningful value is 128, and can only be configured on the primary.
The hba statement
hba colon-separated-hex-list;
The hba statement specifies the split between the primary and secondary as a bitmap rather than a cutoff, which theoretically allows for finer-grained control. In practice, there is probably no need for such fine-grained control, however. An example hba statement:
hba ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00;
This is equivalent to a split 128; statement. You must only have split or hba defined, never both. For most cases, the fine-grained control that hba offers isn`t necessary, and split should be used. As such, the use of hba is deprecated.
The load balance max seconds statement
load balance max seconds seconds;
This statement allows you to configure a cutoff after which load balancing is disabled. The cutoff is based on the number of seconds since the client sent its first DHCPDISCOVER or DHCPREQUEST message, and only works with clients that correctly implement the secs field - fortunately most clients do. We recommend setting this to something like 3 or 5. The effect of this is that if one of the failover peers gets into a state where it is responding to failover messages but not responding to some client requests, the other failover peer will take over its client load automatically as the clients retry.
To add clients to classes based on conditional evaluation, you can specify a matching expression in the class statement:
class "ras-clients" { match if substring (option dhcp-client-identifier, 1, 3) = "RAS"; }
Note that whether you use matching expressions or add statements (or both) to classify clients, you must always write a class declaration for any class that you use. If there will be no match statement and no in-scope statements for a class, the declaration should look like this:
class "ras-clients" { }
In addition to classes, it is possible to declare subclasses. A subclass is a class with the same name as a regular class, but with a specific submatch expression which is hashed for quick matching. This is essentially a speed hack - the main difference between five classes with match expressions and one class with five subclasses is that it will be quicker to find the subclasses. Subclasses work as follows:
class "allocation-class-1" { match pick-first-value (option dhcp-client-identifier, hardware); } class "allocation-class-2" { match pick-first-value (option dhcp-client-identifier, hardware); } subclass "allocation-class-1" 1:8:0:2b:4c:39:ad; subclass "allocation-class-2" 1:8:0:2b:a9:cc:e3; subclass "allocation-class-1" 1:0:0:c4:aa:29:44; subnet 10.0.0.0 netmask 255.255.255.0 { pool { allow members of "allocation-class-1"; range 10.0.0.11 10.0.0.50; } pool { allow members of "allocation-class-2"; range 10.0.0.51 10.0.0.100; } }
The data following the class name in the subclass declaration is a constant value to use in matching the match expression for the class. When class matching is done, the server will evaluate the match expression and then look the result up in the hash table. If it finds a match, the client is considered a member of both the class and the subclass.
Subclasses can be declared with or without scope. In the above example, the sole purpose of the subclass is to allow some clients access to one address pool, while other clients are given access to the other pool, so these subclasses are declared without scopes. If part of the purpose of the subclass were to define different parameter values for some clients, you might want to declare some subclasses with scopes.
In the above example, if you had a single client that needed some configuration parameters, while most didn`t, you might write the following subclass declaration for that client:
subclass "allocation-class-2" 1:08:00:2b:a1:11:31 { option root-path "samsara:/var/diskless/alphapc"; filename "/tftpboot/netbsd.alphapc-diskless"; }
In this example, we`ve used subclassing as a way to control address allocation on a per-client basis. However, it`s also possible to use subclassing in ways that are not specific to clients - for example, to use the value of the vendor-class-identifier option to determine what values to send in the vendor-encapsulated-options option. An example of this is shown under the VENDOR ENCAPSULATED OPTIONS head in the dhcp-options(5) manual page.
You may specify a limit to the number of clients in a class that can be assigned leases. The effect of this will be to make it difficult for a new client in a class to get an address. Once a class with such a limit has reached its limit, the only way a new client in that class can get a lease is for an existing client to relinquish its lease, either by letting it expire, or by sending a DHCPRELEASE packet. Classes with lease limits are specified as follows:
class "limited-1" { lease limit 4; }
This will produce a class in which a maximum of four members may hold a lease at one time.
It is possible to declare a spawning class. A spawning class is a class that automatically produces subclasses based on what the client sends. The reason that spawning classes were created was to make it possible to create lease-limited classes on the fly. The envisioned application is a cable-modem environment where the ISP wishes to provide clients at a particular site with more than one IP address, but does not wish to provide such clients with their own subnet, nor give them an unlimited number of IP addresses from the network segment to which they are connected.
Many cable modem head-end systems can be configured to add a Relay Agent Information option to DHCP packets when relaying them to the DHCP server. These systems typically add a circuit ID or remote ID option that uniquely identifies the customer site. To take advantage of this, you can write a class declaration as follows:
class "customer" { spawn with option agent.circuit-id; lease limit 4; }
Now whenever a request comes in from a customer site, the circuit ID option will be checked against the class`s hash table. If a subclass is found that matches the circuit ID, the client will be classified in that subclass and treated accordingly. If no subclass is found matching the circuit ID, a new one will be created and logged in the dhcpd.leases file, and the client will be classified in this new class. Once the client has been classified, it will be treated according to the rules of the class, including, in this case, being subject to the per-site limit of four leases.
The use of the subclass spawning mechanism is not restricted to relay agent options - this particular example is given only because it is a fairly straightforward one.
In some cases, it may be useful to use one expression to assign a client to a particular class, and a second expression to put it into a subclass of that class. This can be done by combining the match if and spawn with statements, or the match if and match statements. For example:
class "jr-cable-modems" { match if option dhcp-vendor-identifier = "jrcm"; spawn with option agent.circuit-id; lease limit 4; } class "dv-dsl-modems" { match if opton dhcp-vendor-identifier = "dvdsl"; spawn with option agent.circuit-id; lease limit 16; }
This allows you to have two classes that both have the same spawn with expression without getting the clients in the two classes confused with each other.
The DHCP server has the ability to dynamically update the Domain Name System. Within the configuration files, you can define how you want the Domain Name System to be updated. These updates are RFC 2136 compliant so any DNS server supporting RFC 2136 should be able to accept updates from the DHCP server.
Two DNS update schemes are currently implemented, and another is planned. The two that are currently available are the ad-hoc DNS update mode and the interim DHCP-DNS interaction draft update mode. If and when the DHCP-DNS interaction draft and the DHCID draft make it through the IETF standards process, there will be a third mode, which will be the standard DNS update method. The DHCP server must be configured to use one of the two currently-supported methods, or not to do dns updates. This can be done with the ddns-update-style configuration parameter.
The ad-hoc Dynamic DNS update scheme implemented in this version of the ISC DHCP server is a prototype design, which does not have much to do with the standard update method that is being standardized in the IETF DHC working group, but rather implements some very basic, yet useful, update capabilities. This mode does not work with the failover protocol because it does not account for the possibility of two different DHCP servers updating the same set of DNS records.
For the ad-hoc DNS update method, the client`s FQDN is derived in two parts. First, the hostname is determined. Then, the domain name is determined, and appended to the hostname.
The DHCP server determines the client`s hostname by first looking for a ddns-hostname configuration option, and using that if it is present. If no such option is present, the server looks for a valid hostname in the FQDN option sent by the client. If one is found, it is used; otherwise, if the client sent a host-name option, that is used. Otherwise, if there is a host declaration that applies to the client, the name from that declaration will be used. If none of these applies, the server will not have a hostname for the client, and will not be able to do a DNS update.
The domain name is determined based strictly on the server configuration, not on what the client sends. First, if there is a ddns-domainname configuration option, it is used. Second, if there is a domain-name option configured, that is used. Otherwise, the server will not do the DNS update.
The client`s fully-qualified domain name, derived as we have described, is used as the name on which an "A" record will be stored. The A record will contain the IP address that the client was assigned in its lease. If there is already an A record with the same name in the DNS server, no update of either the A or PTR records will occur - this prevents a client from claiming that its hostname is the name of some network server. For example, if you have a fileserver called "fs.sneedville.edu", and the client claims its hostname is "fs", no DNS update will be done for that client, and an error message will be logged.
If the A record update succeeds, a PTR record update for the assigned IP address will be done, pointing to the A record. This update is unconditional - it will be done even if another PTR record of the same name exists. Since the IP address has been assigned to the DHCP server, this should be safe.
Please note that the current implementation assumes clients only have a single network interface. A client with two network interfaces will see unpredictable behavior. This is considered a bug, and will be fixed in a later release. It may be helpful to enable the one-lease-per-client parameter so that roaming clients do not trigger this same behavior.
The DHCP protocol normally involves a four-packet exchange - first the client sends a DHCPDISCOVER message, then the server sends a DHCPOFFER, then the client sends a DHCPREQUEST, then the server sends a DHCPACK. In the current version of the server, the server will do a DNS update after it has received the DHCPREQUEST, and before it has sent the DHCPACK. It only sends the DNS update if it has not sent one for the client`s address before, in order to minimize the impact on the DHCP server.
When the client`s lease expires, the DHCP server (if it is operating at the time, or when next it operates) will remove the client`s A and PTR records from the DNS database. If the client releases its lease by sending a DHCPRELEASE message, the server will likewise remove the A and PTR records.
<CENTER> draft-ietf-dhc-ddns-resolution-??.txt
draft-ietf-dhc-fqdn-option-??.txt
draft-ietf-dnsext-dhcid-rr-??.txt
</CENTER>
Because our implementation is slightly different than the standard, we will briefly document the operation of this update style here.
The first point to understand about this style of DNS update is that unlike the ad-hoc style, the DHCP server does not necessarily always update both the A and the PTR records. The FQDN option includes a flag which, when sent by the client, indicates that the client wishes to update its own A record. In that case, the server can be configured either to honor the client`s intentions or ignore them. This is done with the statement allow client-updates; or the statement ignore client-updates;. By default, client updates are allowed.
If the server is configured to allow client updates, then if the client sends a fully-qualified domain name in the FQDN option, the server will use that name the client sent in the FQDN option to update the PTR record. For example, let us say that the client is a visitor from the "radish.org" domain, whose hostname is "jschmoe". The server is for the "example.org" domain. The DHCP client indicates in the FQDN option that its FQDN is "jschmoe.radish.org.". It also indicates that it wants to update its own A record. The DHCP server therefore does not attempt to set up an A record for the client, but does set up a PTR record for the IP address that it assigns the client, pointing at jschmoe.radish.org. Once the DHCP client has an IP address, it can update its own A record, assuming that the "radish.org" DNS server will allow it to do so.
If the server is configured not to allow client updates, or if the client doesn`t want to do its own update, the server will simply choose a name for the client, possibly using the hostname supplied by the client ("jschmoe" in the previous example). It will use its own domain name for the client, just as in the ad-hoc update scheme. It will then update both the A and PTR record, using the name that it chose for the client. If the client sends a fully-qualified domain name in the fqdn option, the server uses only the leftmost part of the domain name - in the example above, "jschmoe" instead of "jschmoe.radish.org".
The other difference between the ad-hoc scheme and the interim scheme is that with the interim scheme, a method is used that allows more than one DHCP server to update the DNS database without accidentally deleting A records that shouldn`t be deleted nor failing to add A records that should be added. The scheme works as follows:
When the DHCP server issues a client a new lease, it creates a text string that is an MD5 hash over the DHCP client`s identification (see draft-ietf-dnsext-dhcid-rr-??.txt for details). The update adds an A record with the name the server chose and a TXT record containing the hashed identifier string (hashid). If this update succeeds, the server is done.
If the update fails because the A record already exists, then the DHCP server attempts to add the A record with the prerequisite that there must be a TXT record in the same name as the new A record, and that TXT record`s contents must be equal to hashid. If this update succeeds, then the client has its A record and PTR record. If it fails, then the name the client has been assigned (or requested) is in use, and can`t be used by the client. At this point the DHCP server gives up trying to do a DNS update for the client until the client chooses a new name.
The interim DNS update scheme is called interim for two reasons. First, it does not quite follow the drafts. The current versions of the drafts call for a new DHCID RRtype, but this is not yet available. The interim DNS update scheme uses a TXT record instead. Also, the existing ddns-resolution draft calls for the DHCP server to put a DHCID RR on the PTR record, but the interim update method does not do this. It is our position that this is not useful, and we are working with the author in hopes of removing it from the next version of the draft, or better understanding why it is considered useful.
In addition to these differences, the server also does not update very aggressively. Because each DNS update involves a round trip to the DNS server, there is a cost associated with doing updates even if they do not actually modify the DNS database. So the DHCP server tracks whether or not it has updated the record in the past (this information is stored on the lease) and does not attempt to update records that it thinks it has already updated.
This can lead to cases where the DHCP server adds a record, and then the record is deleted through some other mechanism, but the server never again updates the DNS because it thinks the data is already there. In this case the data can be removed from the lease through operator intervention, and once this has been done, the DNS will be updated the next time the client renews.
When you set your DNS server up to allow updates from the DHCP server, you may be exposing it to unauthorized updates. To avoid this, you should use TSIG signatures - a method of cryptographically signing updates using a shared secret key. As long as you protect the secrecy of this key, your updates should also be secure. Note, however, that the DHCP protocol itself provides no security, and that clients can therefore provide information to the DHCP server which the DHCP server will then use in its updates, with the constraints described previously.
The DNS server must be configured to allow updates for any zone that the DHCP server will be updating. For example, let us say that clients in the sneedville.edu domain will be assigned addresses on the 10.10.17.0/24 subnet. In that case, you will need a key declaration for the TSIG key you will be using, and also two zone declarations - one for the zone containing A records that will be updates and one for the zone containing PTR records - for ISC BIND, something like this:
key DHCP_UPDATER { algorithm hmac-md5; secret pRP5FapFoJ95JEL06sv4PQ==; }; zone "example.org" { type master; file "example.org.db"; allow-update { key DHCP_UPDATER; }; }; zone "17.10.10.in-addr.arpa" { type master; file "10.10.17.db"; allow-update { key DHCP_UPDATER; }; };
You will also have to configure your DHCP server to do updates to these zones. To do so, you need to add something like this to your dhcpd.conf file:
key DHCP_UPDATER { algorithm hmac-md5; secret pRP5FapFoJ95JEL06sv4PQ==; }; zone EXAMPLE.ORG. { primary 127.0.0.1; key DHCP_UPDATER; } zone 17.127.10.in-addr.arpa. { primary 127.0.0.1; key DHCP_UPDATER; }
The primary statement specifies the IP address of the name server whose zone information is to be updated.
Note that the zone declarations have to correspond to authority records in your name server - in the above example, there must be an SOA record for "example.org." and for "17.10.10.in-addr.arpa.". For example, if there were a subdoman "foo.example.org" with no separate SOA, you could not write a zone declaration for "foo.example.org." Also keep in mind that zone names in your DHCP configuration should end in a "."; this is the preferred syntax. If you do not end your zone name in a ".", the DHCP server will figure it out. Also note that in the DHCP configuration, zone names are not encapsulated in quotes where there are in the DNS configuration.
You should choose your own secret key, of course. The ISC BIND 8 and 9 distributions come with a program for generating secret keys called dnssec-keygen. The version that comes with BIND 9 is likely to produce a substantially more random key, so we recommend you use that one even if you are not using BIND 9 as your DNS server. If you are using BIND 9`s dnssec-keygen, the above key would be created as follows:
dnssec-keygen -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER
If you are using the BIND 8 dnskeygen program, the following command will generate a key as seen above:
dnskeygen -H 128 -u -c -n DHCP_UPDATER
You may wish to enable logging of DNS updates on your DNS server. To do so, you might write a logging statement like the following:
logging { channel update_debug { file "/var/log/update-debug.log"; severity debug 3; print-category yes; print-severity yes; print-time yes; }; channel security_info { file "/var/log/named-auth.info"; severity info; print-category yes; print-severity yes; print-time yes; }; category update { update_debug; }; category security { security_info; }; };
You must create the /var/log/named-auth.info and /var/log/update-debug.log files before starting the name server. For more information on configuring ISC BIND, consult the documentation that accompanies it.
There are three kinds of events that can happen regarding a lease, and it is possible to declare statements that occur when any of these events happen. These events are the commit event, when the server has made a commitment of a certain lease to a client, the release event, when the client has released the server from its commitment, and the expiry event, when the commitment expires.
To declare a set of statements to execute when an event happens, you must use the on statement, followed by the name of the event, followed by a series of statements to execute when the event happens, enclosed in braces. Events are used to implement DNS updates, so you should not define your own event handlers if you are using the built-in DNS update mechanism.
The built-in version of the DNS update mechanism is in a text string towards the top of server/dhcpd.c. If you want to use events for things other than DNS updates, and you also want DNS updates, you will have to start out by copying this code into your dhcpd.conf file and modifying it.
The shared-network statement
shared-network name { [ parameters ] [ declarations ] }
The shared-network statement is used to inform the DHCP server that some IP subnets actually share the same physical network. Any subnets in a shared network should be declared within a shared-network statement. Parameters specified in the shared-network statement will be used when booting clients on those subnets unless parameters provided at the subnet or host level override them. If any subnet in a shared network has addresses available for dynamic allocation, those addresses are collected into a common pool for that shared network and assigned to clients as needed. There is no way to distinguish on which subnet of a shared network a client should boot.
Name should be the name of the shared network. This name is used when printing debugging messages, so it should be descriptive for the shared network. The name may have the syntax of a valid domain name (although it will never be used as such), or it may be any arbitrary name, enclosed in quotes.
The subnet statement
subnet subnet-number netmask netmask { [ parameters ] [ declarations ] }
The subnet statement is used to provide dhcpd with enough information to tell whether or not an IP address is on that subnet. It may also be used to provide subnet-specific parameters and to specify what addresses may be dynamically allocated to clients booting on that subnet. Such addresses are specified using the range declaration.
The subnet-number should be an IP address or domain name which resolves to the subnet number of the subnet being described. The netmask should be an IP address or domain name which resolves to the subnet mask of the subnet being described. The subnet number, together with the netmask, are sufficient to determine whether any given IP address is on the specified subnet.
Although a netmask must be given with every subnet declaration, it is recommended that if there is any variance in subnet masks at a site, a subnet-mask option statement be used in each subnet declaration to set the desired subnet mask, since any subnet-mask option statement will override the subnet mask declared in the subnet statement.
The range statement
range [ dynamic-bootp ] low-address [ high-address];
For any subnet on which addresses will be assigned dynamically, there must be at least one range statement. The range statement gives the lowest and highest IP addresses in a range. All IP addresses in the range should be in the subnet in which the range statement is declared. The dynamic-bootp flag may be specified if addresses in the specified range may be dynamically assigned to BOOTP clients as well as DHCP clients. When specifying a single address, high-address can be omitted.
The host statement
host hostname { [ parameters ] [ declarations ] }
The host declaration provides a scope in which to provide configuration information about a specific client, and also provides a way to assign a client a fixed address. The host declaration provides a way for the DHCP server to identify a DHCP or BOOTP client, and also a way to assign the client a static IP address.
If it is desirable to be able to boot a DHCP or BOOTP client on more than one subnet with fixed addresses, more than one address may be specified in the fixed-address declaration, or more than one host statement may be specified.
If client-specific boot parameters must change based on the network to which the client is attached, then multiple host declaration should be used.
If a client is to be booted using a fixed address if it`s possible, but should be allocated a dynamic address otherwise, then a host declaration must be specified without a fixed-address declaration. hostname should be a name identifying the host. If a hostname option is not specified for the host, hostname is used.
Host declarations are matched to actual DHCP or BOOTP clients by matching the dhcp-client-identifier option specified in the host declaration to the one supplied by the client, or, if the host declaration or the client does not provide a dhcp-client-identifier option, by matching the hardware parameter in the host declaration to the network hardware address supplied by the client. BOOTP clients do not normally provide a dhcp-client-identifier, so the hardware address must be used for all clients that may boot using the BOOTP protocol.
Please be aware that only the dhcp-client-identifier option and the hardware address can be used to match a host declaration. For example, it is not possible to match a host declaration to a host-name option. This is because the host-name option cannot be guaranteed to be unique for any given client, whereas both the hardware address and dhcp-client-identifier option are at least theoretically guaranteed to be unique to a given client.
The group statement
group { [ parameters ] [ declarations ] }
The group statement is used simply to apply one or more parameters to a group of declarations. It can be used to group hosts, shared networks, subnets, or even other groups.
The unknown-clients keyword
allow unknown-clients;
deny unknown-clients;
ignore unknown-clients;
The unknown-clients flag is used to tell dhcpd whether or not to dynamically assign addresses to unknown clients. Dynamic address assignment to unknown clients is allowed by default. An unknown client is simply a client that has no host declaration.
The use of this option is now deprecated. If you are trying to restrict access on your network to known clients, you should use deny unknown-clients; inside of your address pool, as described under the heading ALLOW AND DENY WITHIN POOL DECLARAIONS.
The bootp keyword
allow bootp;
deny bootp;
ignore bootp;
The bootp flag is used to tell dhcpd whether or not to respond to bootp queries. Bootp queries are allowed by default.
This option does not satisfy the requirement of failover peers for denying dynamic bootp clients. The deny dynamic bootp clients; option should be used instead. See the ALLOW AND DENY WITHIN POOL DECLARATIONS section of this man page for more details.
The booting keyword
allow booting;
deny booting;
ignore booting;
The booting flag is used to tell dhcpd whether or not to respond to queries from a particular client. This keyword only has meaning when it appears in a host declaration. By default, booting is allowed, but if it is disabled for a particular client, then that client will not be able to get an address from the DHCP server.
The duplicates keyword
allow duplicates;
deny duplicates;
Host declarations can match client messages based on the DHCP Client Identifer option or based on the client`s network hardware type and MAC address. If the MAC address is used, the host declaration will match any client with that MAC address - even clients with different client identifiers. This doesn`t normally happen, but is possible when one computer has more than one operating system installed on it - for example, Microsoft Windows and NetBSD or Linux.
The duplicates flag tells the DHCP server that if a request is received from a client that matches the MAC address of a host declaration, any other leases matching that MAC address should be discarded by the server, even if the UID is not the same. This is a violation of the DHCP protocol, but can prevent clients whose client identifiers change regularly from holding many leases at the same time. By default, duplicates are allowed.
The declines keyword
allow declines;
deny declines;
ignore declines;
The DHCPDECLINE message is used by DHCP clients to indicate that the lease the server has offered is not valid. When the server receives a DHCPDECLINE for a particular address, it normally abandons that address, assuming that some unauthorized system is using it. Unfortunately, a malicious or buggy client can, using DHCPDECLINE messages, completely exhaust the DHCP server`s allocation pool. The server will reclaim these leases, but while the client is running through the pool, it may cause serious thrashing in the DNS, and it will also cause the DHCP server to forget old DHCP client address allocations.
The declines flag tells the DHCP server whether or not to honor DHCPDECLINE messages. If it is set to deny or ignore in a particular scope, the DHCP server will not respond to DHCPDECLINE messages.
The client-updates keyword
allow client-updates;
deny client-updates;
The client-updates flag tells the DHCP server whether or not to honor the client`s intention to do its own update of its A record. This is only relevant when doing interim DNS updates. See the documentation under the heading THE INTERIM DNS UPDATE SCHEME for details.
The uses of the allow and deny keywords shown in the previous section work pretty much the same way whether the client is sending a DHCPDISCOVER or a DHCPREQUEST message - an address will be allocated to the client (either the old address it`s requesting, or a new address) and then that address will be tested to see if it`s okay to let the client have it. If the client requested it, and it`s not okay, the server will send a DHCPNAK message. Otherwise, the server will simply not respond to the client. If it is okay to give the address to the client, the server will send a DHCPACK message.
The primary motivation behind pool declarations is to have address allocation pools whose allocation policies are different. A client may be denied access to one pool, but allowed access to another pool on the same network segment. In order for this to work, access control has to be done during address allocation, not after address allocation is done.
When a DHCPREQUEST message is processed, address allocation simply consists of looking up the address the client is requesting and seeing if it`s still available for the client. If it is, then the DHCP server checks both the address pool permit lists and the relevant in-scope allow and deny statements to see if it`s okay to give the lease to the client. In the case of a DHCPDISCOVER message, the allocation process is done as described previously in the ADDRESS ALLOCATION section.
When declaring permit lists for address allocation pools, the following syntaxes are recognized following the allow or deny keywords:
known-clients;
If specified, this statement either allows or prevents allocation from this pool to any client that has a host declaration (i.e., is known). A client is known if it has a host declaration in any scope, not just the current scope.
unknown-clients;
If specified, this statement either allows or prevents allocation from this pool to any client that has no host declaration (i.e., is not known).
members of "class";
If specified, this statement either allows or prevents allocation from this pool to any client that is a member of the named class.
dynamic bootp clients;
If specified, this statement either allows or prevents allocation from this pool to any bootp client.
authenticated clients;
If specified, this statement either allows or prevents allocation from this pool to any client that has been authenticated using the DHCP authentication protocol. This is not yet supported.
unauthenticated clients;
If specified, this statement either allows or prevents allocation from this pool to any client that has not been authenticated using the DHCP authentication protocol. This is not yet supported.
all clients;
If specified, this statement either allows or prevents allocation from this pool to all clients. This can be used when you want to write a pool declaration for some reason, but hold it in reserve, or when you want to renumber your network quickly, and thus want the server to force all clients that have been allocated addresses from this pool to obtain new addresses immediately when they next renew.
Every line starting with a hash sign (`#`) is treated as comment and ignored.
Each line of the file can contain one of the following strings
The last (optional) field of an attribute definition can have either a vendor name, or options for that attribute. When a vendor name is given, the attribute is defined to be a vendor specific attribute. Alternately, the options may be the a comma-separated list of the following options:
has_tag
When the server receives an encoded attribute in a RADIUS packet, it looks up that attribute by number in the dictionary, and uses the name found there for printing diagnostic and log messages.
When the server receives an encoded value in a RADIUS packet, it looks up the value of that attribute by number in the dictionary, and uses the name found there for printing diagnostic and log messages.
weight:pattern:value
The first field is the weight to assign to this match. If a newsgroup matches multiple lines, the line with the highest weight is used. This should be an arbitrary number greater than zero. Unlike other INN files, the order of lines in this file is not important.
The second field is the name of the newsgroup or a wildmat(3)-style pattern to specify a set of newsgroups. Multiple patterns are not allowed.
The third field is the value that should be used if this line is picked as the best match. It can be an empty string.
Programs such as inews(1) that process a user`s posting should consult this file, typically by using the DDxxx routines, documented in libinn(3). The intent is that all newsgroups to which an article is posted be used to index into this file, and the value with the highest weight should be used as the value of the Distribution header, if none was specified.
An executable file using the ELF file format consists of an ELF header, followed by a program header table or a section header table, or both. The ELF header is always at offset zero of the file. The program header table and the section header table`s offset in the file are defined in the ELF header. The two tables describe the rest of the particularities of the file.
This header file describes the above mentioned headers as C structures and also includes structures for dynamic sections, relocation sections and symbol tables.
The following types are used for N-bit architectures (N=32,64, ElfN stands for Elf32 or Elf64, uintN_t stands for uint32_t or uint64_t):
ElfN_Addr Unsigned program address, uintN_t ElfN_Off Unsigned file offset, uintN_t ElfN_Section Unsigned section index, uint16_t ElfN_Versym Unsigned version symbol information, uint16_t Elf_Byte unsigned char ElfN_Half uint16_t ElfN_Sword int32_t ElfN_Word uint32_t ElfN_Sxword int64_t ElfN_Xword uint64_t
(Note: The *BSD terminology is a bit different. There Elf64_Half is twice as large as Elf32_Half, and Elf64Quarter is used for uint16_t. In order to avoid confusion these types are replaced by explicit ones in the below.)
All data structures that the file format defines follow the ``natural`` size and alignment guidelines for the relevant class. If necessary, data structures contain explicit padding to ensure 4-byte alignment for 4-byte objects, to force structure sizes to a multiple of 4, etc.
The ELF header is described by the type Elf32_Ehdr or Elf64_Ehdr:
#define EI_NIDENT 16 typedef struct { unsigned char e_ident[EI_NIDENT]; uint16_t e_type; uint16_t e_machine; uint32_t e_version; ElfN_Addr e_entry; ElfN_Off e_phoff; ElfN_Off e_shoff; uint32_t e_flags; uint16_t e_ehsize; uint16_t e_phentsize; uint16_t e_phnum; uint16_t e_shentsize; uint16_t e_shnum; uint16_t e_shstrndx; } ElfN_Ehdr;
The fields have the following meanings:
An executable or shared object file`s program header table is an array of structures, each describing a segment or other information the system needs to prepare the program for execution. An object file segment contains one or more sections Program headers are meaningful only for executable and shared object files. A file specifies its own program header size with the ELF header`s e_phentsize and e_phnum members. The ELF program header is described by the type Elf32_Phdr or Elf64_Phdr depending on the architecture:
typedef struct { uint32_t p_type; Elf32_Off p_offset; Elf32_Addr p_vaddr; Elf32_Addr p_paddr; uint32_t p_filesz; uint32_t p_memsz; uint32_t p_flags; uint32_t p_align; } Elf32_Phdr;
typedef struct { uint32_t p_type; uint32_t p_flags; Elf64_Off p_offset; Elf64_Addr p_vaddr; Elf64_Addr p_paddr; uint64_t p_filesz; uint64_t p_memsz; uint64_t p_align; } Elf64_Phdr;
The main difference between the 32-bit and the 64-bit program header lies in the location of the p_flags member in the total struct.
A text segment commonly has the flags PF_X and PF_R A data segment commonly has PF_X PF_W and PF_R
A file`s section header table lets one locate all the file`s sections. The section header table is an array of Elf32_Shdr or Elf64_Shdr structures. The ELF header`s e_shoff member gives the byte offset from the beginning of the file to the section header table. e_shnum holds the number of entries the section header table contains. e_shentsize holds the size in bytes of each entry.
A section header table index is a subscript into this array. Some section header table indices are reserved. An object file does not have sections for these special indices:
The section header has the following structure:
typedef struct { uint32_t sh_name; uint32_t sh_type; uint32_t sh_flags; Elf32_Addr sh_addr; Elf32_Off sh_offset; uint32_t sh_size; uint32_t sh_link; uint32_t sh_info; uint32_t sh_addralign; uint32_t sh_entsize; } Elf32_Shdr;
typedef struct { uint32_t sh_name; uint32_t sh_type; uint64_t sh_flags; Elf64_Addr sh_addr; Elf64_Off sh_offset; uint64_t sh_size; uint32_t sh_link; uint32_t sh_info; uint64_t sh_addralign; uint64_t sh_entsize; } Elf64_Shdr;
Various sections hold program and control information:
String table sections hold null-terminated character sequences, commonly called strings. The object file uses these strings to represent symbol and section names. One references a string as an index into the string table section. The first byte, which is index zero, is defined to hold a null character. Similarly, a string table`s last byte is defined to hold a null character, ensuring null termination for all strings.
An object file`s symbol table holds information needed to locate and relocate a program`s symbolic definitions and references. A symbol table index is a subscript into this array.
typedef struct { uint32_t st_name; Elf32_Addr st_value; uint32_t st_size; unsigned char st_info; unsigned char st_other; uint16_t st_shndx; } Elf32_Sym;
typedef struct { uint32_t st_name; unsigned char st_info; unsigned char st_other; uint16_t st_shndx; Elf64_Addr st_value; uint64_t st_size; } Elf64_Sym;
There are macros for packing and unpacking the binding and type fields:
Relocation is the process of connecting symbolic references with symbolic definitions. Relocatable files must have information that describes how to modify their section contents, thus allowing executable and shared object files to hold the right information for a process` program image. Relocation entries are these data.
Relocation structures that do not need an addend:
typedef struct { Elf32_Addr r_offset; uint32_t r_info; } Elf32_Rel;
typedef struct { Elf64_Addr r_offset; uint64_t r_info; } Elf64_Rel;
Relocation structures that need an addend:
typedef struct { Elf32_Addr r_offset; uint32_t r_info; int32_t r_addend; } Elf32_Rela;
typedef struct { Elf64_Addr r_offset; uint64_t r_info; int64_t r_addend; } Elf64_Rela;
Key bindings for elinks should be placed in a file called ~/.elinks/elinks.conf. Note that any information regarding their format/structure may not be up-to-date. If you will discover that, please feed us with a patch.
Key binding statements are of the form:
bind "keymap" "keystroke" = "action"
where:
All words/strings may all be quoted "like so". Backslashes are escape characters, even if not between quotes. Lines beginning with a hash character (#) are comments.
Keys can be unbound just by binding them to "none" action. It may be of use if you accidentally type a key often.
Valid keys are: alphanumeric characters, punctuation, Enter, Backspace, Tab, Escape, Left, Right, Up, Down, Insert, Delete, Home, End, PageUp, PageDown, F1 to F12.
Some keys will need to be quoted or escaped. For example, space can be written as " " (quote space quote), and the quote itself as " (backslash quote). Backslash can be written as \ (double backslash).
The main keymap is used for general browsing.
The edit keymap is used for editing text fields.
The menu keymap is used for navigating menus.
You may prefix each of these keys with a number, telling its repeat count (how many times to do it). You can also re-bind keys, see elinkskeys(5) for documentation and a more complete list of keys bound by default.
The following keys can be used while editing a line/jumping to a URL:
The default bindings are shown below. Any bindings in elinks.conf will override these. This list is given as an example, and may not be up to date.
bind "main" "v" = "view-image" bind "main" "l" = "jump-to-link" bind "main" "L" = "link-menu" bind "main" "F10" = "file-menu" bind "main" "F9" = "menu" bind "main" "Escape" = "menu" bind "main" "Tab" = "next-frame" bind "main" "*" = "toggle-display-images" bind "main" "." = "toggle-numbered-links" bind "main" "\" = "toggle-html-plain" bind "main" "<" = "tab-prev" bind "main" ">" = "tab-next" bind "main" "c" = "tab-close" bind "main" "|" = "header-info" bind "main" "=" = "document-info" bind "main" "Q" = "really-quit" bind "main" "q" = "quit" bind "main" "Ctrl-K" = "cookies-load" bind "main" "k" = "keybinding-manager" bind "main" "o" = "options-manager" bind "main" "h" = "history-manager" bind "main" "S" = "bookmark-manager" bind "main" "s" = "bookmark-manager" bind "main" "A" = "add-bookmark-link" bind "main" "a" = "add-bookmark" bind "main" "M" = "goto-url-home" bind "main" "m" = "goto-url-home" bind "main" "H" = "goto-url-home" bind "main" "G" = "goto-url-current" bind "main" "g" = "goto-url" bind "main" "E" = "goto-url-current-link" bind "main" "Ctrl-R" = "reload" bind "main" "F" = "zoom-frame" bind "main" "f" = "zoom-frame" bind "main" "N" = "find-next-back" bind "main" "n" = "find-next" bind "main" "?" = "search-back" bind "main" "/" = "search" bind "main" "z" = "abort-connection" bind "main" "R" = "resume-download" bind "main" "r" = "resume-download" bind "main" "D" = "download" bind "main" "d" = "download" bind "main" "U" = "unback" bind "main" "u" = "unback" bind "main" "Left" = "back" bind "main" "x" = "enter-reload" bind "main" "Ctrl-Enter" = "enter-reload" bind "main" "Ctrl-Right" = "enter-reload" bind "main" "Enter" = "enter" bind "main" "Right" = "enter" bind "main" "Ctrl-E" = "end" bind "main" "End" = "end" bind "main" "Ctrl-A" = "home" bind "main" "Home" = "home" bind "main" "}" = "scroll-right" bind "main" "{" = "scroll-left" bind "main" "]" = "scroll-right" bind "main" "[" = "scroll-left" bind "main" "Ctrl-N" = "scroll-down" bind "main" "Delete" = "scroll-down" bind "main" "Ctrl-P" = "scroll-up" bind "main" "Insert" = "scroll-up" bind "main" "Ctrl-C" = "copy-clipboard" bind "main" "Ctrl-Insert" = "copy-clipboard" bind "main" "Up" = "up" bind "main" "Down" = "down" bind "main" "Ctrl-B" = "page-up" bind "main" "B" = "page-up" bind "main" "b" = "page-up" bind "main" "PageUp" = "page-up" bind "main" "Ctrl-F" = "page-down" bind "main" " " = "page-down" bind "main" "PageDown" = "page-down" bind "edit" "Ctrl-R" = "auto-complete-unambiguous" bind "edit" "Ctrl-W" = "auto-complete" bind "edit" "Ctrl-K" = "kill-to-eol" bind "edit" "Ctrl-U" = "kill-to-bol" bind "edit" "Ctrl-D" = "delete" bind "edit" "Delete" = "delete" bind "edit" "Ctrl-H" = "backspace" bind "edit" "Backspace" = "backspace" bind "edit" "Enter" = "enter" bind "edit" "Ctrl-V" = "paste-clipboard" bind "edit" "Ctrl-X" = "cut-clipboard" bind "edit" "Ctrl-C" = "copy-clipboard" bind "edit" "Ctrl-Insert" = "copy-clipboard" bind "edit" "Ctrl-T" = "edit" bind "edit" "F4" = "edit" bind "edit" "Ctrl-E" = "end" bind "edit" "End" = "end" bind "edit" "Down" = "down" bind "edit" "Up" = "up" bind "edit" "Ctrl-A" = "home" bind "edit" "Home" = "home" bind "edit" "Right" = "right" bind "edit" "Left" = "left" bind "menu" "Ctrl-B" = "page-up" bind "menu" "PageUp" = "page-up" bind "menu" "Ctrl-F" = "page-down" bind "menu" "PageDown" = "page-down" bind "menu" "Enter" = "enter" bind "menu" "Ctrl-E" = "end" bind "menu" "End" = "end" bind "menu" "Down" = "down" bind "menu" "Up" = "up" bind "menu" "Ctrl-A" = "home" bind "menu" "Home" = "home" bind "menu" "Right" = "right" bind "menu" "Left" = "left" # ELinks with Lua support bind "main" "," = "lua-console"
This manual page was finally written by Peter Wang (one and a half years after writing the binding code), using excerpts by David Mediavilla. You can thank Petr Baudis for the subtle requests for documentation. Updated by Zas. Moved to docbook format and cleaned up by Jonas.
elinks(1), elinks.conf(5)
The two items are separated by any number of SPACE and/or TAB char acters. A # at the beginning of a line starts a comment which extends to the end of the line. The Ethernet-address is written as x:x:x:x:x:x, where x is a hexadecimal number between 0 and ff which represents one byte of the address, which is in network byte order (big-endian). The IP-number may be a hostname which can be resolved by DNS or a dot separated number.
Blank lines and lines beginning with a number sign (``#``) are ignored. All other lines should be in one of two formats.
The first format specifies how long to keep history entries for articles that aren`t present in the news spool. These are articles which have either already expired out of spool or which the server rejected (and ``remembertrash`` was set to true in inn.conf(5)). There should only be one line in this format, which looks like:
The reason to retain a record of an old articles is to handle the case where a peer offers old articles that were previously accepted and then expired. Without a setting like this, the server would accept the article again and readers would see duplicate articles. Articles older than a certain number of days won`t be accepted by the server at all (see the ``-c`` flag of innd(8)), and this setting should probably match that time period (14 days by default) to ensure the server never accepts duplicates.
This setting does not affect article expirations.
Most of the lines in this file will be in the second format, either four or five colon-separated fields as follows:
classnum:keep:default:purge
pattern:modflag:keep:default:purge
Where classnum field used for class based expiry is the number that you specified in storage.conf(5).
The pattern field used for group based expiry is a list of wildmat(3)-style patterns, separated by commas. This field specifies the newsgroups to which the line is applied. Note that the file is interpreted in order and the last line that matches will be used, so general patterns (like a single asterisk to set the defaults) should appear at the beginning of the file, before more specific settings.
The modflag field used for group based expiry can be used to further limit newsgroups to which the line applies, and should be chosen from the following set:
M Only moderated groups U Only unmoderated groups A All groups X Removes the article from all groups that it appears in
The rest of three fields are used to determine how long an article should be kept. Each field should be either a number of days (fractions like ``8.5`` are allowed) or the word ``never.`` The most common use is to specify the default value for how long an article should be kept. The first and third fields --- keep and purge --- specify the boundaries within which an Expires header will be honored. They are ignored if an article has no Expires header. (In other words, if an article does not have an Expires header, only default field is used and the Date header is be honored to expire. But if an article has an Expires header, default is not used, and articles are expired no faster than the time set with keep and kept no longer than the time specified with purge regardless of Expires headers). One should think of the fields as ``lower-bound default upper-bound.`` Since most articles do not have an Expires header, the second field tends to be the most important and most commonly applied one.
The keep field specifies how many days an article should be kept before it will be removed. No article in the matching newsgroups or class will be removed if it has been received for less than keep days, regardless of Expires header. If this field is the word ``never,`` no article in the matching newsgroups or class will ever be expired.
The default field specifies how long to keep an article if no Expires header is present. If this field is the word ``never`` then articles without explicit expiration dates will never be expired.
The purge field specifies the upper bound on how long an article can be kept. No article will be kept longer then the number of days specified by this field. All articles will be removed after then have been kept for purge days. If purge is the word ``never`` then the article will never be deleted.
If the line for classnum is not defined, keep, default and purge are assumed to be all ``0``. (See below for default definition.)
It is often useful to honor the Expires header in articles, especially those in moderated groups. To do this, set keep to zero, default to whatever value you wish, and purge to never (or alternately set purge to some large number, like 365 days for a maximum article life of a year). To ignore any Expires header, set all three fields to the same value.
For group based expiry, there must be exactly one line with a pattern of ``*`` and a modflags of ``A`` --- this matches all groups and is used to set the expiration default. And for class base expiry, there can be exactly one line with a class of ``255`` --- this matches all class and can be used to set the expiration default. In either case, it should be the first expiration line.
## How long to keep expired history /remember/:5 ## class 0 stay for two weeks 0:14:14:14
For group based expiry;## How long to keep expired history /remember/:5 ## Most things stay for two weeks *:A:14:14:14 ## Believe expiration dates in moderated groups, ## up to six weeks *:M:1:30:42 ## Keep local stuff for a long time foo.*:A:30:30:30
The structure of the file is
struct faillog {
short fail_cnt;
short fail_max;
char fail_line[12];
time_t fail_time;
};
Each line consists of a leading keyword and associated data (rest of the line). Some are required, some others are optional. The currently implemented keywords are:
If the fax spool directory is world- or group-writeable, there are a number of denial of service or file overwrite / file access attacks possible that it`s very hard to guard against. So don`t do this!
If the fax spool directory has the proper permissions, there are currently no known attacks against faxrunq/faxrunqd, even if they run as "root", but it`s always more safe to run as untrusted user.
While a given JOB file is processed by faxrunq(1), it`s locked against sending it multiple times by temporarily renaming it to JOB.locked, thus it may happen that a faxq(1) command doesn`t show this job. ( faxrunqd(8) is a bit smarter and does the locking by creating a hard link).
When a job is successfully sent, it`s not deleted but the JOB file is renamed to JOB.done. Because of this, you can still see old jobs with "faxq -o". You should regularly clean up the outgoing fax directory, removing old faxes. If you don`t want this behaviour, edit the faxrunq(1) config file and enable the option delete-sent-jobs yes
When a job cannot be sent after several tries (excluding normal difficulties like the called number being busy or the modem being in use), the JOB file is renamed to JOB.suspended. To re-queue this job, call faxq -r -- this renames the JOB file back.
The fmtutil.cnf file contains the configuration information for fmtutil(8). Each line contains the name of the format (e.g., ``tex``, ``latex``, ``omega``), the name of the engine that uses that format (e.g., ``tex``, ``etex``, ``omega``), the pattern file (e.g., language.dat, language.def), and any arguments (name of an .ini file).
Fields are separated by whitespace. A ``-`` can be used to indicate an empty field (only used in practice for the pattern-file field for the tex and amstex formats, which cannot be customized in this way.). Line can be commented out with ``#``.
The tex(1) and amstex(1) formats load hyphen.tex. No customization is available for these formats.
You can, however, build customized formats on top of plain tex(1) or amstex(1) by using bplain.tex instead of plain.tex (see, for example, the bplain.ini file for the bplain format).
etex(1) loads language.def, not language.dat.
Symbolic links to the correct engines (e.g., bplain -> tex) are generated by the texlinks(8) script. Remember to run texlinks(8) if you run fmtutil(8) yourself, rather than using the FORMATS option in texconfig(8).
amstex(1), etex(1), fmtutil(8), tex(1), texconfig(8), texlinks(8).
Web page: <http://tug.cs.umb.edu/tetex/>
None known, but report any bugs found to <tetex@dbs.uni-hannover.de> (mailing list).
fmtutil.cnf was written by Thomas Esser <te@dbs.uni-hannover.de>, and is Copyright 1998, 1999 but released into the public domain.
This manual page was written by C.M. Connelly <c@eskimo.com>, for the Debian GNU/Linux system. It may be used by other distributions without contacting the author. Any mistakes or omissions in the manual page are my fault; inquiries about or corrections to this manual page should be directed to me (and not to the primary author).
/etc/fonts/fonts.conf /etc/fonts/fonts.dtd ~/.fonts.conf
Fontconfig is a library designed to provide system-wide font configuration, customization and application access.
Fontconfig contains two essential modules, the configuration module which builds an internal configuration from XML files and the matching module which accepts font patterns and returns the nearest matching font.
The configuration module consists of the FcConfig datatype, libexpat and FcConfigParse which walks over an XML tree and ammends a configuration with data found within. From an external perspective, configuration of the library consists of generating a valid XML tree and feeding that to FcConfigParse. The only other mechanism provided to applications for changing the running configuration is to add fonts and directories to the list of application-provided font files.
The intent is to make font configurations relatively static, and shared by as many applications as possible. It is hoped that this will lead to more stable font selection when passing names from one application to another. XML was chosen as a configuration file format because it provides a format which is easy for external agents to edit while retaining the correct structure and syntax.
Font configuration is separate from font matching; applications needing to do their own matching can access the available fonts from the library and perform private matching. The intent is to permit applications to pick and choose appropriate functionality from the library instead of forcing them to choose between this library and a private configuration mechanism. The hope is that this will ensure that configuration of fonts for all applications can be centralized in one place. Centralizing font configuration will simplify and regularize font installation and customization.
While font patterns may contain essentially any properties, there are some well known properties with associated types. Fontconfig uses some of these properties for font matching and font completion. Others are provided as a convenience for the applications rendering mechanism.
Property Type Description -------------------------------------------------------------- family String Font family name style String Font style. Overrides weight and slant slant Int Italic, oblique or roman weight Int Light, medium, demibold, bold or black size Double Point size aspect Double Stretches glyphs horizontally before hinting pixelsize Double Pixel size spacing Int Proportional, monospace or charcell foundry String Font foundry name antialias Bool Whether glyphs can be antialiased hinting Bool Whether the rasterizer should use hinting verticallayout Bool Use vertical layout autohint Bool Use autohinter instead of normal hinter globaladvance Bool Use font global advance data file String The filename holding the font index Int The index of the font within the file ftface FT_Face Use the specified FreeType face object rasterizer String Which rasterizer is in use outline Bool Whether the glyphs are outlines scalable Bool Whether glyphs can be scaled scale Double Scale factor for point->pixel conversions dpi Double Target dots per inch rgba Int unknown, rgb, bgr, vrgb, vbgr, none - subpixel geometry minspace Bool Eliminate leading from line spacing charset CharSet Unicode chars encoded by the font lang String List of RFC-3066-style languages this font supports
Fontconfig performs matching by measuring the distance from a provided pattern to all of the available fonts in the system. The closest matching font is selected. This ensures that a font will always be returned, but doesn`t ensure that it is anything like the requested pattern.
Font matching starts with an application constructed pattern. The desired attributes of the resulting font are collected together in a pattern. Each property of the pattern can contain one or more values; these are listed in priority order; matches earlier in the list are considered "closer" than matches later in the list.
The initial pattern is modified by applying the list of editing instructions specific to patterns found in the configuration; each consists of a match predicate and a set of editing operations. They are executed in the order they appeared in the configuration. Each match causes the associated sequence of editing operations to be applied.
After the pattern has been edited, a sequence of default substitutions are performed to canonicalize the set of available properties; this avoids the need for the lower layers to constantly provide default values for various font properties during rendering.
The canonical font pattern is finally matched against all available fonts. The distance from the pattern to the font is measured for each of several properties: foundry, charset, family, lang, spacing, pixelsize, style, slant, weight, antialias, rasterizer and outline. This list is in priority order -- results of comparing earlier elements of this list weigh more heavily than later elements.
There is one special case to this rule; family names are split into two bindings; strong and weak. Strong family names are given greater precedence in the match than lang elements while weak family names are given lower precedence than lang elements. This permits the document language to drive font selection when any document specified font is unavailable.
The pattern representing that font is augmented to include any properties found in the pattern but not found in the font itself; this permits the application to pass rendering instructions or any other data through the matching system. Finally, the list of editing instructions specific to fonts found in the configuration are applied to the pattern. This modified pattern is returned to the application.
The return value contains sufficient information to locate and rasterize the font, including the file name, pixel size and other rendering data. As none of the information involved pertains to the FreeType library, applications are free to use any rasterization engine or even to take the identified font file and access it directly.
The match/edit sequences in the configuration are performed in two passes because there are essentially two different operations necessary -- the first is to modify how fonts are selected; aliasing families and adding suitable defaults. The second is to modify how the selected fonts are rasterized. Those must apply to the selected font, not the original pattern as false matches will often occur.
Fontconfig provides a textual representation for patterns that the library can both accept and generate. The representation is in three parts, first a list of family names, second a list of point sizes and finally a list of additional properties:
<families>-<point sizes>:<name1>=<values1>:<name2>=<values2>...
Values in a list are separated with commas. The name needn`t include either families or point sizes; they can be elided. In addition, there are symbolic constants that simultaneously indicate both a name and a value. Here are some examples:
Name Meaning ---------------------------------------------------------- Times-12 12 point Times Roman Times-12:bold 12 point Times Bold Courier:italic Courier Italic in the default size Monospace:matrix=1 .1 0 1 The users preferred monospace font with artificial obliquing
Each font in the database contains a list of languages it supports. This is computed by comparing the Unicode coverage of the font with the orthography of each language. Languages are tagged using an RFC-3066 compatible naming and occur in two parts -- the ISO639 language tag followed a hyphen and then by the ISO 3166 country code. The hyphen and country code may be elided.
Fontconfig has orthographies for several languages built into the library. No provision has been made for adding new ones aside from rebuilding the library. It currently supports 122 of the 139 languages named in ISO 639-1, 141 of the languages with two-letter codes from ISO 639-2 and another 30 languages with only three-letter codes.
Configuration files for fontconfig are stored in XML format; this format makes external configuration tools easier to write and ensures that they will generate syntactically correct configuration files. As XML files are plain text, they can also be manipulated by the expert user using a text editor.
The fontconfig document type definition resides in the external entity "fonts.dtd"; this is normally stored in the default font configuration directory (/etc/fonts). Each configuration file should contain the following structure:
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> ... </fontconfig>
This is the top level element for a font configuration and can contain dir, cache, include, match and alias elements in any order.
This element contains a directory name which will be scanned for font files to include in the set of available fonts.
This element contains a file name for the per-user cache of font information. If it starts with `~`, it refers to a file in the users home directory. This file is used to hold information about fonts that isn`t present in the per-directory cache files. It is automatically maintained by the fontconfig library. The default for this file is ``~/.fonts.cache-version``, where version is the font configuration file version number (currently 1).
This element contains the name of an additional configuration file. When the XML datatype is traversed by FcConfigParse, the contents of the file will also be incorporated into the configuration by passing the filename to FcConfigLoadAndParse. If `ignore_missing` is set to "yes" instead of the default "no", a missing file will elicit no warning message from the library.
This element provides a place to consolodate additional configuration information. config can contain blank and rescan elements in any order.
Fonts often include "broken" glyphs which appear in the encoding but are drawn as blanks on the screen. Within the blank element, place each Unicode characters which is supposed to be blank in an int element. Characters outside of this set which are drawn as blank will be elided from the set of characters supported by the font.
The rescan element holds an int element which indicates the default interval between automatic checks for font configuration changes. Fontconfig will validate all of the configuration files and directories and automatically rebuild the internal datastructures when this interval passes.
This element holds first a (possibly empty) list of test elements and then a (possibly empty) list of edit elements. Patterns which match all of the tests are subjected to all the edits. If `target` is set to "font" instead of the default "pattern", then this element applies to the font name resulting from a match rather than a font pattern to be matched.
This element contains a single value which is compared with the pattern property "property" (substitute any of the property names seen above). `compare` can be one of "eq", "not_eq", "less", "less_eq", "more", or "more_eq". `qual` may either be the default, "any", in which case the match succeeds if any value associated with the property matches the test value, or "all", in which case all of the values associated with the property must match the test value.
This element contains a list of expression elements (any of the value or operator elements). The expression elements are evaluated at run-time and modify the property "property". The modification depends on whether "property" was matched by one of the associated test elements, if so, the modification may affect the first matched value. Any values inserted into the property are given the indicated binding. `mode` is one of:
Mode With Match Without Match --------------------------------------------------------------------- "assign" Replace matching value Replace all values "assign_replace" Replace all values Replace all values "prepend" Insert before matching Insert at head of list "prepend_first" Insert at head of list Insert at head of list "append" Append after matching Append at end of list "append_last" Append at end of list Append at end of list
These elements hold a single value of the indicated type. bool elements hold either true or false. An important limitation exists in the parsing of floating point numbers -- fontconfig requires that the mantissa start with a digit, not a decimal point, so insert a leading zero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5 instead of -.5).
This element holds the four double elements of an affine transformation.
Holds a property name. Evaluates to the first value from the property of the font, not the pattern.
Holds the name of a constant; these are always integers and serve as symbolic names for common font values:
Constant Property Value ------------------------------------- light weight 0 medium weight 100 demibold weight 180 bold weight 200 black weight 210 roman slant 0 italic slant 100 oblique slant 110 proportional spacing 0 mono spacing 100 charcell spacing 110 unknown rgba 0 rgb rgba 1 bgr rgba 2 vrgb rgba 3 vbgr rgba 4 none rgba 5
These elements perform the specified operation on a list of expression elements. or and and are boolean, not bitwise.
These elements compare two values, producing a boolean result.
Inverts the boolean sense of its one expression element
This element takes three expression elements; if the value of the first is true, it produces the value of the second, otherwise it produces the value of the third.
Alias elements provide a shorthand notation for the set of common match operations needed to substitute one font family for another. They contain a family element followed by optional prefer, accept and default elements. Fonts matching the family element are edited to prepend the list of prefered families before the matching family, append the acceptable familys after the matching family and append the default families to the end of the family list.
Holds a single font family name
These hold a list of family elements to be used by the alias element. /article
This is an example of a system-wide configuration file
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <!-- /etc/fonts/fonts.conf file to configure system font access --> <fontconfig> <!-- Find fonts in these directories --> <dir>/usr/X11R6/lib/X11/fonts/truetype</dir> <dir>/usr/X11R6/lib/X11/fonts/Type1</dir> <!-- Accept deprecated `mono` alias, replacing it with `monospace` --> <match target="pattern"> <test qual="any" name="family"><string>mono</string></test> <edit name="family" mode="assign"><string>monospace</string></edit> </match> <!-- Names not including any well known alias are given `sans` --> <match target="pattern"> <test qual="all" name="family" mode="not_eq">sans</test> <test qual="all" name="family" mode="not_eq">serif</test> <test qual="all" name="family" mode="not_eq">monospace</test> <edit name="family" mode="append_last"><string>sans</string></edit> </match> <!-- Load per-user customization file, but don`t complain if it doesn`t exist --> <include ignore_missing="yes">~/.fonts.conf</include> <!-- Alias well known font names to available TrueType fonts. These substitute TrueType faces for similar Type1 faces to improve screen appearance. --> <alias> <family>Times</family> <prefer><family>Times New Roman</family></prefer> <default><family>serif</family></default> </alias> <alias> <family>Helvetica</family> <prefer><family>Verdana</family></prefer> <default><family>sans</family></default> </alias> <alias> <family>Courier</family> <prefer><family>Courier New</family></prefer> <default><family>monospace</family></default> </alias> <!-- Provide required aliases for standard names Do these after the users configuration file so that any aliases there are used preferentially --> <alias> <family>serif</family> <prefer><family>Times New Roman</family></prefer> </alias> <alias> <family>sans</family> <prefer><family>Verdana</family></prefer> </alias> <alias> <family>monospace</family> <prefer><family>Andale Mono</family></prefer> </alias> </fontconfig>
This is an example of a per-user configuration file that lives in ~/.fonts.conf
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <!-- ~/.fonts.conf for per-user font configuration --> <fontconfig> <!-- Private font directory --> <dir>~/misc/fonts</dir> <!-- use rgb sub-pixel ordering to improve glyph appearance on LCD screens. Changes affecting rendering, but not matching should always use target="font". --> <match target="font"> <edit name="rgba" mode="assign"><const>rgb</const></edit> </match> </fontconfig>
fonts.conf contains configuration information for the fontconfig library consisting of directories to look at for font information as well as instructions on editing program specified font patterns before attempting to match the available fonts. It is in xml format.
fonts.dtd is a DTD that describes the format of the configuration files.
~/.fonts.conf is the conventional location for per-user font configuration, although the actual location is specified in the global fonts.conf file.
~/.fonts.cache-* is the conventional repository of font information that isn`t found in the per-directory caches. This file is automatically maintained by fontconfig.
Fontconfig version 2.2.3
The first field, (fs_spec), describes the block special device or remote filesystem to be mounted.
For ordinary mounts it will hold (a link to) a block special device node (as created by mknod(8)) for the device to be mounted, like `/dev/cdrom` or `/dev/sdb7`. For NFS mounts one will have <host>:<dir>, e.g., `knuth.aeb.nl:/`. For procfs, use `proc`.
Instead of giving the device explicitly, one may indicate the (ext2 or xfs) filesystem that is to be mounted by its UUID or volume label (cf. e2label(8) or xfs_admin(8)), writing LABEL=<label> or UUID=<uuid>, e.g., `LABEL=Boot` or `UUID=3e6be9de-8139-11d1-9106-a43f08d823a6`. This will make the system more robust: adding or removing a SCSI disk changes the disk device name but not the filesystem volume label.
The second field, (fs_file), describes the mount point for the filesystem. For swap partitions, this field should be specified as `none`. If the name of the mount point contains spaces these can be escaped as ` 40`.
The third field, (fs_vfstype), describes the type of the filesystem. Linux supports lots of filesystem types, such as adfs, affs, autofs, coda, coherent, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xenix, xfs, and possibly others. For more details, see mount(8). For the filesystems currently supported by the running kernel, see /proc/filesystems. An entry swap denotes a file or partition to be used for swapping, cf. swapon(8). An entry ignore causes the line to be ignored. This is useful to show disk partitions which are currently unused.
The fourth field, (fs_mntops), describes the mount options associated with the filesystem.
It is formatted as a comma separated list of options. It contains at least the type of mount plus any additional options appropriate to the filesystem type. For documentation on the available options for non-nfs file systems, see mount(8). For documentation on all nfs-specific options have a look at nfs(5). Common for all types of file system are the options ``noauto`` (do not mount when "mount -a" is given, e.g., at boot time), ``user`` (allow a user to mount), ``owner`` (allow device owner to mount), and ``pamconsole`` (allow a user at the console to mount), and ``_netdev`` (device requires network to be available). The ``owner``, ``pamconsole`` and ``_netdev`` options are Linux-specific. For more details, see mount(8).
The fifth field, (fs_freq), is used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.
The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.
The proper way to read records from fstab is to use the routines getmntent(3).
This implementation of getconfig is written in perl. It processes rules from meta-configuration files. All meta-configuration files have a .cfg suffix.
Lines starting with a pound-sign (#) are comments, and are ignored. Blank lines that consist only of white space are also treated as comments and ignored.
The first non-comment line must be a signature string followed by the file format version number. The signature string is
"Xorg getconfig rules file. Version: "
The currently defined version is "1.0". Files that do not have the correct signature string are ignored.
The remaining non-comment lines define rules. The start of a new rule is indicated by a line with no leading white space. Subsequent lines making up a rule must be indented with white space. Logical lines within a rule may be split over multiple physical lines by using the usual continuation convention (`` at the end of the line). The first logical line of each rule is a perl expression. It may be any valid perl expression whose evaluated (with `eval`) result may be used as the argument to a perl `if` statement. The second logical line should be the name of the Xorg video driver to use when the rule is true, and subsequent logical lines of each rule, if present, are additional configuration output for the video device`s xorg.conf Device section. The driver name and additional lines of configuration information are written to standard output when the rule is chosen as the successful rule.
Pseudo rules consisting of perl expressions may be present in the file for the purpose of defining custom perl variables or setting the weight to use for the following rules. Pseudo rules are rules that consist of a single logical line only, and the are never candidates themselves for the successful rule.
Several perl variables are pre-defined, and may be used within rules. They include:
$vendor PCI vendor ID $device PCI device ID $revision PCI revision ID $subsys PCI subsystem ID $subsysVendor PCI subsystem vendor ID $class PCI class $XorgVersion Xorg version, as a `v` string $XorgVersionNumeric Xorg numeric version $XorgVersionMajor Xorg major version $XorgVersionMinor Xorg minor version $XorgVersionPatch Xorg patch version $XorgVersionSnap Xorg snap version $weight current rule weight
The $weight variable deterines the weight of the rules as they are processed. The weight for subsequent rules may be set with a pseudo rule that sets or changes the value of $weight. The default weight, and the weight used for built-in rules is 500. The meta-configuration files are processed in an unpredictable order. The weighting of the rules is used to determine their relative priority
After processing all of the rules, both built-in and those read from the meta-configration files, the getconfig program chooses as the successful rule the last and highest weighted rule that evaluates to true.
/etc/X11 /usr/X11R6/etc/X11 <modulepath> /usr/X11R6/lib/X11/getconfig
where <modulepath> is the Xorg server`s module search path.
Comments are introduced by a hash sign (#), and continue until the end of the line. Blank lines are ignored.
The gimprc file associates values with properties. These properties may be set by lisp-like assignments of the form:
Either spaces or tabs may be used to separate the name from the value.
The values have an associated type, described below:
%% literal percent sign
%f bare filename, or "Untitled"
%F full path to file, or "Untitled"
%p PDB image id
%i view instance number
%t image type (RGB, indexed, greyscale)
%z zoom factor as a percentage
%s source scale factor
%d destination scale factor
%Dx expands to x if the image is dirty, the empty string otherwise. The x can be any character, eg %D*.
The default format string is "%f-%p.%i (%t)".
The only variable initially defined is gimp_dir , which is set to either the interned value .gimp-1.2 or the environment variable GIMP_DIRECTORY. If the path in GIMP_DIRECTORY is relative, it is considered relative to your home directory. The same variable expansion syntax can be used to refer to environment variables. New variables may be defined so long as their name does not shadow one of the property names given in the previous section. Variables are set using the following syntax:
Note that the right hand side of this assignment is itself path expanded before setting the value of the variable.
Typically, the system-wide gimprc file will set a few convenience variables:
The GNOME system uses MIME types to classify content. Each MIME type on the GNOME system has a number of attributes attached to it. Some of these attributes have a special meaning to the GNOME system.
The routines that classify a file by its name, use the contents of all of the files with the extension .mime from the ${prefix}/share/mime-info directory and the ~/.gnome/mime-info to build the database for filename matching. The latter is supported to enable users to provide their mime types to extend the system defaults.
Application that wish to install their own MIME types only need to install a file in this directory.
The file ${prefix}/share/mime-info/gnome.mime is special, as it contains the defaults for gnome, and is read first. In addition, the file ~/.gnome/mime-info/user.mime is read last. This will guarantee that there is a way to set system defaults, and there is a way for the user to override them. There is currently no way to tell anything about the order of the other files in those directories, nor is there anyway to override system defaults yet.
The format is the following:
mime-type-name ext[,priority]: ext1 ext2 ext3 ext[,priority]: ext4 regex[,priority]: regex1 regex[,priority]: regex2
where "mime-type-name" is a valid MIME type. For example "text/plain".
For example, for a vCalendar application, this file would be installed:
------ calendar.mime ------- application/v-calendar: ext: vcf -----------------------------
The file ${prefix}/share/mime-info/gnome.keys is special, as it contains the defaults for gnome, and is read first. In addition, the file ~/.gnome/mime-info/user.keys is read last. This will guarantee that there is a way to set system defaults, and there is a way for the user to override them. There is currently no way to tell anything about the order of the other files in those directories, nor is there anyway to override system defaults yet.
The .keys files have the following format:
mime-type-match: [[LANG]]key=value
Above, the key is the key that is being defined and value is the value we bind to it. The optional [LANG] represents a language in which this definition is valid. If this part is specified, then the definition will only be valid if LANG matches the setting of the environment variable LANG. The LANG setting is used to provide keys which can be displayed to the user in a localized way.
This is an example to bind the key open to all of the mime-types matching image/* and the icon-filename key is bound to the /opt/gimp/share/xcf.png value:
image/*: open=gimp %f image/x-xcf: icon-filename=/opt/gimp/share/xcf.png
This will make the GIMP the handler for the open action. Files of type xcf would use the filename pointed in the icon-filename key.
%f gets interpolated with the file name or the list of file names that matched this mime-type.
As you can see from the example above, a .keys file does not need to provide all of the values, it can just provide or override some of the actions.
User defined bindings in .keys file will take precedence over system installed files.
open
icon-filename
view
ascii-view
fm-open
fm-view
fm-ascii-view
Those keys are also queried on the metadata (except in the cases where the lookup would be too expensive).
The res, unitwidth, fonts, and sizes lines are compulsory. Other commands are ignored by troff but may be used by postprocessors to store arbitrary information about the device in the DESC file.
Here a list of obsolete keywords which are recognized by groff but completely ignored: spare1, spare2, biggestfont.
Other commands are ignored by troff but may be used by postprocessors to store arbitrary information about the font in the font file.
The first section can contain comments which start with the # character and extend to the end of a line.
The second section contains one or two subsections. It must contain a charset subsection and it may also contain a kernpairs subsection. These subsections can appear in any order. Each subsection starts with a word on a line by itself.
The word charset starts the charset subsection. The charset line is followed by a sequence of lines. Each line gives information for one character. A line comprises a number of fields separated by blanks or tabs. The format is
name identifies the character: if name is a single character c then it corresponds to the groff input character c; if it is of the form [rs]c where c is a single character, then it corresponds to the special character [rs][c]; otherwise it corresponds to the groff input character [rs][name]. If it is exactly two characters xx it can be entered as [rs](xx. Note that single-letter special characters can`t be accessed as [rs]c; the only exception is `[rs]-` which is identical to `[rs][-]`. The name --- is special and indicates that the character is unnamed; such characters can only be used by means of the [rs]N escape sequence in troff.
Groff supports eight-bit characters; however some utilities have difficulties with eight-bit characters. For this reason, there is a convention that the name charn is equivalent to the single character whose code is n. For example, char163 would be equivalent to the character with code 163 which is the pounds sterling sign in ISO Latin-1.
The type field gives the character type:
The code field gives the code which the postprocessor uses to print the character. The character can also be input to groff using this code by means of the [rs]N escape sequence. The code can be any integer. If it starts with a 0 it will be interpreted as octal; if it starts with 0x or 0X it will be intepreted as hexadecimal. Note, however, that the [rs]N escape sequence only accepts a decimal integer.
The entity_name field gives an ascii string identifying the glyph which the postprocessor uses to print the character. This field is optional and has been introduced so that the html device driver can encode its character set. For example, the character `[rs][Po]` is represented as `£` in html~4.0.
Anything on the line after the encoding field resp. after `--` will be ignored.
The metrics field has the form (in one line; it is broken here for the sake of readability):
There must not be any spaces between these subfields. Missing subfields are assumed to be 0. The subfields are all decimal integers. Since there is no associated binary format, these values are not required to fit into a variable of type char as they are in ditroff. The width subfields gives the width of the character. The height subfield gives the height of the character (upwards is positive); if a character does not extend above the baseline, it should be given a zero height, rather than a negative height. The depth subfield gives the depth of the character, that is, the distance below the lowest point below the baseline to which the character extends (downwards is positive); if a character does not extend below above the baseline, it should be given a zero depth, rather than a negative depth. The italic-correction subfield gives the amount of space that should be added after the character when it is immediately to be followed by a character from a roman font. The left-italic-correction subfield gives the amount of space that should be added before the character when it is immediately to be preceded by a character from a roman font. The subscript-correction gives the amount of space that should be added after a character before adding a subscript. This should be less than the italic correction.
A line in the charset section can also have the format
This indicates that name is just another name for the character mentioned in the preceding line.
The word kernpairs starts the kernpairs section. This contains a sequence of lines of the form:
This means that when character c1 appears next to character c2 the space between them should be increased by n. Most entries in kernpairs section will have a negative value for n.
The field descriptions are:
/usr/portage/eclass/horde.eclass /usr/portage/eclass/webapp.eclass /usr/portage/eclass/cvs.eclass
Aaron Walker <ka0ttic@gentoo.org> Mike Frysinger <vapier@gentoo.org>
IP_address canonical_hostname aliases
Fields of the entry are separated by any number of blanks and/or tab characters. Text from a "#" character until the end of the line is a comment, and is ignored. Host names may contain only alphanumeric characters, minus signs ("-"), and periods ("."). They must begin with an alphabetic character and end with an alphanumeric character. Aliases provide for name changes, alternate spellings, shorter hostnames, or generic hostnames (for example, localhost). The format of the host table is described in RFC 952.
The Berkeley Internet Name Domain (BIND) Server implements the Internet name server for UNIX systems. It augments or replaces the /etc/hosts file or host name lookup, and frees a host from relying on /etc/hosts being up to date and complete.
In modern systems, even though the host table has been superseded by DNS, it is still widely used for:
127.0.0.1 localhost 192.168.1.10 foo.mydomain.org foo 192.168.1.13 bar.mydomain.org bar 216.234.231.5 master.debian.org master 205.230.163.103 www.opensource.org
The file uses the following format:
The hostname is the name of a host which is logically equivalent to the local host. Users logged into that host are allowed to access like-named user accounts on the local host without supplying a password. The hostname may be (optionally) preceded by a plus (+) sign. If the plus sign is used alone it allows any host to access your system. You can expicitly deny access to a host by preceding the hostname by a minus (-) sign. Users from that host must always supply a password. For security reasons you should always use the FQDN of the hostname and not the short hostname.
The username entry grants a specific user access to all user accounts (except root) without supplying a password. That means the user is NOT restricted to like-named accounts. The username may be (optionally) preceded by a plus (+) sign. You can also explicitly deny access to a specific user by preceding the username with a minus (-) sign. This says that the user is not trusted no matter what other entries for that host exist.
Netgroups can be specified by preceding the netgroup by an @ sign.
Be extremely careful when using the plus (+) sign. A simple typographical error could result in a standalone plus sign. A standalone plus sign is a wildcard character that means "any host"!
Modern systems use the Pluggable Authentication Modules library (PAM). With PAM a standalone plus sign is only considered a wildcard character which means "any host" when the word promiscuous is added to the auth component line in your PAM file for the particular service (e.g. rlogin).
/etc/iftab defines a set of mappings. Each mapping contains an interface name and a set of selectors. The selectors allow ifrename to identify each network interface on the system. If a network interface matches all descriptors of a mapping, ifrename attempt to change the name of the interface to the interface name given by the mapping.
The relationship between descriptors of a mapping is a logical and. A mapping matches a network interface only is all the descriptors match. If a network interface doesn`t support a specific descriptor, it won`t match any mappings using this descriptor.
If you want to use alternate descriptors for an interface name (logical or), specify two different mappings with the same interface name (one on each line). Ifrename always use the first matching mapping starting from the end of iftab, therefore more restrictive mapping should be specified last.
The interface name of a mapping is either a plain interface name (such as eth2 or wlan0) or a interface name pattern containing a single wildcard (such as eth* or wlan*). In case of wildcard, the kernel replace the `*` with the lowest available integer making this interface name unique.
Most users will only use the mac selector, other selectors are for more specialised setup.
Key/value entries are a keyword immediately followed by a colon, at least one blank and a value. For example:
max-connections: 10
A legal key contains nor blanks, nor colon, nor ``#``. There are 3 different types of values: integers, booleans, and strings. Integers are as to be expected. A boolean value is either ``true`` or ``false`` (case is significant). A string value is any other sequence of characters. If the string needs to contain whitespace, then it must be quoted with double quotes.
Peer entries look like:
peer <name> { # body }
The word ``peer`` is required. ``<name>``is a label for this peer. The ``<name>`` is any string valid as a key. The body of a peer entry contains some number of key/value entries.
Group entries look like:
group <name> { # body }
The word ``group`` is required. The ``<name>`` is any string valid as a key. The body of a group entry contains any number of the three types of entries. So key/value pairs can be defined inside a group, and peers can be nested inside a group, and other groups can be nested inside a group.
Key/value entries that are defined outside of all peer and group entries are said to be at ``global scope``. Global key/value entries act as defaults for peers. When innd(8) looks for a specific value in a peer entry (for example, the maximum number of connections to allow), if the value is not defined in the peer entry, then the enclosing groups are examined for the entry (starting at the closest enclosing group). If there are no enclosing groups, or the enclosing groups don`t define the key/value, then the value at global scope is used.
A small example could be:
# Global value applied to all peers that have # no value of their own. max-connections: 5 # A peer definition. peer uunet { hostname: usenet1.uu.net } peer vixie { hostname: gw.home.vix.com max-connections: 10 # override global value. } # A group of two peers who can open more # connections than normal group fast-sites { max-connections: 15 # Another peer. The ``max-connections`` value from the # ``fast-sites`` group scope is used. The ``hostname`` value # defaults to the peer`s name. peer data.ramona.vix.com { } peer bb.home.vix.com { hostname: bb.home.vix.com max-connections: 20 # he can really cook. } }
Given the above configuration file, the defined peers would have the following values for the ``max-connections`` key.
uunet 5 vixie 10 data.ramona.vix.com 15 bb.home.vix.com 20
Ten keys are allowed:
# # initscript Executed by init(8) for every program it # wants to spawn like this: # # /bin/sh /etc/initscript <id> <level> <action> <process> # # Set umask to safe level, and enable core dumps. umask 022 ulimit -c 2097151 PATH=/bin:/sbin:/usr/bin:/usr/sbin export PATH # Increase the hard filedescriptor limit for all processes # to 8192. The soft limit is still 1024, but any unpriviliged # process can increase it`s soft limit up to the hardlimit # with "ulimit -Sn xxx" (needs a 2.2.13 or later Linux kernel). ulimit -Hn 8192 # Execute the program. eval exec "$4"
This file is intended to be fairly static. Any changes made to it will generally not affect any running programs until they restart. Unlike nearly every other configuration file, inn.conf cannot be reloaded dynamically using ctlinnd(8); innd(8) must be stopped and restarted for relevant changes to inn.conf to take effect ("ctlinnd xexec innd" is the fastest way to do this.)
Blank lines and lines starting with a number sign ("#") are ignored. All other lines specify parameters, and should be of the following form:
<name>: <value>
(Any amount of whitespace can be put after the colon and is optional.) Everything after the colon and optional whitespace up to the end of the line is taken as the value. Multi-word values should not be put in quotes; if they are, the quotes will be taken as part of the value, not as delimiters. <name> is case-sensitive; "server" is not the same as "Server" or "SERVER". (inn.conf parameters are generally all in lowercase.)
If <name> occurs more than once in the file, the first value is used. Some parameters specified in the file may be overridden by environment variables. Most parameters have default values if not specified in inn.conf; those defaults are noted in the description of each parameter.
For the time being, it is strongly recommended to include every parameter in inn.conf even if it is set to the default value, since some shell scripts don`t correctly handle missing keys that they care about. This is a difficult-to-fix bug in the current parser that will be fixed in future versions of <FONT SIZE="-1">INN</FONT>.
Many parameters take a boolean value. For all such parameters, the value may be specified as "true", "yes", or "on" to turn it on and may be any of "false", "no", or "off" to turn it off. The case of these values is not significant.
This documentation is extremely long and organized as a reference manual rather than as a tutorial. If this is your first exposure to <FONT SIZE="-1">INN</FONT> and these parameters, it would be better to start by reading other man pages and referring to this one only when an inn.conf parameter is explicitly mentioned.
For most systems, "/usr/lib/sendmail -oi -oem %s" (adjusted for the correct path to sendmail) is a good choice.
This setting is ignored unless the timecaf storage method is used.
This is a somewhat messy, inefficient, and inexact way of refusing spam cancels. A much better way is to ask all of your upstream peers to not send to you any articles with "cyberspam" in the Path: header (usually accomplished by having them mark "cyberspam" as an alias for your machine in their feed configuration). The filtering enabled by this parameter is hard-coded; general filtering of message IDs can be done via the embedded filtering support.
This setting is ignored unless ovmethod is set to "tradindexed".
<FONT SIZE="-1">INN</FONT> has optional support for generating keyword information automatically from article body text and putting that information in overview for the use of clients that know to look for it. The following parameters control that feature.
This may be too slow if you`re taking a substantial feed, and probably will not be useful for the average news reader; enabling this is not recommended unless you have some specific intention to take advantage of it.
<FONT SIZE="-1">FIXME:</FONT> Currently, support for keyword generation is configured into <FONT SIZE="-1">INN</FONT> semi-randomly (based on whether configure found the regex library); it should be an option to configure and that option should be mentioned here.
nnrpd(8) has support for controlling high-volume posters via an exponential backoff algorithm, as configured by the following parameters.
Exponential posting backoff works as follows: News clients are indexed by <FONT SIZE="-1">IP</FONT> address (or username, see backoffauth below). Each time a post is received from an <FONT SIZE="-1">IP</FONT> address, the time of posting is stored (along with the previous sleep time, see below). After a configurable number of posts in a configurable period of time, nnrpd(8) will activate posting backoff and begin to sleep for increasing periods of time before actually posting anything. Posts will still be accepted, but an increasingly reduced rate.
After backoff has been activated, the length of time to sleep is computed based on the difference in time between the last posting and the current posting. If this difference is less than backoffpostfast, the new sleep time will be 1 + (previous sleep time * backoffk). If this difference is less than backoffpostslow but greater than backoffpostfast, then the new sleep time will equal the previous sleep time. If this difference is greater than backoffpostslow, the new sleep time is zero and posting backoff is deactivated for this poster.
Exponential posting backoff will not be enabled unless backoffdb is set and backoffpostfast and backoffpostslow are set to something other than their default values.
Here are the parameters that control exponential posting backoff:
<FONT SIZE="-1">FIXME:</FONT> This is a rather unintuitive name for this parameter.
mta: /usr/lib/sendmail -oi -oem %s ovmethod: tradindexed pathhost: news.example.com pathnews: /usr/local/news
For a more comprehensive example, see the sample inn.conf distributed with <FONT SIZE="-1">INN</FONT> and installed as a starting point; it contains all of the default values for reference.
$Id: inn.conf.5,v 1.86.2.11 2002/09/08 18:08:17 vinocur Exp $
Nearly every program in <FONT SIZE="-1">INN</FONT> uses this file to one degree or another. The above are just the major and most frequently mentioned ones.
The file consists of a series of lines; blank lines and lines beginning with a number sign (``#``) are ignored. All other lines consist of seven fields, each preceded by a delimiting character:
The delimiter can be any one of several non-alphanumeric characters that does not appear elsewhere in the line; there is no way to quote it to include it in any of the fields. Any of ``!``, ``,``, ``:``, ``@``, ``;``, or ``?`` is a good choice. Each line can have a different delimiter; the first character on each line is the delimiter for that line. White space surrounding delimiters, except before the first, is ignored, and does not form part of the fields, white space within fields is permitted. All delimiters must be present.
The first field is a label for the control line. It is used as an internal state indicator and in ctlinnd messages to control the server. If omitted, the line number is used.
The second field specifies when this control line should be used. It consists of a list of labels, and special indicators, separated by whitespace. If the current state matches against any of the labels in this field, this line will be used as described below. The values that may be used are:
The third field specifies a shell command that is invoked if this line matches. Do not use any shell filename expansion characters such as ``*``, ``?``, or ``[`` (even quoted, they`re not likely to work as intended). If the command succeeds, as indicated by its exit status, it is expected to have printed a single integer to standard output. This gives the value of this control line, to be used below. If the command fails, the line is ignored. The command is executed with its current directory set to the news spool directory, <patharticles in inn.conf>.
The fourth field specifies the operator to use to test the value returned above. It should be one of the two letter numeric test operators defined in test(1) such as ``eq``, ``lt`` and the like. The leading dash (``-``) should not be included.
The fifth field specifies a constant with which to compare the value using the operator just defined. This is done by invoking the command:
The sixth field specifies what should be done if the line succeeds, and in some cases if it fails. Any of the following words may be used:
The last field specifies the reason that is used in those ctlinnd commands that require one. More strictly, it is part of the reason --- innwatch appends some information to it. In order to enable other sites to recognize the state of the local innd server, this field should usually be set to one of several standard values. Use ``No space`` if the server is rejecting articles because of a lack of filesystem resources. Use ``loadav`` if the server is rejecting articles because of a lack of CPU resources.
Once innwatch has taken some action as a consequence of its control line, it skips the rest of the control file for this pass. If the action was to restart the server (that is, issue a ``go`` command), then the next pass will commence almost immediately, so that innwatch can discover any other condition that may mean that the server should be suspended again.
The first line causes the server to be throttled if the free space drops below 10000 units (using whatever units inndf(8) uses), and restarted again when free space increases above the threshold.
The second line does the same for inodes.
The next three lines act as a group and should appear in the following order. It is easier to explain them, however, if they are described from the last up.
!load!load hiload!loadavg!lt!5!go! :hiload:+ load:loadavg:gt:8:throttle:loadav /load/+/loadavg/ge/6/pause/loadav
Note that all three lines assume a mythical command loadavg that is assumed to print the current load average as an integer. In more practical circumstances, a pipe of uptime into awk is more likely to be useful.
The ``run`` state is not actually identified by the label with that three letter name, and using it will not work as expected.
Using an ``unusual`` character for the delimiter such as ``(``, ``*``, ``&``, `````, ``´``, and the like, is likely to lead to obscure and hard to locate bugs.
# include <sys/types.h> # include <sys/ipc.h> # include <sys/msg.h> # include <sys/sem.h> # include <sys/shm.h>
ushort cuid; /* creator user id */
ushort cgid; /* creator group id */
ushort uid; /* owner user id */
ushort gid; /* owner group id */
ushort mode; /* r/w permissions */
The mode member of the ipc_perm structure defines, with its lower 9 bits, the access permissions to the resource for a process executing an ipc system call. The permissions are interpreted as follows:
0400 Read by user. 0200 Write by user. 0040 Read by group. 0020 Write by group. 0004 Read by others. 0002 Write by others.
Bits 0100, 0010, and 0001 (the execute bits) are unused by the system. Furthermore, "write" effectively means "alter" for a semaphore set.
The same system header file also defines the following symbolic constants:
Note that IPC_PRIVATE is a key_t type, while all the other symbolic constants are flag fields and can be OR`ed into an int type variable.
struct ipc_perm msg_perm;
ushort msg_qnum; /* no of messages on queue */
ushort msg_qbytes; /* bytes max on a queue */
ushort msg_lspid; /* pid of last msgsnd call */
ushort msg_lrpid; /* pid of last msgrcv call */
time_t msg_stime; /* last msgsnd time */
time_t msg_rtime; /* last msgrcv time */
time_t msg_ctime; /* last change time */
struct ipc_perm sem_perm;
time_t sem_otime; /* last operation time */
time_t sem_ctime; /* last change time */
ushort sem_nsems; /* count of sems in set */
A semaphore is a data structure of type struct sem containing the following members:
ushort semval; /* semaphore value */
short sempid; /* pid for last operation */
ushort semncnt; /* nr awaiting semval to increase */
ushort semzcnt; /* nr awaiting semval = 0 */
struct ipc_perm shm_perm;
int shm_segsz; /* size of segment */
ushort shm_cpid; /* pid of creator */
ushort shm_lpid; /* pid, last operation */
short shm_nattch; /* no. of current attaches */
time_t shm_atime; /* time of last attach */
time_t shm_dtime; /* time of last detach */
time_t shm_ctime; /* time of last change */
It is vital that these secrets be protected. The file should be owned by the super-user, and its permissions should be set to block all access by others.
The file is a sequence of entries and include directives. Here is an example. Each entry or directive must start at the left margin, but if it continues beyond a single line, each continuation line must be indented.
# sample /etc/ipsec.secrets file for 10.1.0.1 10.1.0.1 10.2.0.1: PSK "secret shared by two hosts" # an entry may be split across lines, # but indentation matters www.xs4all.nl @www.kremvax.ru 10.6.0.1 10.7.0.1 1.8.0.1: PSK "secret shared by 5" # an RSA private key. # note that the lines are too wide for a # man page, so ... has been substituted for # the truncated part @my.com: rsa { Modulus: 0syXpo/6waam+ZhSs8Lt6jnBzu3C4grtt... PublicExponent: 0sAw== PrivateExponent: 0shlGbVR1m8Z+7rhzSyenCaBN... Prime1: 0s8njV7WTxzVzRz7AP+0OraDxmEAt1BL5l... Prime2: 0s1LgR7/oUMo9BvfU8yRFNos1s211KX5K0... Exponent1: 0soaXj85ihM5M2inVf/NfHmtLutVz4r... Exponent2: 0sjdAL9VFizF+BKU4ohguJFzOd55OG6... Coefficient: 0sK1LWwgnNrNFGZsS/2GuMBg9nYVZ... } include ipsec.*.secrets # get secrets from other files
Each entry in the file is a list of indices, followed by a secret. The two parts are separated by a colon (:) that is followed by whitespace or a newline. For compatability with the previous form of this file, if the key part is just a double-quoted string the colon may be left out.
An index is an IP address, or a Fully Qualified Domain Name, user@FQDN, %any or %any6 (other kinds may come). An IP address may be written in the familiar dotted quad form or as a domain name to be looked up when the file is loaded (or in any of the forms supported by the Openswan ipsec_ttoaddr(3) routine). In many cases it is a bad idea to use domain names because the name server may not be running or may be insecure. To denote a Fully Qualified Domain Name (as opposed to an IP address denoted by its domain name), precede the name with an at sign (@).
Matching IDs with indices is fairly straightforward: they have to be equal. In the case of a ``Road Warrior`` connection, if an equal match is not found for the Peer`s ID, and it is in the form of an IP address, an index of %any will match the peer`s IP address if IPV4 and %any6 will match a the peer`s IP address if IPV6. Currently, the obsolete notation 0.0.0.0 may be used in place of %any.
An additional complexity arises in the case of authentication by preshared secret: the responder will need to look up the secret before the Peer`s ID payload has been decoded, so the ID used will be the IP address.
To authenticate a connection between two hosts, the entry that most specifically matches the host and peer IDs is used. An entry with no index will match any host and peer. More specifically, an entry with one index will match a host and peer if the index matches the host`s ID (the peer isn`t considered). Still more specifically, an entry with multiple indices will match a host and peer if the host ID and peer ID each match one of the indices. If the key is for an asymmetric authentication technique (i.e. a public key system such as RSA), an entry with multiple indices will match a host and peer even if only the host ID matches an index (it is presumed that the multiple indices are all identities of the host). It is acceptable for two entries to be the best match as long as they agree about the secret or private key.
Authentication by preshared secret requires that both systems find the identical secret (the secret is not actually transmitted by the IKE protocol). If both the host and peer appear in the index list, the same entry will be suitable for both systems so verbatim copying between systems can be used. This naturally extends to larger groups sharing the same secret. Thus multiple-index entries are best for PSK authentication.
Authentication by RSA Signatures requires that each host have its own private key. A host could reasonably use a different private keys for different interfaces and for different peers. But it would not be normal to share entries between systems. Thus thus no-index and one-index forms of entry often make sense for RSA Signature authentication.
The key part of an entry may start with a token indicating the kind of key. ``RSA`` signifies RSA private key and ``PSK`` signifies PreShared Key (case is ignored). For compatability with previous forms of this file, PSK is the default.
A preshared secret is most conveniently represented as a sequence of characters, delimited by the double-quote character ("). The sequence cannot contain a newline or double-quote. Strictly speaking, the secret is actually the sequence of bytes that is used in the file to represent the sequence of characters (excluding the delimiters). A preshared secret may also be represented, without quotes, in any form supported by ipsec_ttodata(3).
An RSA private key is a composite of eight generally large numbers. The notation used is a brace-enclosed list of field name and value pairs (see the example above). A suitable key, in a suitable format, may be generated by ipsec_rsasigkey(8). The structure is very similar to that used by BIND 8.2.2 or later, but note that the numbers must have a ``0s`` prefix if they are in base 64. The order of the fields is fixed.
The first token an entry must start in the first column of its line. Subsequent tokens must be separated by whitespace, except for a colon token, which only needs to be followed by whitespace. A newline is taken as whitespace, but every line of an entry after the first must be indented.
Whitespace at the end of a line is ignored (except in the 0t notation for a key). At the start of line or after whitespace, # and the following text up to the end of the line is treated as a comment. Within entries, all lines must be indented (except for lines with no tokens). Outside entries, no line may be indented (this is to make sure that the file layout reflects its structure).
An include directive causes the contents of the named file to be processed before continuing with the current file. The filename is subject to ``globbing`` as in sh(1), so every file with a matching name is processed. Includes may be nested to a modest depth (10, currently). If the filename doesn`t start with a /, the directory containing the current file is prepended to the name. The include directive is a line that starts with the word include, followed by whitespace, followed by the filename (which must not contain whitespace).
The file is a text file, consisting of one or more sections. White space followed by # followed by anything to the end of the line is a comment and is ignored, as are empty lines which are not within a section.
A line which contains include and a file name, separated by white space, is replaced by the contents of that file, preceded and followed by empty lines. If the file name is not a full pathname, it is considered to be relative to the directory containing the including file. Such inclusions can be nested. Only a single filename may be supplied, and it may not contain white space, but it may include shell wildcards (see sh(1)); for example:
include ipsec.*.conf
The intention of the include facility is mostly to permit keeping information on connections, or sets of connections, separate from the main configuration file. This permits such connection descriptions to be changed, copied to the other security gateways involved, etc., without having to constantly extract them from the configuration file and then insert them back into it. Note also the also and alsoflip parameters (described below) which permit splitting a single logical section (e.g. a connection description) into several actual sections.
The first significant line of the file must specify the version of this specification that it conforms to:
version 2
A section begins with a line of the form:
type name
where type indicates what type of section follows, and name is an arbitrary name which distinguishes the section from others of the same type. (Names must start with a letter and may contain only letters, digits, periods, underscores, and hyphens.) All subsequent non-empty lines which begin with white space are part of the section; comments within a section must begin with white space too. There may be only one section of a given type with a given name.
Lines within the section are generally of the form
parameter=value
(note the mandatory preceding white space). There can be white space on either side of the =. Parameter names follow the same syntax as section names, and are specific to a section type. Unless otherwise explicitly specified, no parameter name may appear more than once in a section.
An empty value stands for the system default value (if any) of the parameter, i.e. it is roughly equivalent to omitting the parameter line entirely. A value may contain white space only if the entire value is enclosed in double quotes ("); a value cannot itself contain a double quote, nor may it be continued across more than one line.
Numeric values are specified to be either an ``integer`` (a sequence of digits) or a ``decimal number`` (sequence of digits optionally followed by `.` and another sequence of digits).
There is currently one parameter which is available in any type of section:
Parameter names beginning with x- (or X-, or x_, or X_) are reserved for user extensions and will never be assigned meanings by IPsec. Parameters with such names must still observe the syntax rules (limits on characters used in the name; no white space in a non-quoted value; no newlines or double quotes within the value). All other as-yet-unused parameter names are reserved for future IPsec improvements.
A section with name %default specifies defaults for sections of the same type. For each parameter in it, any section of that type which does not have a parameter of the same name gets a copy of the one from the %default section. There may be multiple %default sections of a given type, but only one default may be supplied for any specific parameter name, and all %default sections of a given type must precede all non-%default sections of that type. %default sections may not contain also or alsoflip parameters.
Currently there are two types of section: a config section specifies general configuration information for IPsec, while a conn section specifies an IPsec connection.
conn snt left=10.11.11.1 leftsubnet=10.0.1.0/24 leftnexthop=172.16.55.66 right=192.168.22.1 rightsubnet=10.0.2.0/24 rightnexthop=172.16.88.99 keyingtries=%forever
A note on terminology... In automatic keying, there are two kinds of communications going on: transmission of user IP packets, and gateway-to-gateway negotiations for keying, rekeying, and general control. The data path (a set of ``IPsec SAs``) used for user packets is herein referred to as the ``connection``; the path used for negotiations (built with ``ISAKMP SAs``) is referred to as the ``keying channel``.
To avoid trivial editing of the configuration file to suit it to each system involved in a connection, connection specifications are written in terms of left and right participants, rather than in terms of local and remote. Which participant is considered left or right is arbitrary; IPsec figures out which one it is being run on based on internal information. This permits using identical connection specifications on both ends. There are cases where there is no symmetry; a good convention is to use left for the local side and right for the remote side (the first letters are a good mnemonic).
Many of the parameters relate to one participant or the other; only the ones for left are listed here, but every parameter whose name begins with left has a right counterpart, whose description is the same but with left and right reversed.
Parameters are optional unless marked ``(required)``; a parameter required for manual keying need not be included for a connection which will use only automatic keying, and vice versa.
If one or both security gateways are doing forwarding firewalling (possibly including masquerading), and this is specified using the firewall parameters, tunnels established with IPsec are exempted from it so that packets can flow unchanged through the tunnels. (This means that all subnets connected in this manner must have distinct, non-overlapping subnet address blocks.) This is done by the default updown script (see ipsec_pluto(8)).
The implementation of this makes certain assumptions about firewall setup, notably the use of the old ipfwadm interface to the firewall. In situations calling for more control, it may be preferable for the user to supply his own updown script, which makes the appropriate adjustments for his system.