Sauron: SQL table descriptions

Sauron Database Format version 1.0

Tables



Table Descriptions



Table: common_fields

virtual table; generic fields for most of the tables

fieldtypecomments
cdateINT4 creation date
cuserCHAR(8) DEFAULT 'unknown' creating user
mdateINT4 modification date
muserCHAR(8) DEFAULT 'unknown' last changed by this user
expirationINT4 expiration date



Table: settings

global settings table

fieldtypecomments
keyTEXT NOT NULL CHECK(key <> '') name os setting tuple
valueTEXT string value of setting
ivalueINT4 interger value of setting
CONSTRAINTglobal_key PRIMARY KEY (key)



Table: servers

This table contains servers that are managed with this system. For each server named/dhcpd/printer configuration files can be automagically generated from the database.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
nameTEXT NOT NULL CHECK(name <> '') server name
zones_onlyBOOL DEFAULT false if true, generate named.zones
file otherwise generate
complete named.conf
no_rootsBOOL DEFAULT false if true, no root server (hint)
zone entry is generated
dhcp_modeINT DEFAULT 1 DHCP subnet map creation mode:
0 = use VLANs,
1 = use networks
dhcp_flagsINT DEFAULT 0 DHCP option flags:
0x01 = auto-generate domainnames
0x02 = enable failover protocol
named_flagsINT DEFAULT 0 named option flags:
0x01 = access control from master (slave only)
0x02 = include also slave zones from master
(slave only)
0x04 = do NOT generate HINFO records
0x08 = do NOT generate WKS records
masterserverINT DEFAULT -1 dynamically add slave zones
for all zones in master server
named.conf options...more to be added as needed...
versionTEXT version string to display (optional)
directoryTEXT base directory for named (optional)
pid_fileTEXT pid-file pathname (optional)
dump_fileTEXT dump-file pathname (optiona)
named_xferTEXT named-xfer pathname (optional)
stats_fileTEXT statistics-file pathname (optional)
memstats_fileTEXT memstatistics-file pathname (optional)
named_caTEXT DEFAULT 'named.ca' root servers filename
pzone_pathTEXT DEFAULT '' relative path for master
zone files
szone_pathTEXT DEFAULT 'NS2/' relative path for slave
zone files
query_src_ipTEXT query source ip (optional) (ip | '*')
query_src_portTEXT query source port (optional) (port | '*')
listen_on_portTEXT listen on port (optional)
transfer_sourceINET transfer-source (optional)
forwardCHAR(1) DEFAULT 'D' forward: D=default
O=only, F=first
check-names: D=default, W=warn, F=fail, I=ignore
checknames_mCHAR(1) DEFAULT 'D' check-names master
checknames_sCHAR(1) DEFAULT 'D' check-names slave
checknames_rCHAR(1) DEFAULT 'D' check-names response
boolean flags: D=default, Y=yes, N=no
nnotifyCHAR(1) DEFAULT 'D' notify
recursionCHAR(1) DEFAULT 'D' recursion
authnxdomainCHAR(1) DEFAULT 'D' auth-nxdomain
dialupCHAR(1) DEFAULT 'D' dialup
multiple_cnamesCHAR(1) DEFAULT 'D' multiple-cnames
rfc2308_type1CHAR(1) DEFAULT 'D' rfc2308-type1
default TTLs
ttlINT4 DEFAULT 86400 default TTL for RR records
refreshINT4 DEFAULT 43200 default SOA refresh
retryINT4 DEFAULT 3600 default SOA retry
expireINT4 DEFAULT 2419200 default SOA expire
minimumINT4 DEFAULT 86400 default SOA minimum
(negative caching ttl)
IPv6
ipv6TEXT reserved
DHCP failover
df_portINT DEFAULT 519 listen port
df_max_delayINT DEFAULT 60 max-response-delay
df_max_uupdatesINT DEFAULT 10 max-unacked-updates
df_mcltINT DEFAULT 3600 mlct
df_splitINT DEFAULT 128 split
df_loadbalmaxINT DEFAULT 3 load balance max seconds
defaults to use in zones
hostnameTEXT primary servername for sibling zone SOAs
hostaddrINET primary server IP address
hostmasterTEXT hostmaster name for sibling zone SOAs
unless overided in zone
commentTEXT 
CONSTRAINTservers_name_key UNIQUE(name)



Table: zones

This table contains zone definitions of a server.

fieldtypecomments
idSERIAL unique ID
serverINT4 NOT NULL ptr to a record in servers table
-->servers.id
activeBOOL DEFAULT true zone active flag
(only active zones are included in
named configuration)
dummyBOOL DEFAULT false dummy zone flag
typeCHAR(1) NOT NULL zone type:
(H)int,
(M)aster,
(S)lave,
(F)orward
reverseBOOL DEFAULT false true for reverse (arpa) zones
noreverseBOOL DEFAULT false if true, zone not used in reverse
map generation
flagsINT DEFAULT 0 zone option flags:
0x01 = generate TXT records from
user,dept,location,info fields
forwardCHAR(1) DEFAULT 'D' forward: D=default,
O=only, F=first
nnotifyCHAR(1) DEFAULT 'D' notify: D=default, Y=yes, N=no
chknamesCHAR(1) DEFAULT 'D' check-names:
D=default,
W=warn,
F=fail,
I=ignore
classCHAR(2) DEFAULT 'in' zone class (IN)
nameTEXT NOT NULL CHECK (name <> '') zone name
hostmasterTEXT hostmaster (email)
(optional; if not defined value from server table
is used instead)
serialCHAR(10) DEFAULT '1999123001' zone serial number
(automagically updated)
serial_dateINT4 DEFAULT 0 zone serial last update date
refreshINT4 zone SOA refresh time
retryINT4 zone SOA retry time
expireINT4 zone SOA expire time
minimumINT4 zone SOA minimum (negative caching) time
ttlINT4 default TTL for RRs in this zone
(if not defined, value from servers record is
used instead)
zone_ttlINT4 unused
commentTEXT 
reversenetCIDR contains CIDR of the reverse zone
(if applicaple)
parentINT4 DEFAULT -1 unused
CONSTRAINTzones_key PRIMARY KEY (name,server)



Table: hosts

This table contains host entries for a zone.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
zoneINT4 NOT NULL ptr to a zone table record
-->zones.id
typeINT4 DEFAULT 0 host type:
0=misc,
1=host,
2=subdomain (delegation),
3=mx entry,
4=alias (cname),
5=printer,
6=glue record,
7=alias (arec),
8=srv entry,
9=dhcp only,
10=zone,
101=host reservation
domainTEXT NOT NULL CHECK(domain <> '') host domain name
ttlINT4 TTL for host records, default if NULL
classCHAR(2) DEFAULT 'IN' class (IN)
grpINT4 DEFAULT -1 ptr to group
-->groups.id
aliasINT4 DEFAULT -1 ptr to another host record
(for CNAME alias)
cname_txtTEXT CNAME value for out-of-zone alias
hinfo_hwTEXT HINFO hardware
hinfo_swTEXT HINFO software
locTEXT LOC record value
wksINT4 DEFAULT -1 ptr to wks_templates table entry
-->wks_templates.id
mxINT4 DEFAULT -1 ptr to mx_templates table entry
-->mx_templates.id
rp_mboxTEXT DEFAULT '.' RP mbox
rp_txtTEXT DEFAULT '.' RP txt
routerINT4 DEFAULT 0 router if > 0, also router priority
(1 being highest priority)
prnBOOL DEFAULT false true for virtual printer entries
flagsINT4 DEFAULT 0 reserved
etherCHAR(12) Ethernet address (MAC)
ether_aliasINT4 DEFAULT -1 ptr to another host record
(for ETHER address)
dhcp_dateINT4 last time host requested IP
dhcp_infoTEXT reserved
infoTEXT Host info (appears as TXT record)
locationTEXT Host location info
deptTEXT Department name
huserTEXT User info
modelTEXT host model info
serialTEXT serial number
miscTEXT misc info
asset_idTEXT asset ID
commentTEXT comment
CONSTRAINThostname_key UNIQUE (domain,zone),
CONSTRAINTether_key UNIQUE(ether,zone),
CONSTRAINTasset_key UNIQUE(asset_id,zone)



Table: groups

Group descriptions, linked to server record. Hosts can "belong" to one group and get DHCP/printer/etc definitions from that group.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
serverINT4 NOT NULL ptr to a servers table record
-->servers.id
nameTEXT NOT NULL CHECK(name <> '') group name
typeINT NOT NULL group type:
1 = normal group,
2 = dynamic address pool,
3 = DHCP client class
alevelINT4 DEFAULT 0 required authorization level
commentTEXT 
CONSTRAINTgroups_key UNIQUE(name,server)



Table: nets

Net/subnet descriptions, linked to server record. Used mainly for generating subnet map for DHCP and access control/user friendliness in front-ends.

fieldtypecomments
idSERIAL unique ID
serverINT4 NOT NULL ptr to a servers table record
-->servers.id
netnameTEXT (sub)net name
nameTEXT descriptive name of the (sub)net
netCIDR NOT NULL net CIDR
subnetBOOL DEFAULT true subnet flag
vlanINT4 DEFAULT -1 ptr to vlans table record
-->vlans.id
alevelINT4 DEFAULT 0 required authorization level
typeINT4 DEFAULT 0 network type/option flags:
0x01 = private (hidden from browser)
ipv6TEXT reserved
rp_mboxTEXT DEFAULT '.' RP mbox
rp_txtTEXT DEFAULT '.' RP txt
no_dhcpBOOL DEFAULT false no-DHCP flag
range_startINET auto assign address range start
range_endINET auto assign address range end
commentTEXT comment
CONSTRAINTnets_key PRIMARY KEY (net,server)



Table: cidr_entries

This table contains CIDRs used in server various contexts.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
typeINT4 NOT NULL type:
1=server (allow-transfer)
2=zone (allow-update)
3=zone (masters)
4=zone (allow-query)
5=zone (allow-transfer)
6=zone (also-notify)
7=server (allow-query)
8=server (allow-recursion)
9=server (blackhole)
10=server (listen-on)
11=server (forwarders)
12=zone (forwarders)
refINT4 NOT NULL ptr to table speciefied by type field
-->servers.id
-->zones.id
ipCIDR CIDR value
commentTEXT 



Table: dhcp_entries

This table contains DHCP options user in various contexts.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
typeINT4 NOT NULL type:
1=server,
2=zone,
3=host,
4=net,
5=group
6=vlan (shared-network)
refINT4 NOT NULL ptr to table speciefied by type field
-->servers.id
-->zones.id
-->hosts.id
-->nets.id
-->groups.id
dhcpTEXT DHCP entry value (without trailing ';')
commentTEXT 



Table: ether_info

This table contains Ethernet adapter manufacturer codes.

fieldtypecomments
eaCHAR(6) PRIMARY KEY manufacturer code
(6 bytes in hex)
infoTEXT manufacturer name & info



Table: mx_entries

This table contains MX record entries.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
typeINT4 NOT NULL type:
1=zone (not used anymore!),
2=host,
3=mx_templates
refINT4 NOT NULL ptr to table speciefied by type field
-->zones.id
-->hosts.id
-->mx_templates
priINT4 NOT NULL CHECK (pri >= 0) MX priority
mxTEXT MX domain (FQDN)
commentTEXT 



Table: mx_templates

MX entry templates, hosts may link to one entry in this table. Entries are zone specific.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
zoneINT4 NOT NULL ptr to a zone table record
-->zones.id
alevelINT4 DEFAULT 0 required authorization level
nameTEXT template name
commentTEXT 



Table: ns_entries

This table contains NS resource record definitions.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
typeINT4 NOT NULL type:
1=zone (not used anymore!),
2=host
refINT4 NOT NULL ptr to table speciefied by type field
-->zones.id
-->hosts.id
nsTEXT value of NS record (FQDN)
commentTEXT 



Table: printer_classes

Global table to store printer classes (printcap stuff) these classess maybe referred to in PRINTER fields in other tables.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
nameTEXT UNIQUE NOT NULL CHECK(name <> '') class name
commentTEXT 



Table: printer_entries

This table contains printer definition entries.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
typeINT4 NOT NULL type:
1=group,
2=host,
3=printer_class
refINT4 NOT NULL ptr to table speciefied by type field
-->groups.id
-->hosts.id
-->printer_classes.id
printerTEXT printcap entry
commentTEXT 



Table: a_entries

Addresses (A records) for hosts, linked to a host record.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
hostINT4 NOT NULL ptr to hosts table id
-->hosts.id
ipINET IP number
ipv6TEXT reserved
typeINT4 DEFAULT 0 reserved
reverseBOOL DEFAULT true generate reverse (PTR) record flag
forwardBOOL DEFAULT true generate (A) record flag
commentCHAR(20) 



Table: txt_entries

This table contains TXT record entries and miscellaneous text entries.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
typeINT4 NOT NULL type:
1=zone (not used anymore!),
2=host,
3=server
10=server (BIND logging entry)
refINT4 NOT NULL ptr to table speciefied by type field
-->zones.id
-->hosts.id
-->servers.id
txtTEXT value of TXT record
commentTEXT comments



Table: srv_entries

This table contains MX record entries.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
typeINT4 NOT NULL type:
1=host
refINT4 NOT NULL ptr to table speciefied by type field
-->hosts.id
priINT4 NOT NULL CHECK (pri >= 0) priority
weightINT4 NOT NULL CHECK (weight >= 0) weight
portINT4 NOT NULL CHECK (port >= 0) port
targetTEXT NOT NULL DEFAULT '.' target
commentTEXT comment



Table: users

This table contains (user interface) user account information.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
gidINT4 DEFAULT -1 ptr to user group
-->user_groups.id
usernameTEXT NOT NULL CHECK(username <> '') login name
passwordTEXT encrypted password (MD5 or Crypt)
nameTEXT long user name
emailTEXT user email address
superuserBOOL DEFAULT false superuser flag
serverINT4 DEFAULT -1 default server id
zoneINT4 DEFAULT -1 default zone id
lastINT4 DEFAULT 0 last login time
last_pwdINT4 DEFAULT 0 last password change time
last_fromTEXT last login host
search_optsTEXT default search options
flagsINT4 DEFAULT 0 user account flasgs:
0x01 = email notifications on
commentTEXT 
CONSTRAINTusername_key UNIQUE(username)



Table: user_rights

This table contains record defining user rights.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
typeINT NOT NULL type:
1=user_group
2=users
refINT NOT NULL ptr to users table specified by type
-->user_groups.id
-->users.id
rtypeINT NOT NULL type:
1=server,
2=zone,
3=net,
4=hostnamemask
5=IP mask
6=authorization level
7=host expiration limit (days)
8=default for dept
rrefINT NOT NULL ptr to table specified by type field
ruleCHAR(40) R,RW,RWS or regexp



Table: user_groups

This table contains records defining user groups.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
nameTEXT NOT NULL CHECK (name <> '') group name
commentTEXT comments
CONSTRAINTuser_groups_name_key UNIQUE(name)



Table: wks_entries

This table contains WKS record entries.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
typeINT4 NOT NULL type:
1=host,
2=wks_template
refINT4 NOT NULL ptr to table speciefied by type field
-->hosts.id
-->wks_templates.id
protoCHAR(10) protocol (tcp,udp)
servicesTEXT services (ftp,telnet,smtp,http,...)
commentTEXT 



Table: wks_templates

WKS entry templates, hosts may link to one entry in this table. Entries are server specific.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
serverINT4 NOT NULL ptr to a server table record
-->servers.id
alevelINT4 DEFAULT 0 required authorization level
nameTEXT template name
commentTEXT 



Table: utmp

This table contains "utmp" data of currently logged in www-interface users.

fieldtypecomments
cookieCHAR(32) PRIMARY KEY session id cookie (MD5)
uidINT4 ptr to users table record
-->users.id
gidINT4 ptr to user_groups table record
-->user_groups.id
sidINT4 session ID
unameTEXT username
addrCIDR user's IP address
superuserBOOL DEFAULT false superuser flag
authBOOL DEFAULT false user authenticated flag
modeINT4 current status of user
wTEXT last command user excecuted
serveridINT4 DEFAULT -1 current server id
serverTEXT current server name
zoneidINT4 DEFAULT -1 current zone id
zoneTEXT current zone name
loginINT4 DEFAULT 0 login time
lastINT4 DEFAULT 0 last activity time
searchoptsTEXT current search options
searchdomainTEXT current search domain
searchpatternTEXT current search pattern



Table: hinfo_templates

HINFO templates table contains list of default values for HINFO records.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
hinfoTEXT NOT NULL CHECK(hinfo <> '') UNIQUE HINFO value
typeINT4 DEFAULT 0 type:
0=hardware,
1=software
priINT4 DEFAULT 100 priority (defines the order in which
entries are displayed in user interfaces)



Table: arec_entries

pointers to A record aliased hosts, linked to a host record.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
hostINT4 NOT NULL ptr to hosts table id
-->hosts.id
arecINT4 NOT NULL ptr to aliased host id
-->hosts.id



Table: root_servers

This table contains root server definitions.

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
serverINT4 NOT NULL ptr to server table id
-->servers.id
ttlINT4 DEFAULT 3600000 
domainTEXT NOT NULL domainname
typeTEXT NOT NULL A,NS,...
valueTEXT NOT NULL value



Table: history

history table contains "log" data of modifications done to the databse

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
sidINT NOT NULL session ID
uidINT NOT NULL user ID
dateINT NOT NULL date of record
typeINT NOT NULL record type:
1=hosts table modification,
2=zones
3=servers
4=nets
5=users
refINT optional reference
actionCHAR(25) operation performed
infoCHAR(80) extra info



Table: lastlog

lastlog table contains "lastlog" data of database users

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
sidINT NOT NULL session ID
uidINT NOT NULL user ID
dateINT NOT NULL date of record
stateINT NOT NULL record type:
1=logged in
2=logged out
3=idle timeout
4=reconnect
ldateINT DEFAULT -1 logout date
ipINET remote IP
hostCHAR(40) remote host



Table: news

This table contains motd/news to be displayed when user logs in...

fieldtypecomments
idSERIAL PRIMARY KEY unique ID
serverINT DEFAULT -1 ptr to server or -1 for global
news messages
infoTEXT NOT NULL news/motd message



Table: vlans

"VLAN" (Layer-2 networks/shared networks) descriptions, linked to server record. Used mainly for generating of shared-network map for DHCP.

fieldtypecomments
idSERIAL unique ID
serverINT4 NOT NULL ptr to a servers table record
-->servers.id
nameTEXT NOT NULL CHECK(name <> '') name of vlan
descriptionTEXT long name
commentTEXT comments
CONSTRAINTvlans_key PRIMARY KEY (name,server)


Automagically generated by htmldoc-sql
Thu Jan 16 22:33:56 2003