Changes between Version 2 and Version 3 of Doc/panc/stdtpl/types


Ignore:
Timestamp:
Nov 30, 2007, 12:49:59 PM (16 years ago)
Author:
/O=GRID-FR/C=FR/O=CNRS/OU=LAL/CN=Charles Loomis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Doc/panc/stdtpl/types

    v2 v3  
    22[[TracNav]]
    33
     4[[TOC(inline)]]
    45
     6Machine configuration often need type definitions for things like host names, URLs, port numbers and the like.  These occur in most machine configuration and the associated type definitions have been provided in the 'pan/types' template.  You can use these types by including this template in your machine configuraton:
     7{{{
     8  include { 'pan/types' };
     9}}}
     10Each of the defined types has an associated validation function that can be used in the construction of other types.  The sections below give the name of the type and the associated validation function.
     11
     12== Date-Related Types ==
     13
     14=== type_asndate, is_asndate(string) ===
     15
     16This type implements a date/time format consistent with ASN.1 typically used by LDAP.  The actual specification is the "GeneralizedTime" format as specified on page 38 of the X.208 ITU-T recommendation and references within.  Examples include:
     17{{{
     1820040825120123Z
     1920040825120123+0100
     2020040825120123,5
     2120040825120123.5
     2220040825120123.5-0123
     23}}}
     24
     25=== type_isodate, is_isodate(string) ===
     26
     27This type implements a date/time format consistent with the W3C use of the datetime format.  (See the [[document][http://www.w3.org/TR/NOTE-datetime]].)  This is a subset of the ISO8601 specification.  This type allows a short form with just a complete date or a full date/time.  For the time (if given) only the fractions of a second field is optional.  Examples include:
     28{{{
     292004-08-25
     302004-08-25T12:32:00.01+05:00
     312004-08-25T12:32:00Z
     32}}}
     33
     34== Network-Related Types ==
     35
     36=== type_hwaddr, is_hwaddr(string) ===
     37
     38The hardware address is a series of six bytes encoded as hex values and separated with a colon or a hyphen.  Within a value you must use a consistent separator.  Both upper and lower-case hex digits are accepted. Examples:
     39{{{
     4000:D0:59:33:F6:30
     4100-D0-59-33-F6-30
     42}}}
     43
     44=== type_ipv4, is_ipv4(string) ===
     45
     46IPv4 address in dotted-decimal notation.  Examples:
     47{{{
     48127.0.0.1
     49208.77.188.166
     50}}}
     51
     52=== type_ipv6, is_ipv6(string) ===
     53
     54IPv6 address in usual notation with colon-separated fields.
     55
     56=== type_ip, is_ip(string) ===
     57
     58A value that is either a valid IPv4 or IPv6 network address.
     59
     60== Hostname-Related Types ==
     61
     62=== type_fqdn, is_fqdn(string) ===
     63
     64A fully-qualified domain name.  Each part of the domain name is separated by a period.  The individual parts must begin with a letter or digit, end with a letter or digit, and may contain letters, digits, or hyphens in the middle.  The relevant RFC's for host name syntax are 952, 1053, and 1123 (section 2.1).
     65
     66=== type_hostname, is_hostname(string) ===
     67
     68Values that are either a valid raw IP address (v4 or v6) or a fully-qualified domain name.
     69
     70=== type_shorthostname, is_shorthostname(string) ===
     71
     72A string that is a valid name for a host and that does not contain the domain.
     73
     74=== type_port, is_port(long) ===
     75
     76A long value that is a valid port number (i.e. in the range [0, 65535]).
     77
     78=== type_hostport, is_hostport(string) ===
     79
     80A value of the form "hostname:port".  The individual component are verified to be also correct.
     81
     82
     83
     84