Initial commit

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
Patrick McCarty
2016-02-24 09:34:13 -08:00
commit c42f8a3aa1
236 changed files with 18402 additions and 0 deletions
+121
View File
@@ -0,0 +1,121 @@
/*
* Software Updater - client side
*
* Copyright © 2012-2016 Intel Corporation.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2 or later of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Eric Lapuyade <eric.lapuyade@intel.com>
* cguiraud <christophe.guiraud@intel.com>
* Timothy C. Pepper <timothy.c.pepper@linux.intel.com>
* Arjan van de Ven <arjan@linux.intel.com>
*
*/
#define _GNU_SOURCE
#include <bsdiff.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <assert.h>
#include "swupd.h"
double a[5], b[5];
int size[5];
double count[5];
int main(int UNUSED_PARAM argc, char UNUSED_PARAM **argv)
{
int ret;
int algo;
struct timeval before, after;
struct stat st1, st2;
struct file *file1, *file2;
ret = stat(argv[1], &st1);
if (ret)
exit(0);
ret = stat(argv[2], &st2);
if (ret)
exit(0);
file1 = calloc(1, sizeof(struct file));
assert(file1);
file1->use_xattrs = true;
file1->filename = strdup(argv[2]);
file2 = calloc(1, sizeof(struct file));
assert(file2);
file2->use_xattrs = true;
file1->filename = strdup("result");
populate_file_struct(file1, argv[2]);
ret = compute_hash(file1, argv[2]);
if ((ret != 0) || hash_is_zeros(file1->hash)) {
printf("Hash computation failed\n");
exit(0);
}
for (algo = 0; algo < BSDIFF_ENC_LAST; algo++) {
struct stat bu;
int i;
time_t start;
unlink("output.bsdiff");
make_bsdiff_delta(argv[1], argv[2], "output.bsdiff", algo);
stat("output.bsdiff", &bu);
start = time(NULL);
gettimeofday(&before, NULL);
for (i = 0; i < 10000; i++) {
ret = apply_bsdiff_delta(argv[1], "result", "output.bsdiff");
if (i > 500 && time(NULL) - start > 5)
break;
}
gettimeofday(&after, NULL);
populate_file_struct(file1, "result");
ret = compute_hash(file2, "result");
if ((ret != 0) || hash_is_zeros(file2->hash)) {
printf("Hash computation failed\n");
exit(0);
}
if (!hash_compare(file1->hash, file2->hash)) {
printf("Hash mismatch for algorithm %i \n", algo);
exit(0);
}
unlink("result");
b[algo] = before.tv_sec + before.tv_usec / 1000000.0;
a[algo] = after.tv_sec + after.tv_usec / 1000000.0;
count[algo] = i / 5000.0;
size[algo] = bu.st_size;
}
printf("file, %s, orgsize, %i, best, %i, unc, %i, %5.3f, bzip, %i, %5.3f, gzip, %i, %5.3f, xz, %i, %5.3f, zeros, %i, %5.3f\n",
argv[1], (int)(st1.st_size+st2.st_size)/2, size[0],
size[1], (a[1] - b[1])/count[1],
size[2], (a[2] - b[2])/count[2],
size[3], (a[3] - b[3])/count[3],
size[4], (a[4] - b[4])/count[4],
size[5], (a[5] - b[5])/count[5]);
return ret;
}
+6
View File
@@ -0,0 +1,6 @@
diffs/
errors/
failed/
fulldownload/
patched/
results/
+124
View File
@@ -0,0 +1,124 @@
#!/bin/bash
input=/usr/bin/bash
enc="full"
if [ $# -lt 1 ]; then
echo -e "\tUsage: creatediffs.sh folder-to-diff [<optional-file-to-diff-against>] <optional_encoding>\n"
exit
fi
if [ $# -ge 2 ]; then
input=$2
fi
if [ $# -eq 3 ]; then
enc=$3
fi
folder=$1
# Using find because rm fails when there are > 4096 files
echo "* Cleaning up output folders..."
find diffs/* -name "*" -delete > /dev/null 2>&1
find failed/* -name "*" -delete > /dev/null 2>&1
find fulldownload/* -name "*" -delete > /dev/null 2>&1
find patched/* -name "*" -delete > /dev/null 2>&1
rm -rf errors/errordiffs errors/falsepositivediffs errors/hashfails RESULTS.txt
differr=0
patcherr=0
falsepos=0
hasherr=0
# Run bsdiff with every supported encoding
echo "* Running bsdiff..."
if [ "$enc" == "full" ]; then
for f in $(ls $folder);
do
for t in $(cat types);
do
echo "$input ----> $f TYPE: $t"
sudo bsdiff $input $folder/$f diffs/$f.$t $t #> /dev/null
ret=$?
if [ $ret -eq 255 ]; then
echo -e "***ERROR: $ret\n"
sudo mv diffs/$f.$t failed/$f.$t
let differr=differr+1
elif [ $ret -eq 1 ]; then
echo -e "\t* FULL DOWNLOAD requested"
sudo mv diffs/$f.$t fulldownload/$f.$t
fi
done
done
else
# Do diffs with ONLY the specified encoding if given
echo "IN MINIMAL"
for f in $(ls $folder);
do
echo "$input ----> $f TYPE: $enc"
sudo valgrind bsdiff $input $folder/$f diffs/$f.$enc $enc
ret=$?
if [ $ret -eq 255 ]; then
echo -e "***ERROR: $ret\n"
sudo mv diffs/$f failed/$f
let differr=differr+1
elif [ $ret -eq 1 ]; then
sudo mv diffs/$f fulldownload/$f
fi
done
fi
# Check if the successful diffs REALLY do apply cleanly
echo -e "\n* Applying created diffs..."
for f in $(ls diffs);
do
sudo bspatch $input patched/$f diffs/$f
ret=$?
if [ $ret -ne 0 ]; then
echo -e "Failed to apply diff $f\n"
let patcherr=patcherr+1
sudo echo "$f, $ret" >> errors/errordiffs
fi
done
echo -e "Finished!\n"
# Check if any failed diffs apply cleanly to mark false positives
echo -e "* Applying failed diffs..."
for f in $(ls failed);
do
sudo bspatch $input patched/$f-FAILED failed/$f
ret=$?
if [ $ret -eq 0 ]; then
echo "FALSEPOSITIVE: $f applied successfully"
echo "$f, $ret" >> errors/falsepositivediffs
let falsepos=falsepos+1
fi
done
echo -e "Finished!\n"
# Check that the patched file hashes match the original file hashes
for f in $(ls patched);
do
newhash=$(sudo swupd hashdump --basepath ./ patched/$f | tail -1)
# strip the encoding type off the filename so we can match the original file
oldfile=$(echo $f | sed 's/\.[a-z0-9]*$//')
oldhash=$(sudo swupd hashdump --basepath $folder $oldfile | tail -1)
if [[ "$newhash" != "$oldhash" ]]; then
echo -e "\n*** ERROR: hash mismatch **\n$input/$oldfile\n"
echo -e "patched/$f\nHas Hash: $newhash\nExpected: $oldhash\n" >> errors/hashfails
echo -e "NEWHASH: $newhash\nOLDHASH: $oldhash"
let hasherr=hasherr+1
fi
done
# Report the number of failures since a lot of output was probably produced
echo "Failed Diffs: $differr" | tee -a RESULTS.txt
echo "Failed patches: $patcherr" | tee -a RESULTS.txt
echo "False positive diffs: $falsepos" | tee -a RESULTS.txt
echo "Hash Mismatches: $hasherr" | tee -a RESULTS.txt
echo
@@ -0,0 +1,7 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% block form_attrs %}enctype="multipart/form-data"{% endblock %}
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "Use one of the available template source options to specify the template to be used in creating this stack." %}</p>
{% endblock %}
@@ -0,0 +1,7 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "You may update the editable properties of your port here." %}</p>
{% endblock %}
@@ -0,0 +1,7 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "You may update the editable properties of your network here." %}</p>
{% endblock %}
@@ -0,0 +1,28 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}select_template{% endblock %}
{% block form_action %}{% url 'horizon:project:stacks:change_template' stack.id %}{% endblock %}
{% block form_attrs %}enctype="multipart/form-data"{% endblock %}
{% block modal-header %}{% trans "Select Template" %}{% endblock %}
{% block modal_id %}select_template_modal{% endblock %}
{% block modal-body %}
<div class="left">
<fieldset>
{% include "horizon/common/_form_fields.html" %}
</fieldset>
</div>
<div class="right">
<h3>{% trans "Description:" %}</h3>
<p>{% trans "Use one of the available template source options to specify the template to be used in creating this stack." %}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Next" %}" />
<a href="{% url 'horizon:project:stacks:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
+25
View File
@@ -0,0 +1,25 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}update_network_form{% endblock %}
{% block form_action %}{% url 'horizon:admin:networks:update' network_id %}{% endblock %}
{% block modal-header %}{% trans "Edit Network" %}{% endblock %}
{% block modal-body %}
<div class="left">
<fieldset>
{% include "horizon/common/_form_fields.html" %}
</fieldset>
</div>
<div class="right">
<h3>{% trans "Description:" %}</h3>
<p>{% trans "You may update the editable properties of your network here." %}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url 'horizon:admin:networks:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,30 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}update_port_form{% endblock %}
{% block form_action %}{% url 'horizon:admin:networks:editport' network_id port_id %}{% endblock %}
{% block modal-header %}{% trans "Edit Port" %}{% endblock %}
{% block modal-body %}
<div class="left">
<dl>
<dt>{% trans "ID" %}</dt>
<dd>{{ port_id }}</dd>
</dl>
<hr>
<fieldset>
{% include "horizon/common/_form_fields.html" %}
</fieldset>
</div>
<div class="right">
<h3>{% trans "Description:" %}</h3>
<p>{% trans "You may update the editable properties of your port here." %}</p>
</div>
{% endblock %}
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url 'horizon:admin:networks:detail' network_id %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
@@ -0,0 +1,16 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Router Details" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Router Details") %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{% include "project/routers/_detail_overview.html" %}
{{ tab_group.render }}
</div>
</div>
{% endblock %}
@@ -0,0 +1,12 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Router Details" %}{% endblock %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{% include "admin/routers/_detail_overview.html" %}
{{ tab_group.render }}
</div>
</div>
{% endblock %}
@@ -0,0 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
void *mem = malloc(atoi(argv[1]));
if (!mem) {
fprintf(stderr, "failed to allocate, mem = %p\n", mem);
exit(1);
}
printf("mem: %p\n", mem);
free(mem);
return 0;
}
@@ -0,0 +1 @@
any
@@ -0,0 +1,61 @@
Advanced configuration interface
********************************
Configuration basics
====================
The default configuration method for all services is automatic or something
like DHCP. In almost every case that should be just good enough, but if it
is not, Connection Manager supports manual configuration for Ethernet and
IP settings.
Configuration interface
=======================
Every service contains two properties. One represents the current active
configuration and the other one allows manual configuration via the user.
For IPv4 they are named "IPv4" and IPv4.Configuration".
[ /profile/default/wifi_001122334455_42696720696e204a6170616e_managed_psk ]
Type = wifi
Name = Big in Japan
Mode = managed
Strength = 82
Security = rsn
Favorite = true
State = ready
IPv4.Configuration = { Method=dhcp }
IPv4 = { Netmask=255.255.255.0 Method=dhcp Address=192.168.1.198 }
The above WiFi network shows how the default configuration would look like
with a connected service. The configuration method is DHCP and the current
IP address is 192.168.1.198.
The "IPv4" property is read-only and will emit PropertyChanged signals in
case the IP address of this interface changes. The "IPv4.Configuration"
property is read-write and allows changes. For example to use a static IP
configuration this call could be used:
service.SetProperty("IPv4.Configuration", { "Method": "manual",
"Address": "192.168.1.100",
"Netmask": "255.255.255.0" })
The configuration itself is a dictionary with various fields. Not all of
them need to be present. A lot of combinations are valid.
For example the "Method" field has valid settings of "off", "fixed", "manual"
and "dhcp". The "fixed" value however can not be set by any user program. It
is an internal value that some 3G cards require. Switching to "off" will
remove any IP configuration from the interface. The "manual" method allows
for static address configuration. And "dhcp" will use DHCP to retrieve all
required information automatically.
With a manual configuration, the fields "Address" and "Netmask" should be
given. In case "Netmask" is left out, the best netmask will be calculated.
The "Gateway" field can be used to indicate the default route/gateway for
this interface.
+305
View File
@@ -0,0 +1,305 @@
Agent hierarchy
===============
Service unique name
Interface net.connman.Agent
Object path freely definable
Methods void Release()
This method gets called when the service daemon
unregisters the agent. An agent can use it to do
cleanup tasks. There is no need to unregister the
agent, because when this method gets called it has
already been unregistered.
void ReportError(object service, string error)
This method gets called when an error has to be
reported to the user.
A special return value can be used to trigger a
retry of the failed transaction.
Possible Errors: net.connman.Agent.Error.Retry
void ReportPeerError(object peer, string error)
This method gets called when an error has to be
reported to the user about a peer connection.
A special return value can be used to trigger a
retry of the failed transaction.
Possible Errors: net.connman.Agent.Error.Retry
void RequestBrowser(object service, string url)
This method gets called when it is required
to ask the user to open a website to procceed
with login handling.
This can happen if connected to a hotspot portal
page without WISPr support.
Possible Errors: net.connman.Agent.Error.Canceled
dict RequestInput(object service, dict fields)
This method gets called when trying to connect to
a service and some extra input is required. For
example a passphrase or the name of a hidden network.
The return value should be a dictionary where the
keys are the field names and the values are the
actual fields. Alternatively an error indicating that
the request got canceled can be returned.
Most common return field names are "Name" and of
course "Passphrase".
The dictionary arguments contains field names with
their input parameters.
In case of WISPr credentials requests and if the user
prefers to login through the browser by himself, agent
will have to return a LaunchBrowser error (see below).
Possible Errors: net.connman.Agent.Error.Canceled
net.connman.Agent.Error.LaunchBrowser
dict RequestPeerAuthorization(object peer, dict fields) [experimental]
This method gets called when trying to connect to a
peer or when an incoming peer connection is requested,
for which some extra input is required. In this case,
it will only deal with WPS input as well as accepting
or rejecting an incoming connection.
The return value should be a dictionary where the
keys are the field names and the values are the
actual fields. Alternatively an error indicating that
the request got canceled or rejected can be returned.
The dictionary arguments contains field names with
their input parameters.
Possible Errors: net.connman.Agent.Error.Canceled
net.connman.Agent.Error.Rejected
void Cancel()
This method gets called to indicate that the agent
request failed before a reply was returned.
Fields string Name
The name of a network. This field will be requested
when trying to connect to a hidden network.
array{byte} SSID
This field is an alternative to "Name" for WiFi
networks and can be used to return the exact binary
representation of a network name.
Normally returning the "Name" field is the better
option here.
string Identity
Identity (username) for EAP authentication methods.
string Passphrase
The passphrase for authentication. For example a WEP
key, a PSK passphrase or a passphrase for EAP
authentication methods.
string PreviousPassphrase
The previous passphrase successfully saved, i.e.
which lead to a successfull connection. This field is
provided as an informational argument when connecting
with it does not work anymore, for instance when it
has been changed on the AP. Such argument appears when
a RequestInput is raised after a retry. In case of WPS
association through PIN method: when retrying, the
previous wpspin will be provided.
string WPS
This field requests the use of WPS to get associated.
This is an alternate choice against Passphrase when
requested service supports WPS. The reply can contain
either empty pin, if user wants to use push-button
method, or a pin code if user wants to use the pin
method.
In case of a RequestPeerAuthorization, this field will
be set as mandatory.
string Username
Username for WISPr authentication. This field will be
requested when connecting to a WISPr-enabled hotspot.
string Password
Password for WISPr authentication. This field will be
requested when connecting to a WISPr-enabled hotspot.
Arguments string Type
Contains the type of a field. For example "psk", "wep"
"passphrase", "response", "ssid", "wpspin" or plain
"string".
string Requirement
Contains the requirement option. Valid values are
"mandatory", "optional", "alternate" or
"informational".
The "alternate" value specifies that this field can be
returned as an alternative to another one. An example
would be the network name or SSID.
All "mandatory" fields must be returned, while the
"optional" can be returned if available.
Nothing needs to be returned for "informational", as it
is here only to provide an information so a value is
attached to it.
array{string} Alternates
Contains the list of alternate field names this
field can be represented by.
string Value
Contains data as a string, relatively to an
"informational" argument.
Examples Requesting a passphrase for WPA2 network
RequestInput("/service1",
{ "Passphrase" : { "Type" : "psk",
"Requirement" : "mandatory"
}
}
==> { "Passphrase" : "secret123" }
Requesting a passphrase after an error on the previous one:
RequestInput("/service1",
{ "Passphrase" : { "Type" : "psk",
"Requirement" : "mandatory"
},
"PreviousPassphrase" :
{ "Type" : "psk",
"Requirement : "informational",
"Value" : "secret123"
}
}
Requesting name for hidden network
RequestInput("/service2",
{ "Name" : { "Type" : "string",
"Requirement" : "mandatory",
"Alternates" : [ "SSID" ]
},
"SSID" : { "Type" : "ssid",
"Requirement" : "alternate"
}
}
==> { "Name" : "My hidden network" }
Requesting a passphrase for a WPA2 network with WPS alternative:
RequestInput("/service3",
{ "Passphrase" : { "Type" : "psk",
"Requirement" : "mandatory",
"Alternates" : [ "WPS" ]
},
"WPS" : { "Type" : "wpspin",
"Requirement" : "alternate"
}
}
==> { "WPS" : "123456" }
Requesting a passphrase for a WPA2 network with WPS alternative
after an error on the previous one:
RequestInput("/service3",
{ "Passphrase" : { "Type" : "psk",
"Requirement" : "mandatory",
"Alternates" : [ "WPS" ]
},
"WPS" : { "Type" : "wpspin",
"Requirement" : "alternate"
}
"PreviousPassphrase" :
{ "Type" : "wpspin",
"Requirement : "informational",
"Value" : "123456"
}
Requesting passphrase for a WPA-Enterprise network:
RequestInput("/service4",
{ "Identity" : { "Type" : "string",
"Requirement" : "mandatory"
},
"Passphrase" : { "Type" : "passphrase",
"Requirement" : "mandatory"
}
}
==> { "Identity" : "alice", "Passphrase": "secret123" }
Requesting challenge response for a WPA-Enterprise network:
RequestInput("/service4",
{ "Identity" : { "Type" : "string",
"Requirement" : "mandatory"
},
"Passphrase" : { "Type" : "response",
"Requirement" : "mandatory"
}
}
==> { "Identity" : "bob", "Passphrase": "secret123" }
Requesting username and password for a WISPr-enabled hotspot:
RequestInput("/service5",
{ "Username" : { "Type" : "string",
"Requirement" : "mandatory"
},
"Password" : { "Type" : "passphrase",
"Requirement" : "mandatory"
}
}
==> { "Username" : "foo", "Password": "secret" }
Requesting a answer about an inconming peer connection:
RequestPeerAuthorization("/peer3", {})
==> { }
Requesting the WPS details when connecting to a peer:
RequestPeerAuthorization("/peer4",
{ "WPS":
{ "Type" : "wpspin",
"Requirement" : "mandatory"
}
}
==> { "WPS" : "" }
@@ -0,0 +1,28 @@
ConnMan backtraces
******************
ConnMan dumps backtraces upon segmentation faults, bus errors and other
crashing signals. Regardless of the debug level you started connmand with, the
backtrace will be dumped to syslog.
The ConnMan backtraces start with the following line:
-------- backtrace --------
and will try to display function names if those can be resolved from the stack
addresses. All static functions name will not appear for example.
For a more complete and useful stack frame output you can use the
test/backtrace script. It takes the actual binary that crashed and the
connmand logs. The logs can contain any connman debug strings on top of the
backtrace.
Here is an example of the backtrace script usage:
me@localhost:[~]$ backtrace /sbin/connmand connman.log
-------- backtrace --------
[0]: __connman_debug_list_available() [log.c:117]
[1]: connman_driver_register() [element.c:515]
[2]: __connman_driver_rescan() [element.c:490]
[3]: disable_technology() [manager.c:391]
[4]: generic_message() [object.c:262]
-----------------------------------
@@ -0,0 +1,11 @@
Interface behavior description
******************************
Ethernet service
================
The Ethernet based service is a special case since it has no children, but
still can be manually connected and disconnected while also has an implicit
behavior when physically plugging in or removing an Ethernet cable.
@@ -0,0 +1,87 @@
Clock hierarchy
===============
Service net.connman
Interface net.connman.Clock
Object path /
Methods dict GetProperties() [experimental]
Returns all system clock properties. See the
properties section for available properties.
Possible Errors: [service].Error.InvalidArguments
void SetProperty(string name, variant value) [experimental]
Changes the value of the specified property. Only
properties that are listed as read-write are
changeable. On success a PropertyChanged signal
will be emitted.
Possible Errors: [service].Error.InvalidArguments
[service].Error.InvalidProperty
Signals PropertyChanged(string name, variant value) [experimental]
This signal indicates a changed value of the given
property.
Properties uint64 Time [readonly or readwrite] [experimental]
Current system time in seconds since epoch.
This value is present for changing the system time
if TimeUpdates is set to manual.
It is not present for driving an updated display
of the system time. PropertyChanged signal for this
value are only send out if it gets changed or jumps
unexpectedly.
In general application interested in the current
time should be using gettimeofday() and related
system calls.
string TimeUpdates [readwrite] [experimental]
Possible values are "manual" and "auto" to indicate
time update policy.
With the "auto" setting the system tries to use as
many sources as possible to determine the correct
and updated time.
string Timezone [readonly or readwrite] [experimental]
Current system timezone string. Allowed values
are from the standard timezone data (tzdata)
package under /usr/share/zoneinfo. For example
strings like "America/Vancouver" or "Europe/Berlin".
This value is present for changing the timezone
if TimezoneUpdates is set to manual.
When the timezone gets changed a PropertyChanged
signal will be send out.
string TimezoneUpdates [readwrite] [experimental]
Possible values are "manual" and "auto" to indicate
timezone update policy.
With the "auto" setting the system tries to use as
many sources as possible to determine the correct
timezone.
array{string} Timeservers [readwrite] [experimental]
List of global default NTP servers. The list should
be sorted in order of preference.
If a service configuration provides NTP servers,
then they are preferred over the global ones.
This list of servers is used when TimeUpdates is set
to auto.
@@ -0,0 +1,344 @@
Every project has its coding style, and ConnMan is not an exception. This
document describes the preferred coding style for ConnMan code, in order to keep
some level of consistency among developers so that code can be easily
understood and maintained, and also to help your code survive under
maintainer's fastidious eyes so that you can get a passport for your patch
ASAP.
First of all, ConnMan coding style must follow every rule for Linux kernel
(http://www.kernel.org/doc/Documentation/CodingStyle). There also exists a tool
named checkpatch.pl to help you check the compliance with it. Just type
"checkpatch.pl --no-tree patch_name" to check your patch. In theory, you need
to clean up all the warnings and errors except this one: "ERROR: Missing
Signed-off-by: line(s)". ConnMan does not used Signed-Off lines, so including
them is actually an error. In certain circumstances one can ignore the 80
character per line limit. This is generally only allowed if the alternative
would make the code even less readable.
Besides the kernel coding style above, ConnMan has special flavors for its own.
Some of them are mandatory (marked as 'M'), while some others are optional
(marked as 'O'), but generally preferred.
M1: Blank line before and after an if/while/do/for statement
============================================================
There should be a blank line before if statement unless the if is nested and
not preceded by an expression or variable declaration.
Example:
1)
a = 1;
if (b) { // wrong
2)
a = 1
if (b) {
}
a = 2; // wrong
3)
if (a) {
if (b) // correct
4)
b = 2;
if (a) { // correct
}
b = 3;
The only exception to this rule applies when a variable is being allocated:
array = g_try_new0(int, 20);
if (!array) // Correct
return;
M2: Multiple line comment
=========================
If your comments have more then one line, please start it from the second line.
Example:
/*
* first line comment // correct
* ...
* last line comment
*/
M3: Space before and after operator
===================================
There should be a space before and after each operator.
Example:
a + b; // correct
M4: Wrap long lines
===================
If your condition in if, while, for statement or a function declaration is too
long to fit in one line, the new line needs to be indented not aligned with the
body.
Example:
1)
if (call->status == CALL_STATUS_ACTIVE ||
call->status == CALL_STATUS_HELD) { // wrong
connman_dbus_dict_append();
2)
if (call->status == CALL_STATUS_ACTIVE ||
call->status == CALL_STATUS_HELD) { // correct
connman_dbus_dict_append();
3)
gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
enum sim_ust_service index) // wrong
{
int a;
...
}
4)
gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
enum sim_ust_service index) // correct
{
int a;
...
}
If the line being wrapped is a function call or function declaration, the
preferred style is to indent at least past the opening parenthesis. Indenting
further is acceptable as well (as long as you don't hit the 80 character
limit).
If this is not possible due to hitting the 80 character limit, then indenting
as far as possible to the right without hitting the limit is preferred.
Example:
1)
gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
enum sim_ust_service index); // worse
2)
gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
enum sim_ust_service index);
// better
M5: Git commit message 50/72 formatting
=======================================
The commit message header should be within 50 characters. And if you have
detailed explanatory text, wrap it to 72 character.
M6: Space when doing type casting
=================================
There should be a space between new type and variable.
Example:
1)
a = (int *)b; // wrong
2)
a = (int *) b; // correct
M7: Don't initialize variable unnecessarily
===========================================
When declaring a variable, try not to initialize it unless necessary.
Example:
int i = 1; // wrong
for (i = 0; i < 3; i++) {
}
M8: Use g_try_malloc instead of g_malloc
========================================
When g_malloc fails, the whole program would exit. Most of time, this is not
the expected behavior, and you may want to use g_try_malloc instead.
Example:
additional = g_try_malloc(len - 1); // correct
if (!additional)
return FALSE;
M9: Follow the order of include header elements
===============================================
When writing an include header the various elements should be in the following
order:
- #includes
- forward declarations
- #defines
- enums
- typedefs
- function declarations and inline function definitions
M10: Internal headers must not use include guards
=================================================
Any time when creating a new header file with non-public API, that header
must not contain include guards.
M11: Naming of enums
====================
Enums must have a descriptive name. The enum type should be small caps and
it should not be typedef-ed. Enum contents should be in CAPITAL letters and
prefixed by the enum type name.
Example:
enum animal_type {
ANIMAL_TYPE_FOUR_LEGS,
ANIMAL_TYPE_EIGHT_LEGS,
ANIMAL_TYPE_TWO_LEGS,
};
If the enum contents have values (e.g. from specification) the formatting
should be as follows:
enum animal_type {
ANIMAL_TYPE_FOUR_LEGS = 4,
ANIMAL_TYPE_EIGHT_LEGS = 8,
ANIMAL_TYPE_TWO_LEGS = 2,
};
M12: Enum as switch variable
====================
If the variable of a switch is an enum, you must not include a default in
switch body. The reason for this is: If later on you modify the enum by adding
a new type, and forget to change the switch accordingly, the compiler will
complain the new added type hasn't been handled.
Example:
enum animal_type {
ANIMAL_TYPE_FOUR_LEGS = 4,
ANIMAL_TYPE_EIGHT_LEGS = 8,
ANIMAL_TYPE_TWO_LEGS = 2,
};
enum animal_type t;
switch (t) {
case ANIMAL_TYPE_FOUR_LEGS:
...
break;
case ANIMAL_TYPE_EIGHT_LEGS:
...
break;
case ANIMAL_TYPE_TWO_LEGS:
...
break;
default: // wrong
break;
}
However if the enum comes from an external header file outside ConnMan
we cannot make any assumption of how the enum is defined and this
rule might not apply.
M13: Check for pointer being NULL
=================================
When checking if a pointer or a return value is NULL, use the
check with "!" operator.
Example:
1)
array = g_try_new0(int, 20);
if (!array) // Correct
return;
2)
if (!g_at_chat_get_slave(chat)) // Correct
return -EINVAL;
3)
array = g_try_new0(int, 20);
if (array == NULL) // Wrong
return;
M14: Always use parenthesis with sizeof
=======================================
The expression argument to the sizeof operator should always be in
parenthesis, too.
Example:
1)
memset(stuff, 0, sizeof(*stuff));
2)
memset(stuff, 0, sizeof *stuff); // Wrong
M15: Use void if function has no parameters
===========================================================
A function with no parameters must use void in the parameter list.
Example:
1)
void foo(void)
{
}
2)
void foo() // Wrong
{
}
M16: Don't use hex value with shift operators
==============================================
The expression argument to the shift operators should not be in hex.
Example:
1)
1 << y
2)
0x1 << y // Wrong
O1: Shorten the name
====================
Better to use abbreviation, rather than full name, to name a variable,
function, struct, etc.
Example:
supplementary_service // too long
ss // better
O2: Try to avoid complex if body
================================
It's better not to have a complicated statement for if. You may judge its
contrary condition and return | break | continue | goto ASAP.
Example:
1)
if (a) { // worse
struct voicecall *v;
call = synthesize_outgoing_call(vc, vc->pending);
v = voicecall_create(vc, call);
v->detect_time = time(NULL);
DBG("Registering new call: %d", call->id);
voicecall_dbus_register(v);
} else
return;
2)
if (!a)
return;
struct voicecall *v;
call = synthesize_outgoing_call(vc, vc->pending);
v = voicecall_create(vc, call);
v->detect_time = time(NULL);
DBG("Registering new call: %d", call->id);
voicecall_dbus_register(v);
@@ -0,0 +1,155 @@
Connman configuration file format
*********************************
Connman uses configuration files to provision existing services. Connman will
be looking for its configuration files at STORAGEDIR which by default points
to /var/lib/connman/. Configuration file names must not include other
characters than letters or numbers and must have a .config suffix.
Those configuration files are text files with a simple key-value pair format,
organized into sections. Values do not comprise leading or trailing whitespace.
We typically have one file per provisioned network.
If the config file is removed, then Connman tries to remove the
provisioned services. If an individual service inside a config is removed,
then the corresponding provisioned service is removed. If a service section
is changed, then the corresponding service is removed and immediately
re-provisioned.
Global section [global]
=======================
These files can have an optional global section describing the actual file.
The two allowed fields for this section are:
- Name: Name of the network.
- Description: Description of the network.
Service sections [service_*]
============================
Each provisioned service must start with the [service_*] tag. Replace * with
an identifier unique to the config file.
Allowed fields:
- Type: Service type. We currently only support wifi and ethernet.
- IPv4: The IPv4 address, netmask and gateway. Format of the entry
is network/netmask/gateway. The mask length can be used instead
of netmask. The gateway can be omitted if necessary.
The IPv4 field can also contain the string "off" or "dhcp".
If the setting is "off", then no IPv4 address is set to the interface.
If the setting is "dhcp", then DHCPv4 address resolution is activated.
Example: 192.168.1.2/24/192.168.1.1
192.168.200.100/255.255.255.0/192.168.200.1
10.0.0.2/24
- IPv6: The IPv6 address, prefix length and gateway. Format of the entry
is network/prefixlen/gateway. For IPv6 addresses only prefix length is
accepted. The gateway can be omitted if necessary.
The IPv6 field can also contain the string "off" or "auto".
If the setting is "off", then no IPv6 address is set to the interface.
If the setting is "auto", then SLAAC or DHCPv6 is used.
Example: 2001:db8::2/64/2001:db8::1
2001:db8::1:2:3:4/64
- IPv6.Privacy: IPv6 privacy option. Value can be either "disabled",
"enabled" or "preferred" (or the misspelled "prefered"). See use_tempaddr
variable description in Linux kernel Documentation/networking/ip-sysctl.txt
file.
- MAC: MAC address of the interface where this setting should be applied.
The MAC address is optional and if it is missing, then the first found
interface is used. The byte values must have prefix 0 added,
the bytes must be separated by ":" char and its length must be
exactly 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 = 17 characters.
- Nameservers: Comma separated list of nameservers
- SearchDomains: Comma separated list of DNS search domains
- Timeservers: Comma separated list of timeservers
- Domain: Domain name to be used
If IPv4 address is missing then DHCP is used. If IPv6 address is missing,
then SLAAC or DHCPv6 is used.
The following options are valid if Type is "wifi"
- Name: A string representation of an 802.11 SSID. If the SSID field is
present, the Name field is ignored.
- SSID: A hexadecimal representation of an 802.11 SSID. Use this format to
encode special characters including starting or ending spaces. If the SSID
field is omitted, the Name field is used instead.
- EAP: EAP type. We currently only support tls, ttls or peap.
- CACertFile: File path to CA certificate file (PEM/DER).
- ClientCertFile: File path to client certificate file (PEM/DER).
- PrivateKeyFile: File path to client private key file (PEM/DER/PFX).
- PrivateKeyPassphrase: Password/passphrase for private key file.
- PrivateKeyPassphraseType: We only support the fsid passphrase type for now.
This is for private keys generated by using their own filesystem UUID as the
passphrase. The PrivateKeyPassphrase field is ignored when this field is set
to fsid.
- Identity: Identity string for EAP.
- Phase2: Phase2 (inner authentication with TLS tunnel) authentication method.
Prefix the value with "EAP-" to indicate the usage of an EAP-based inner
authentication method (should only be used with EAP = TTLS).
- Passphrase: RSN/WPA/WPA2 Passphrase
- Security: The security type of the network. Possible values are 'psk'
(WPA/WPA2 PSK), 'ieee8021x' (WPA EAP), 'none' and 'wep'. When not set, the
default value is 'ieee8021x' if an EAP type is configured, 'psk' if a
passphrase is present and 'none' otherwise.
- Hidden: If set to true, then this AP is hidden. If missing or set to false,
then AP is not hidden.
Examples
========
This is a configuration file for a network providing EAP-TLS, EAP-TTLS and
EAP-PEAP services. The respective SSIDs are tls_ssid, ttls_ssid and peap_ssid
and the file name is example.config.
Please note that the SSID entry is for hexadecimal encoded SSID (e.g. "SSID =
746c735f73736964"). If your SSID does not contain any exotic character then
you should use the Name entry instead (e.g. "Name = tls_ssid").
example@example:[~]$ cat /var/lib/connman/example.config
[global]
Name = Example
Description = Example network configuration
[service_tls]
Type = wifi
SSID = 746c735f73736964
EAP = tls
CACertFile = /home/user/.certs/ca.pem
ClientCertFile = /home/user/devlp/.certs/client.pem
PrivateKeyFile = /home/user/.certs/client.fsid.pem
PrivateKeyPassphraseType = fsid
Identity = user
[service_ttls]
Type = wifi
Name = ttls_ssid
EAP = ttls
CACertFile = /home/user/.cert/ca.pem
Phase2 = MSCHAPV2
Identity = user
[service_peap]
Type = wifi
Name = peap_ssid
EAP = peap
CACertFile = /home/user/.cert/ca.pem
Phase2 = MSCHAPV2
Identity = user
[service_home_ethernet]
Type = ethernet
IPv4 = 192.168.1.42/255.255.255.0/192.168.1.1
IPv6 = 2001:db8::42/64/2001:db8::1
MAC = 01:02:03:04:05:06
Nameservers = 10.2.3.4,192.168.1.99
SearchDomains = my.home,isp.net
Timeservers = 10.172.2.1,ntp.my.isp.net
Domain = my.home
[service_home_wifi]
Type = wifi
Name = my_home_wifi
Passphrase = secret
IPv4 = 192.168.2.2/255.255.255.0/192.168.2.1
MAC = 06:05:04:03:02:01
@@ -0,0 +1,70 @@
Counter hierarchy
=================
Service unique name
Interface net.connman.Counter
Object path freely definable
Methods void Release()
This method gets called when the service daemon
unregisters the counter. A counter can use it to do
cleanup tasks. There is no need to unregister the
counter, because when this method gets called it has
already been unregistered.
void Usage(object service, dict home, dict roaming)
This signal indicates a change in the counter values
for the service object. The counter is reset by calling
the service ResetCounters method.
When registering a new counter this method will be
called once with all details for "home" and "roaming"
counters filled in. Every further method call will
only include the changed values.
When "home" counter is active, then "roaming" counter
will contain an empty dictionary and vise-versa.
The dictionary argument contains the following entries:
RX.Packets
Total number of packets received.
TX.Bytes
Total number of packets sent.
RX.Bytes
Total number of bytes received.
TX.Bytes
Total number of bytes sent.
RX.Errors
Total number of erronous packets
received.
TX.Errors
Total number of erronous packets
sent.
RX.Dropped
Total number of dropped packets
while receiving.
TX.Dropped
Total number of dropped packets
while sending.
Time
Total number of seconds online.
@@ -0,0 +1,41 @@
IP configuration handling
*************************
IP basics
=========
The core IP handling is designed around network interfaces or more precisely
what the Linux kernel handles as struct net_device. Via RTNL every interface
is tracked and an IP device created for it.
+--------+ +---- eth0 -----+
| | | |
| RTNL +-----+---->| IP device |
| | | | |
+--------+ | +---------------+
|
| +---- wlan0 ----+
| | |
+---->| IP device |
| |
+---------------+
The IP device tracks link configuration, IP address setting and routing
information for that interface. Every IP device also contains a configuration
element. That element contains an operation table for callbacks based on
different events.
struct connman_ipconfig_ops {
void (*up) (struct connman_ipconfig *);
void (*down) (struct connman_ipconfig *);
void (*lower_up) (struct connman_ipconfig *);
void (*lower_down) (struct connman_ipconfig *);
void (*ip_bound) (struct connman_ipconfig *);
void (*ip_release) (struct connman_ipconfig *);
};
All configuration objects created directly by RTNL are tightly bound to the
IP device. They will trigger DHCP or other configuration helpers.
@@ -0,0 +1,300 @@
Manager hierarchy
=================
Service net.connman
Interface net.connman.Manager
Object path /
Methods dict GetProperties()
Returns all global system properties. See the
properties section for available properties.
Possible Errors: [service].Error.InvalidArguments
void SetProperty(string name, variant value)
Changes the value of the specified property. Only
properties that are listed as read-write are
changeable. On success a PropertyChanged signal
will be emitted.
Possible Errors: [service].Error.InvalidArguments
[service].Error.InvalidProperty
array{object,dict} GetTechnologies()
Returns a list of tuples with technology object
path and dictionary of technology properties.
Possible Errors: [service].Error.InvalidArguments
array{object,dict} GetServices()
Returns a sorted list of tuples with service
object path and dictionary of service properties.
This list will not contain sensitive information
like passphrases etc.
Possible Errors: [service].Error.InvalidArguments
array{object,dict} GetPeers() [experimental]
Returns a sorted list of tuples with peer object path
and dictionary of peer properties
Possible Errors: [service].Error.InvalidArguments
object ConnectProvider(dict provider) [deprecated]
Connect to a VPN specified by the given provider
properties.
When successful this method will return the object
path of the VPN service object.
This method can also be used to connect to an
already existing VPN.
This method call will only return in case of an
error or when the service is fully connected. So
setting a longer D-Bus timeout might be a really
good idea.
When 'SessionMode' property is enabled, this method
call is disallowed.
This API is deprecated and should not be used.
The VPN configuration API is provided by ConnMan
VPN daemon and user should use that one instead.
Possible Errors: [service].Error.InvalidArguments
void RemoveProvider(object path) [deprecated]
Remove a VPN specified by the object path.
void RegisterAgent(object path)
Register new agent for handling user requests.
Possible Errors: [service].Error.InvalidArguments
void UnregisterAgent(object path)
Unregister an existing agent.
Possible Errors: [service].Error.InvalidArguments
void RegisterCounter(object path, uint32 accuracy, uint32 period) [experimental]
Register a new counter for user notifications.
The accuracy is specified in kilo-bytes and defines
a threshold for counter updates. Together with the
period value it defines how often user space needs
to be updated. The period value is in seconds.
This interface is not meant for time tracking. If
the time needs to be tracked down to the second, it
is better to have a real timer running inside the
application than using this interface.
Also getting notified for every kilo-byte is a bad
choice (even if the interface supports it). Something
like 10 kilo-byte units or better 1 mega-byte seems
to be a lot more reasonable and better for the user.
Possible Errors: [service].Error.InvalidArguments
void UnregisterCounter(object path) [experimental]
Unregister an existing counter.
Possible Errors: [service].Error.InvalidArguments
object CreateSession(dict settings, object notifier) [experimental]
Create a new session for the application. Every
application can create multiple session with
different settings. The settings are described
as part of the session interface.
The notifier allows asynchronous notification about
session specific changes. These changes can be
for online/offline state or IP address changes or
similar things the application is required to
handle.
Every application should at least create one session
to inform about its requirements and it purpose.
void DestroySession(object session) [experimental]
Remove the previously created session.
If an application exits unexpectatly the session
will be automatically destroyed.
object path, dict, fd RequestPrivateNetwork(dict options)
[experimental]
Request a new Private Network, which includes the
creation of a tun/tap interface, and IP
configuration, NAT and IP forwarding on that
interface.
An object path, a dictionnary and a file descriptor
with IP settings are returned.
Possible Errors: [service].Error.InvalidArguments
[service].Error.NotSupported
void ReleasePrivateNetwork(object path) [experimental]
Releases a private network.
Possible Errors: [service].Error.InvalidArguments
void RegisterPeerService(array{byte} specification, boolean master) [experimental]
Registers a local P2P Peer service
If p2p technology is not available, this will raise a
'not supported' error. This behavior does not apply if
such technology is just disabled.
A Peer service belongs to the process that registers
it, thus if that process dies, its Peer services will
be destroyed as well.
"specification" is the TLV formated byte array
describing the WiFi P2P service.
ConnMan will be able to determine in most cases
whether to be the P2P Group Owner or not. If the
service must belong to a group that this device
manages, the "master" property can be set. Do not set
the "master" property unless you are absolutely sure
you know what you are doing.
Possible Errors: [service].Error.InvalidArguments
[service].Error.NotSupported
void UnregisterPeerService(array{byte} specification) [experimental]
Unregisters an existing local P2P Peer service
Possible Errors: [service].Error.InvalidArguments
Signals TechnologyAdded(object path, dict properties)
Signal that is sent when a new technology is added.
It contains the object path of the technology and
also its properties.
TechnologyRemoved(object path)
Signal that is sent when a technology has been removed.
The object path is no longer accessible after this
signal and only emitted for reference.
ServicesChanged(array{object, dict}, array{object})
Signals a list of services that have been changed
via the first array. And a list of service that
have been removed via the second array.
The list of added services is sorted. The dictionary
with the properties might be empty in case none of
the properties have changed. Or only contains the
properties that have changed.
For newly added services the whole set of properties
will be present.
The list of removed services can be empty.
This signal will only be triggered when the sort
order of the service list or the number of services
changes. It will not be emitted if only a property
of the service object changes. For that it is
required to watch the PropertyChanged signal of
the service object.
PeersChanged(array{object, dict}, array{object}) [experimental]
Signals a list of peers that have been changed via the
first array. And a list of peer that have been removed
via the second array.
The list of changed peers is sorted. The dictionary
with the properties might be empty in case none of the
properties have changed. Or only contains the
properties that have changed.
For newly added peers the whole set of properties will
be present.
The list of removed peers can be empty.
This signal will only be triggered when the sort order
of the peer list or the number of peers changes. It
will not be emitted if only a property of the peer
object changes. For that it is required to watch the
PropertyChanged signal of the peer object.
PropertyChanged(string name, variant value)
This signal indicates a changed value of the given
property.
Properties string State [readonly]
The global connection state of a system. Possible
values are "offline", "idle", "ready" and "online".
If the device is in offline mode, the value "offline"
indicates this special global state. It can also be
retrieved via the OfflineMode property, but is kept
here for consistency and to differentiate from "idle".
However when OfflineMode property is true, the State
property can still be "idle", "ready" or "online"
since it is possible by the end user to re-enable
individual technologies like WiFi and Bluetooth while
in offline mode.
The states "idle", "ready" and "online" match to
states from the services. If no service is in
either "ready" or "online" state it will indicate
the "idle" state.
If at least one service is in "ready" state and no
service is in "online" state, then it will indicate
the "ready" state.
When at least one service is in "online" state,
this property will indicate "online" as well.
boolean OfflineMode [readwrite]
The offline mode indicates the global setting for
switching all radios on or off. Changing offline mode
to true results in powering down all devices. When
leaving offline mode the individual policy of each
device decides to switch the radio back on or not.
During offline mode, it is still possible to switch
certain technologies manually back on. For example
the limited usage of WiFi or Bluetooth devices might
be allowed in some situations.
boolean SessionMode [readwrite] [experminental][deprecated]
This property exists only for compatibility reasons
and does not affect ConnMan in any way.
The default value is false.
@@ -0,0 +1,435 @@
Application programming interface
*********************************
Service basics
==============
Inside Connection Manager there exists one advanced interface to allow the
user interface an easy access to networking details and user chosen
preferences. This is the service list and interface.
The basic idea is that Connection Manager maintains a single flat and sorted
list of all available, preferred or previously used services. A service here
can be either a Ethernet device, a WiFi network or a remote Bluetooth device
(for example a mobile phone).
This list of service is sorted by Connection Manager and there is no need
for the user interface to implement its own sorting. User decisions will
need to be done via Connection Manager and it is then responsible to update
the order of services in this list.
+---------------------------------------+
| Ethernet |
+---------------------------------------+
| Bluetooth phone |
+---------------------------------------+
| Guest (strength 90, none) |
+---------------------------------------+
| My WiFi AP (strength 80, rsn) |
+---------------------------------------+
| Other AP (strength 70, rsn) |
+---------------------------------------+
| Friends AP (strength 70, wep) |
+---------------------------------------+
If none of the services has been used before the sorting order will be done
with these priorities:
1. Ethernet (lower index numbers first)
2. Bluetooth (last used devices first)
3. GSM/UTMS/3G (if SIM card is present, activated and not roaming)
3. WiFi (signal strength first, then more secure network
first)
The Ethernet devices are always sorted first since they are physically built
into the system and will be always present. In cases they are switched off
manually they will not be showing in this list.
Since every Bluetooth device has to be configured/paired first, the user
already made a choice here that these are important. Connection Manager will
only show devices with PAN or DUN profile support. While Bluetooth devices
do have a signal strength, it is mostly unknown since background scanning
in Bluetooth is too expensive. The choice here is to sort the last used
Bluetooth device before the others.
WiFi networks closer in the proximity should be shown first since it is more
likely they are selected. The signal strength value is normalized to 0-100
(effectively a percentage) and allows an easy sorting.
WiFi networks with the same signal strength are then sorted by their security
setting. WPA2 encrypted networks should be preferred over WPA/WEP and also
unencrypted ones. After that they will be sorted by the SSID in alphabetical
order.
In the case the WiFi network uses WPS for setup and it is clearly detectable
that a network waits for Connection Manager to connect to it (for example via
a push-to-connect button press on the AP), then this network should be shown
first before any other WiFi networks. The reason here is that the user already
made a choice via the access point. However this depends on technical details
if it is possible to detect these situations.
Service order
=============
All unused services will have the internal order number of 0 and then will
be sorted according to the rules above. For Bluetooth the user already made
the decision to setup their device and by that means select it. However
until the first connection attempt it might have been setup for total
different reason (like audio usage) and thus it still counts as unused from
a networking point of view.
Selecting the "My WiFi AP" and successfully connecting to it makes it a
favorite device and it will become an order number bigger than 0. All
order numbers are internally. They are given only to service that are marked
as favorite. For WiFi and Bluetooth a successful connection attempt makes
these services automatically a favorite. For Ethernet the plugging of a cable
makes it a favorite. Disconnecting from a network doesn't remove the favorite
setting. It is a manual operation and is equal to users pressing
delete/remove button.
+---------------------------------------+
| My WiFi AP (strength 80, rsn) | order=1 - favorite=yes
+---------------------------------------+
| Ethernet | order=0
+---------------------------------------+
| Guest (strength 90, none) | order=0
+---------------------------------------+
| |
Ethernet is special here since the unplugging of the network cable will
remove the service from the list
+---------------------------------------+
| Ethernet with cable | order=1 - favorite=yes
+---------------------------------------+
| Guest (strength 90, none) | order=0
+---------------------------------------+
| |
This means that all services with an order > 0 have favorite=yes and all
others have favorite=no setting. The favorite setting is exposed via a
property over the service interface. As mentioned above, the order number
is only used internally.
Within Connection Manager many services can be connected at the same time and
also have an IP assignment. However only one can have the default route. The
service with the default route will always be sorted at the top of the
list.
+---------------------------------------+
| Ethernet | order=2 - connected=yes
+---------------------------------------+
| My WiFi AP (strength 80, rsn) | order=1 - connected=yes
+---------------------------------------+
| Guest (strength 90, none) | order=0
+---------------------------------------+
| |
To change the default connection to your access point, the user needs to
manually drag the access point service to the top of the list. Connection
Manager will not take down default routes if there is no reason to do so.
A working connection is considered top priority.
+---------------------------------------+
| My WiFi AP (strength 80, rsn) | order=2 - connected=yes
+---------------------------------------+
| Ethernet | order=1 - connected=yes
+---------------------------------------+
| Guest (strength 90, none) | order=0
+---------------------------------------+
| |
Another possible user interaction would be to disconnect the Ethernet service
and in this case the service falls back down in the list.
+---------------------------------------+
| My WiFi AP (strength 80, rsn) | order=1 - connected=yes
+---------------------------------------+
| Ethernet | order=1 - connected=no
+---------------------------------------+
| Guest (strength 90, none) | order=0
+---------------------------------------+
| |
If the service on the top of the list changes the default route will be
automatically adjusted as needed. The user can trigger this by disconnecting
from a network, if the network becomes unavailable (out of range) or if the
cable gets unplugged.
As described above, the pure case of disconnecting from a network will not
remove the favorite setting. So previously selected networks are still present
and are sorted above all others.
+---------------------------------------+
| Ethernet | order=2 - connected=yes
+---------------------------------------+
| My WiFi AP (strength 80, rsn) | order=1 - connected=no
+---------------------------------------+
| Guest (strength 90, none) | order=0
+---------------------------------------+
| |
Unplugging the Ethernet cable will remove the Ethernet service.
+---------------------------------------+
| My WiFi AP (strength 80, rsn) | order=1 - connected=no
+---------------------------------------+
| Guest (strength 90, none) | order=0
+---------------------------------------+
| |
Service tweaks
==============
The interfaces of Connection Manager will always export all services that are
currently known. The Ethernet devices with no cable plugged are actually not
included in this list. They will only show up once a carrier is detected.
The service interface is not meant for basic device configuration task. So
switching a device on and off (via RFKILL for example) should be done via
the technology interface. See "Technology interfaces" chapter in this document.
Due to limited screen size of small devices and the big amount of WiFi
access points that are deployed right now it might be sensible to not show
certain WiFi networks in the user interface.
The choice to hide a WiFi network from the user interface should be purely
done by the signal strength. The optimal cut-off value here still has to be
determined, but in the end that is a user interface policy.
Service naming
==============
Every service will have a name property that allows the user interface to
display them directly. All names will be already converted into UTF-8. It
derives from the netork details.
In case of WiFi this will be the SSID value. The SSID is a binary array and
will be converted into printable form. Unprintable characters are replaced
with spaces.
In addition to WiFi naming, WiFi networks are subject to a grouping policy
performed around SSID and security type. This means that one service will be
seen for N WiFi networks providing the same SSID and the same security metod.
For instance, if 5 APs are servicing an SSID called "TEST" with WPA2
authentication and 3 APs are servicing the same SSID with open authentication
method, the user will see only two services listed with the name "TEST"
differentiated by their security type, which are "psk" and "none". Such
policy is also applied to hidden networks, where hidden services will have an
empty name and will be differentiated by the security type. The user has then
to select the one with the right security and the Agent API will request any
required information such as the SSID for the network (See "Application
basics" below).
For Bluetooth the device alias is used. The alias is different since it
can be overwritten by the user via the Bluetooth service. The identification
is still done based on its address, but the display name might change. In
most cases the alias is equal to the Bluetooth remote friendly name.
For Ethernet device no name will be provided. The type property will indicate
that this service is Ethernet and then it is up to the user interface to
provide a proper localized name for it.
Service states
==============
Every service can have multiple states that indicate what is currently
going on with it. The choice to have multiple states instead of a simple
connected yes/no value comes from the fact that it is important to let the
user interface name if a service is in process of connecting/disconnecting.
The basic state of every service is "idle". This means that this service
is not in use at all at the moment. It also is not attempting to connect
or do anything else.
The "association" state indicates that this service tries to establish a
low-level connection to the network. For example associating/connecting
with a WiFi access point.
With the "configuration" state the service indicates that it is trying
to retrieve/configure IP settings.
The "ready" state signals a successful connected device. This doesn't mean
it has the default route, but basic IP operations will succeed.
With the "disconnect" state a service indicates that it is going to terminate
the current connection and will return to the "idle" state.
In addition a "failure" state indicates a wrong behavior. It is similar to
the "idle" state since the service is not connected.
+---------------+
| idle |<-------------------------------+
+---------------+ |
| |
| +-------------+ |
+----------------------| failure | |
| service.Connect() +-------------+ |
V A |
+---------------+ | |
| association |-----------------+ |
+---------------+ error | |
| | |
| success | |
V | |
+---------------+ | |
| configuration |-----------------+ |
+---------------+ error |
| |
| success |
V |
+---------------+ |
| ready | |
+---------------+ |
| |
| success |
| |
V |
+---------------+ |
| online |<----------------+ |
+---------------+ | |
| | |
| service.Disconnect() | |
V | |
+---------------+ | |
| disconnect |-----------------+ |
+---------------+ error |
| |
+------------------------------------------+
The different states should no be used by the user interface to trigger
advanced actions. The state transitions are provided for the sole purpose
to give the user feedback on what is currently going on. Especially in
cases where networks are flaky or DHCP servers take a long time these
information are helpful for the user.
Some services might require special authentication procedure like a web
based confirmation. The LoginRequired property should be used to check
for this.
Application basics
==================
All applications should use D-Bus to communicate with Connection Manager. The
main entry point is the manager object. Currently the manager object is
located at "/", but this might change to allow full namespacing of the API
in the future. The manager interface is documented in manager-api.txt and
contains a set of global properties and methods.
A simple way to retrieve all global properties looks like this:
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object("net.connman", "/"),
"net.connman.Manager")
properties = manager.GetProperties()
Changing a global property is also pretty simple. For example enabling the
so called offline mode (aka flight mode) it is enough to just set that
property:
manager.SetProperty("OfflineMode", dbus.Boolean(1))
The manager object contains references to profiles, devices, services and
connections. All these references represent other interfaces that allow
detailed control of Connection Manager. The profiles and devices interfaces
are more for advanced features and most applications don't need them at all.
The services are represented as a list of object paths. Every of these object
paths contains a service interface. A service is a global collection for
Ethernet devices, WiFi networks, Bluetooth services etc. and all these
different types are treated equally.
Every local Ethernet card will show up as exactly one service. WiFi networks
will be grouped by SSID, mode and security setting. Bluetooth PAN and DUN
service will show up per remote device. This creates a simple list that can
be directly displayed to the users since these are the exact details users
should care about.
properties = manager.GetProperties()
for path in properties["Services"]:
service = dbus.Interface(bus.get_object("net.connman", path),
"net.connman.Service")
service_properties = service.GetProperties()
The service interface is documented in service-api.txt and contains common
properties valid for all services. It also contains method to connect or
disconnect a specific service. This allows users to select a specific service.
Connection Manager can also auto-connect services based on his policies or
via external events (like plugging in an Ethernet cable).
Connecting (or disconnecting) a specific service manually is as simple as
just telling it to actually connect:
service.Connect() or service.Disconnect()
It is possible to connect multiple services if the underlying technology
allows it. For example it would be possible to connect to a WiFi network
and a Bluetooth service at the same time. Trying to connect to a second WiFi
network with the same WiFi hardware would result in an automatic disconnect
of the currently connected network. Connection Manager handles all of this
for the applications in the background. Trying to connect an Ethernet service
will result in an error if no cable is plugged in. All connection attempts
can fail for one reason or another. Application should be able to handle
such errors and will also be notified of changes via signals.
Connection Manager will interact with an agent via the Agent API to confirm
certain transactions with the user. If Connection Manager needs extra
information, it will ask the user for exactly the information it requires,
i.e. passphrase, network's name (for hidden WiFi networks) and more depending
on the use case (e.g. WPS, EAP). Therefore an application environment using
Connection Manager should implement one dedicated Connection Manager agent
according to the Agent API in order to interact with the user. Please see
agent-api.txt for implementation details.
To monitor the current status of a service the state property can be used. It
gives detailed information about the current progress.
properties = service.GetProperties()
print properties["State"]
All state changes are also sent via the PropertyChanged signal on the
service interface. This allows asynchronous monitoring without having to poll
Connection Manager for changes.
Technology interfaces
=====================
When ConnMan is started first time, all technologies except ethernet are
powered off by default. The reason is that the user needs to decide which
technologies are relevant to him and what bearers the user wants to use.
User can use the Technology Powered property to turn on or off a given
technology. See doc/technology-api.txt document for details.
User can activate offline (flight) mode via Manager OfflineMode property.
While in offline mode, all the technologies including ethernet are
powered off. During the offline mode, the user can temporarily activate
individual technologies by using the Technology Powered property or by
using the rfkill command or Fn-Fx key combination found in some laptops.
If the host supports rfkill switch, then all the radios can be turned off
by the kernel when the switch is activated. ConnMan will notice this and
remove corresponding technologies from D-Bus. Technologies cannot be
activated while rfkill switch is turned on. When rfkill switch is turned
off (radios are activated), then ConnMan restores the original Powered
status for each activated technology.
User can use the rfkill command from command line or indirectly via
some UI component to activate/deactivate individual radios found in
the host. ConnMan will listen these rfkill events and set the Powered
property accordingly. ConnMan will not save the rfkill status it has
received. This means that after restarting ConnMan, the original and
saved technology status is used when deciding which technologies should
be powered. If the user uses the Technology D-Bus API to set the Powered
property, then that information is saved and used when ConnMan is restarted.
+64
View File
@@ -0,0 +1,64 @@
Peer hierarchy [EXPERIMENTAL]
=============================
Service net.connman
Interface net.connman.Peer
Object path [variable prefix]/{peer0,peer1,...}
Methods dict GetProperties() [deprecated]
Returns properties for the peer object. See the
properties sections for available properties.
Usage of this method is highly discouraged. Use
the Manager.GetPeers() method instead.
Possible Errors: [service].Error.InvalidArguments
void Connect() [experimental]
Connect this peer.
This method call will only return in case of an error
or when the peer is fully connected. So setting a
longer D-Bus timeout might be a really good idea.
Possible Errors: [service].Error.InvalidArguments
void Disconnect() [experimental]
Disconnect this peer. If the peer is not connected, an
error message will be generated.
Possible Errors: [service].Error.InvalidArguments
Signals PropertyChanged(string name, variant value) [experimental]
This signal indicates a changed value of the given
property.
Properties string State [readonly] [experimental]
The peer state information.
Valid state are "idle", "failure", "association",
"configuration", "ready" and "disconnect".
string Name [readonly] [experimental]
Name of the peer.
dict IPv4 [readonly] [experimental]
string Address [readonly]
The current configured IPv4 address.
string Netmask [readonly]
The current configured IPv4 netmask.
array{array{byte}} Services [readonly] [experimental]
Array of P2P service specifications, which are
themselves a TLV formated byte array.
+164
View File
@@ -0,0 +1,164 @@
Plugin programming interface
****************************
Plugin basics
=============
The Connection Manager supports plugins for various actions. The basic plugin
contains of plugin description via CONNMAN_PLUGIN_DEFINE and also init/exit
callbacks defined through that description.
#include <connman/plugin.h>
static int example_init(void)
{
return 0;
}
static void example_exit(void)
{
}
CONNMAN_PLUGIN_DEFINE(example, "Example plugin", CONNMAN_VERSION,
example_init, example_exit)
Infrastructure for plugins
==========================
The Connection Manager provides a very good infrastructure for plugins to
interface with the core functionalities of ConnMan. The infrastructure is
well divided into the concepts of Technology, Device and Network, among
others.
Technology infrastructure
=========================
A Technology in ConnMan is an abstract representation of the different
kinds of technologies it supports such as WiFi, Ethernet, Bluetooth and
Celullar. The technologies support are added to ConnMan through plugins, such
as plugins/bluetooth.c for the Bluetooth Technology or plugins/wifi.c for the
WiFi Technology. Each new technology plugin needs to register itself as a
Technology with ConnMan. As an example we will take a look at the Bluetooth
plugin registration. As a first step 'struct connman_technology_driver' needs
to be defined:
static struct connman_technology_driver tech_driver = {
.name = "bluetooth",
.type = CONNMAN_SERVICE_TYPE_BLUETOOTH,
.probe = bluetooth_tech_probe,
.remove = bluetooth_tech_remove,
.set_tethering = bluetooth_tech_set_tethering,
};
More functions can be defined depending on the purpose of the plugin. All
vtable's supported functions can be seen in include/technology.h. If a
completely new technology type is added 'enum connman_service_type' in
include/service.h needs to be extended accordingly. This inclusion comes in
the form of Service because ultimately a new technology introduces a new
Service. New technologies can also reuse existing Services types.
To make the Connection Manager aware of the new Technology plugin we need to
register its driver by calling 'connman_technology_driver_register()' in the
plugin initialization function, bluetooth_init() in this example:
connman_technology_driver_register(&tech_driver);
In this document the error check is supressed for the sake of simplicity.
All plugins should check return values in driver registration functions.
After this call ConnMan becomes aware of the new Technology plugin and will
call the probe() method when the new technology is recognized by the system. For
the Bluetooth plugin for example probe() would be called when a Bluetooth
adapter is recognized. A Technology is only probed if there exists at least
one device of such technology plugged into the system.
Complementary, the technology must be unregistered on the plugin exit function
through 'connman_technology_driver_unregister()'.
Device infrastructure
=====================
A Device represents a real device of a given Technology, there could be many
devices per technology. To enable ConnMan to handle Devices a device driver
needs to be registered. Using the Bluetooth plugin as example it would have to
define a 'struct connman_device_driver':
static struct connman_device_driver device_driver = {
.name = "bluetooth",
.type = CONNMAN_DEVICE_TYPE_BLUETOOTH,
.probe = bluetooth_device_probe,
.remove = bluetooth_device_remove,
.enable = bluetooth_device_enable,
.disable = bluetooth_device_disable,
};
And to register the driver:
connman_device_driver_register(&device_driver);
'connman_device_driver_register()' is called during the plugin initialization
process, not necessarily at the plugin init function.
In this document the error check is supressed for the sake of simplicity.
All plugins should check return values in driver registration functions.
Additionally code to handle the detection of new devices needs to be written
for each plugin, the bluetooth plugin does so by registering watchers for the
BlueZ D-Bus interface. Once a new Bluetooth Device appears the plugin needs to
notify ConnMan core by calling connman_device_create(), for the bluetooth
plugin the call would be:
struct connman_device *device;
device = connman_device_create("bluetooth",
CONNMAN_DEVICE_TYPE_BLUETOOTH)
ConnMan core will then register the bluetooth device as a Device entity and
call the probe() function from the bluetooth plugin device driver. If a
Technology entity for the Device type doesn't exist it will be created and
Technology probe() function in the bluetooth technology driver is called.
For the Bluetooth plugin a Device represents the local Bluetooth Adapter
plugged in the system.
To learn how to use the connman_device_*() functions such as
connman_device_set_powered() and connman_device_ref() see src/device.c for
its API documentation.
Network infrastructure
======================
The Connection Manager provides a mean to plugins handle the specifics of
establishing/handling a connection for each type of Technology. For the
bluetooth plugin a connman_network_driver needs to be registered:
static struct connman_network_driver network_driver = {
.name = "bluetooth",
.type = CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN,
.probe = bluetooth_pan_probe,
.remove = bluetooth_pan_remove,
.connect = bluetooth_pan_connect,
.disconnect = bluetooth_pan_disconnect,
};
And then call the register function:
connman_network_driver_register(&network_driver);
In this document the error check is supressed for the sake of simplicity.
All plugins should check return values in driver registration functions.
The next step would be the probe of a Network entity, for the bluetooth
plugin this would happen when a new device that supports the PAN NAP role is
paired with the system. ConnMan then call connman_device_add_network() to
associate the new Network with the existing Device entity (the local Bluetooth
Adapter).
Then in the vtable's connect method all the needed pieces to perform a
connection shall be perfomed.
To learn how to use the connman_network_*() functions such as
connman_network_set_index() and connman_network_set_connected() see
src/network.c for its API documentation.
@@ -0,0 +1,494 @@
Service hierarchy
=================
Service net.connman
Interface net.connman.Service
Object path [variable prefix]/{service0,service1,...}
Methods dict GetProperties() [deprecated]
Returns properties for the service object. See
the properties section for available properties.
Usage of this method is highly discouraged. Use
the Manager.GetServices() method instead.
Possible Errors: [service].Error.InvalidArguments
void SetProperty(string name, variant value)
Changes the value of the specified property. Only
properties that are listed as read-write are
changeable. On success a PropertyChanged signal
will be emitted.
Properties cannot be set for hidden WiFi service
entries or provisioned services.
Possible Errors: [service].Error.InvalidArguments
[service].Error.InvalidProperty
void ClearProperty(string name)
Clears the value of the specified property.
Properties cannot be cleared for hidden WiFi service
entries or provisioned services.
Possible Errors: [service].Error.InvalidArguments
[service].Error.InvalidProperty
void Connect()
Connect this service. It will attempt to connect
WiFi or Bluetooth services.
For Ethernet devices this method can only be used
if it has previously been disconnected. Otherwise
the plugging of a cable will trigger connecting
automatically. If no cable is plugged in this method
will fail.
This method call will only return in case of an
error or when the service is fully connected. So
setting a longer D-Bus timeout might be a really
good idea.
Calling Connect() on a hidden WiFi service entry will
query the missing SSID via the Agent API causing a
WiFi service with the given SSID to be scanned,
created and connected.
Possible Errors: [service].Error.InvalidArguments
void Disconnect()
Disconnect this service. If the service is not
connected an error message will be generated.
On Ethernet devices this will disconnect the IP
details from the service. It will not magically
unplug the cable. When no cable is plugged in this
method will fail.
This method can also be used to abort a previous
connection attempt via the Connect method.
Hidden WiFi service entries cannot be disconnected
as they always stay in idle state.
Possible Errors: [service].Error.InvalidArguments
void Remove()
A successfully connected service with Favorite=true
can be removed this way. If it is connected, it will
be automatically disconnected first.
If the service requires a passphrase it will be
cleared and forgotten when removing.
This is similar to setting the Favorite property
to false, but that is currently not supported.
In the case a connection attempt failed and the
service is in the State=failure, this method can
also be used to reset the service.
Calling this method on Ethernet devices, hidden WiFi
services or provisioned services will cause an error
message. It is not possible to remove these kind of
services.
Possible Errors: [service].Error.InvalidArguments
void MoveBefore(object service)
If a service has been used before, this allows a
reorder of the favorite services.
Possible Errors: [service].Error.InvalidArguments
void MoveAfter(object service)
If a service has been used before, this allows a
reorder of the favorite services.
Possible Errors: [service].Error.InvalidArguments
void ResetCounters() [experimental]
Reset the counter statistics.
Possible Errors: None
Signals PropertyChanged(string name, variant value)
This signal indicates a changed value of the given
property.
Properties string State [readonly]
The service state information.
Valid states are "idle", "failure", "association",
"configuration", "ready", "disconnect" and "online".
The "ready" state signals a successfully
connected device. "online" signals that an
Internet connection is available and has been
verified.
See doc/overview-api.txt for more information about
state transitions.
string Error [readonly]
The service error status details.
When error occur during connection or disconnection
the detailed information is represented in this
property to help the user interface to present the
user with alternate options.
This property is only valid when the service is in
the "failure" state. Otherwise it might be empty or
not present at all.
Current defined error code is "dhcp-failed".
string Name [readonly]
The service name (for example "Wireless" etc.)
This name can be used for directly displaying it in
the application. It has pure informational purpose
and no attempt should be made to translate it.
For Ethernet devices and hidden WiFi networks this
property is not present.
string Type [readonly]
The service type (for example "ethernet", "wifi" etc.)
This information should only be used to determine
advanced properties or showing the correct icon
to the user.
Together with a missing Name property, this can
be used to identify hidden WiFi networks.
array{string} Security [readonly]
If the service type is WiFi, then this property is
present and contains the list of security methods
or key management settings.
Possible values are "none", "wep", "psk", "ieee8021x"
and also "wps".
This property might be only present for WiFi
services.
uint8 Strength [readonly]
Indicates the signal strength of the service. This
is a normalized value between 0 and 100.
This property will not be present for Ethernet
devices.
boolean Favorite [readonly]
Will be true if a cable is plugged in or the user
selected and successfully connected to this service.
This value is automatically changed and to revert
it back to false the Remove() method needs to be
used.
boolean Immutable [readonly]
This value will be set to true if the service is
configured externally via a configuration file.
The only valid operation are Connect() and of
course Disconnect(). The Remove() method will
result in an error.
boolean AutoConnect [readwrite]
If set to true, this service will auto-connect
when no other connection is available.
The service won't auto-connect while roaming.
For favorite services it is possible to change
this value to prevent or permit automatic
connection attempts.
boolean Roaming [readonly]
This property indicates if this service is roaming.
In the case of Cellular services this normally
indicates connections to a foreign provider when
traveling abroad.
array{string} Nameservers [readonly]
The list of currently active nameservers for this
service. If the server is not in READY or ONLINE
state than this list will be empty.
Global nameservers are automatically added to this
list. The array represents a sorted list of the
current nameservers. The first one has the highest
priority and is used by default.
When using DHCP this array represents the nameservers
provided by the network. In case of manual settings,
the ones from Nameservers.Configuration are used.
array{string} Nameservers.Configuration [readwrite]
The list of manually configured domain name
servers. Some cellular networks don't provide
correct name servers and this allows for an
override.
This array is sorted by priority and the first
entry in the list represents the nameserver with
the highest priority.
When using manual configuration and no global
nameservers are configured, then it is useful
to configure this setting.
Changes to the domain name servers can be done
at any time. It will not cause a disconnect of
the service. However there might be small window
where name resolution might fail.
array{string} Timeservers [readonly]
The list of currently active timeservers for this
service. If the server is not in READY or ONLINE
state than this list will be empty.
array{string} Timeservers.Configuration [readwrite]
The list of manually configured time servers.
The first entry in the list represents the
timeserver with the highest priority.
When using manual configuration this setting
is useful to override all the other timeserver
settings. This is service specific, hence only
the values for the default service are used.
Changes to this property will result in restart
of NTP query.
array{string} Domains [readonly]
The list of currently used search domains taken
from Domains.Configurations if set, otherwise a
domain name if provided by DHCP or VPNs.
array{string} Domains.Configuration [readwrite]
The list of manually configured search domains.
dict IPv4 [readonly]
string Method [readonly]
Possible values are "dhcp", "manual"
and "off".
The value "fixed" indicates an IP address
that can not be modified. For example
cellular networks return fixed information.
string Address [readonly]
The current configured IPv4 address.
string Netmask [readonly]
The current configured IPv4 netmask.
string Gateway [readonly]
The current configured IPv4 gateway.
dict IPv4.Configuration [readwrite]
Same values as IPv4 property. The IPv4 represents
the actual system configuration while this allows
user configuration.
Changing these settings will cause a state change
of the service. The service will become unavailable
until the new configuration has been successfully
installed.
dict IPv6 [readonly]
string Method [readonly]
Possible values are "auto", "manual", "6to4"
and "off".
The value "fixed" indicates an IP address
that can not be modified. For example
cellular networks return fixed information.
The value "6to4" is returned if 6to4 tunnel
is created by connman. The tunnel can only be
created if method was set to "auto" by the
user. User cannot set the method to "6to4".
string Address [readonly]
The current configured IPv6 address.
uint8 PrefixLength [readonly]
The prefix length of the IPv6 address.
string Gateway [readonly]
The current configured IPv6 gateway.
string Privacy [readonly]
Enable or disable IPv6 privacy extension
that is described in RFC 4941. The value
has only meaning if Method is set to "auto".
Value "disabled" means that privacy extension
is disabled and normal autoconf addresses are
used.
Value "enabled" means that privacy extension is
enabled and system prefers to use public
addresses over temporary addresses.
Value "prefered" means that privacy extension is
enabled and system prefers temporary addresses
over public addresses.
Default value is "disabled".
dict IPv6.Configuration [readwrite]
Same values as IPv6 property. The IPv6 represents
the actual system configuration while this allows
user configuration.
Changing these settings will cause a state change
of the service. The service will become unavailable
until the new configuration has been successfully
installed.
dict Proxy [readonly]
string Method [readonly]
Possible values are "direct", "auto" and
"manual".
In case of "auto" method, the URL file can be
provided unless you want to let DHCP/WPAD
auto-discover to be tried. In such case if DHCP
and WPAD auto-discover methods fails then
method will be "direct".
In case of "direct" no additional information
are provided. For the "manual" method the
Servers have to be set, Excludes is optional.
string URL [readonly]
Automatic proxy configuration URL. Used by
"auto" method.
array{string} Servers [readonly]
Used when "manual" method is set.
List of proxy URIs. The URI without a protocol
will be interpreted as the generic proxy URI.
All others will target a specific protocol and
only once.
Example for generic proxy server entry would
be like this: "server.example.com:911".
array{string} Excludes [readonly]
Used when "manual" method is set.
List of hosts which can be accessed directly.
dict Proxy.Configuration [readwrite]
Same values as Proxy property. The Proxy represents
the actual system configuration while this allows
user configuration.
If "auto" method is set with an empty URL, then
DHCP/WPAD auto-discover will be tried. Otherwise the
specified URL will be used.
dict Provider [readonly]
string Host [readonly]
VPN host IP.
string Domain [readonly]
VPN Domain.
string Name [readonly]
VPN provider Name.
string Type [readonly]
VPN provider type.
dict Ethernet [readonly]
string Method [readonly]
Possible values are "auto" and "manual".
string Interface [readonly]
Interface name (for example eth0).
string Address [readonly]
Ethernet device address (MAC address).
uint16 MTU [readonly]
The Ethernet MTU (default is 1500).
uint16 Speed [readonly] [deprecated]
Selected speed of the line.
This information is not available.
string Duplex [readonly] [deprecated]
Selected duplex settings of the line.
Possible values are "half" and "full".
This information is not available.
@@ -0,0 +1,184 @@
Service unique name
Interface net.connman.Notification
Object path freely definable
Methods void Release()
This method gets called when the service daemon
unregisters the session. A counter can use it to do
cleanup tasks. There is no need to unregister the
session, because when this method gets called it has
already been unregistered.
void Update(dict settings)
Sends an update of changed settings. Only settings
that are changed will be included.
Initially on every session creation this method is
called once to inform about the current settings.
Service net.connman
Interface net.connman.Session
Object path variable
Methods void Destroy()
Close the current session. This is similar to
DestroySession method on the manager interface. It
is just provided for convenience depending on how
the application wants to track the session.
void Connect()
If not connected, then attempt to connect this
session.
The usage of this method depends a little bit on
the model of the application. Some application
should not try to call Connect on any session at
all. They should just monitor if it becomes online
or gets back offline.
Others might require an active connection right now.
So for example email notification should only check
for new emails when a connection is available. However
if the user presses the button for get email or wants
to send an email it should request to get online with
this method.
Depending on the bearer settings the current service
is used or a new service will be connected.
This method returns immediately after it has been
called. The application is informed through the update
notification about the state of the session.
It is also not guaranteed that a session stays online
after this method call. It can be taken offline at any
time. This might happen because of idle timeouts or
other reasons.
It is safe to call this method multiple times. The
actual usage will be sorted out for the application.
void Disconnect()
This method indicates that the current session does
not need a connection anymore.
This method returns immediately. The application is
informed through the update notification about the
state of the session.
void Change(string name, variant value)
Change the value of certain settings. Not all
settings can be changed. Normally this should not
be needed or an extra session should be created.
However in some cases it makes sense to change
a value and trigger different behavior.
A change of a setting will cause an update notification
to be sent. Some changes might cause the session to
be moved to offline state.
Settings string State [readonly]
This indicates if the connection is disconnected,
connected or online. It is updated according to the
selected ConnectionType. The session will not be
in a useful shape (i.e.: providing a network connection
to the owner) until its State gets updated to connected
and/or online.
This maps to the useful port of the service state.
And it is only valid for the selected bearer
configuration. Otherwise it will be reported as
disconnected even if connected services are present.
In addition the State settings notification might
not happen right away. Notifications of this state
can be delayed based on the speed of the bearer. It
is done to avoid congestion on bearers like cellular
etc.
string Name [readonly]
The Service name to which the system is connected.
It should only be used for displaying it in the UI
and not for getting hold on session object.
string Bearer [readonly]
This indicates the current bearer that is used
for this session. Or an empty string if no bearer
if available.
string Interface [readonly]
Interface name used by the service object to connect.
This name can be used for SO_BINDTODEVICE in the
application.
dict IPv4 [readonly]
Current IPv4 configuration.
dict IPv6 [readonly]
Current IPv6 configuration.
array{string} AllowedBearers [readwrite]
A list of bearers that can be used for this session.
In general this list should be empty to indicate that
any bearer is acceptable.
The order of the entries in AllowedBearers matters.
The services are sorted in the order of the bearer
entries in this list.
Also "*" matches any bearer. This is usefull to prefer
certain bearers such as 'wifi' with a fallback to any
other available bearer.
Invalid bearer names will be ignored and removed
from the list. And empty AllowedBearers will
not match to any bearer, therefore the session
will never go online.
When a session is created and the provided settings
dictionary does not contain AllowedBearers, a default
session with "*" will be created.
string ConnectionType [readwrite]
This is used to indicate which connection is requested
from the session. The state of the session will be
updated accordingly. Values can be 'local',
'internet' or 'any'.
'local' means the session requests to be connected,
but does not require specifically to be online.
Therefore State property will be set to 'connected' if
underlying service gets ready and/or online.
'online' means the session requests to be connected,
and online. State property will never get 'connected'
but instead will switch to 'online' if underlying
service gets online.
'any' means either 'local' or 'internet'.
Invalid values will be ignored and removed. An
empty ConnectionType is an invalid configuration.
When a session is created and the provided settings
dictionary does not contain ConnectionType, a default
session with 'any' will be created.
(This setting will be removed when the unique process
identification problem is solved.)
@@ -0,0 +1,94 @@
Session API
***********
Connection management algorithm basics
======================================
The Session core uses the normal auto-connect algorithm for selecting
which services will be connected or disconnected. That means only
Services with AutoConnect to set to true will be used. The Session
core will assign a connected Service to a Session if the Service
is matching the AllowedBearer filter.
By using the normal auto-connect algorithm, it is possible to
use the Session API and the Service API at the same time.
Session States and Transitions
==============================
There is only one state which is called Free Ride.
The Free Ride state means that a session will go online if a matching
service goes online without calling Service.Connect() itself. The idea
behind this is that a session doesn't request a connection for itself
instead waits until another session actively requires to go online.
This is comparable to piggy-backing.
Connnect()
+------+
| v
+------------+
| Free Ride |
+------------+
| ^
+-----+
Disconnect()
If an application wants to stay offline it can set an empty
AllowedBearers list.
Session application identification
==================================
Application using session can be identified through different means.
- SELinux
- UID
- GID
ConnMan will try to identify the application in the given order above.
If SELinux is not supported by the system or not configured, ConnMan
will ignore it and fallback asking the D-Bus daemon about the UID of
the application.
The identification is only useful in combination with the policy plugin.
Policy Plugin
=============
The policy plugin allows the administrator to provision/configure
sessions. Each policy needs an application identification in order to
match the policy to a session.
See session-policy-format.txt for more details.
Per application routing
=======================
For each session a policy routing table is maintained. Each policy
routing table contains a default route to the selected service.
Per session iptables rules:
iptables -t mangle -A OUTPUT -m owner [--uid-owner|--gid-owner] $OWNER \
-j MARK --set-mark $MARK
Global rules for all sessions:
iptables -t mangle -A INPUT -j CONNMARK --restore-mark
iptables -t mangle -A POSTROUTING -j CONNMARK --save-mark
Per application routing is only available when policy files are
used. Without the policy plugin or a valid configuration, the default
session configuration is applied.
The default session configuration does not enable the per application
routing. Sessions are still useful in this setup, because the
notification of sessions is still available, e.g. the online/offline
notification.
@@ -0,0 +1,83 @@
ConnMan policy file format
**************************
The session policy pluging allows to configure/provision a session.
ConnMan will be looking for policy files in STORAGEDIR/session_policy_local
which by default points to /var/lib/connman. Policy file names must
not include other characters than letters or numbers and must have
a .policy suffix. Policy files are text files.
It is possible to add, remove or update a policy file during run-time.
The corresponding sessions will be updated accordingly.
Policy group [policy_*]
=======================
Each policy group must start with as [policy_*] tag. '*' has no
semantic meaning but should consist just out of characters.
Required fields:
Exactly one and only one of the required fields need to be present
per policy group.
- uid: This policy group will be applied to any session
with given user ID.
- gid: This policy group will be applied to any session
with given group ID.
- selinux: This policy group will be applied to any session
with given SELinux context.
Allowed fields:
- AllowedBearers: see session-api.txt
The policy AllowedBearers overrules the settings done via
D-Bus. For example the policy AllowedBearers is 'ethernet' then
the D-Bus API will only accept an empty string or 'ethernet'.
- ConnectionType: see session-api.txt
The policy ConnectionType overrules the settings done via
D-Bus.
- Priority: A boolean which tells ConnMan to preferred the session
over other Sessions. This priority value is more for application
that want to push themselves up in the asychronization notification
queue once a bearer becomes online.
This actual priority order also depends on the allowed bearers and
other factors. This is setting is just a little indicator of one
application being notified before another one.
- RoamingPolicy: The allowed roaming behavior.
Valid policies are "national", "international", "default", "always"
and "forbidden".
"national" allows roaming within a country. "international" allows
roaming in a country and between countries.
"default" is used to tell the session to use the global roaming
setting.
"always" will overwrite the default "forbidden" value which is
useful for emergency application.
Default value is "forbidden".
- EmergencyCall: A boolean which tells ConnMan whenever the
Connect() method is called for this session, all other
session are disconnected.
Note only services matching the AllowedBearers rule will be
considered.
Example
=======
example@example:[~]$ cat /var/lib/connman/session_policy_local/auser.policy
[policy_auser]
uid = auser
AllowedBearers = wifi cellular
RoamingPolicy = forbidden
@@ -0,0 +1,99 @@
Technology hierarchy
====================
Service net.connman
Interface net.connman.Technology
Object path [variable prefix]/{technology0,technology1,...}
Methods dict GetProperties() [deprecated]
Returns properties for the technology object. See
the properties section for available properties.
Usage of this method is highly discouraged. Use
the Manager.GetTechnologies() method instead.
Possible Errors: [service].Error.InvalidArguments
void SetProperty(string name, variant value)
Changes the value of the specified property. Only
properties that are listed as read-write are
changeable. On success a PropertyChanged signal
will be emitted.
Possible Errors: [service].Error.InvalidArguments
[service].Error.InvalidProperty
void Scan()
Trigger a scan for this specific technology. The
method call will return when a scan has been
finished and results are available. So setting
a longer D-Bus timeout might be a really good
idea.
Results will be signaled via the ServicesChanged
signal from the manager interface.
In case of P2P technology, results will be signaled
via the PeersChanged signal from the manager
interface.
Signals PropertyChanged(string name, variant value)
This signal indicates a changed value of the given
property.
Properties boolean Powered [readwrite]
Boolean representing the power state of the
technology. False means that the technology is
off (and is available RF-Killed) while True means
that the technology is enabled.
boolean Connected [readonly]
Boolean representing if a technology is connected.
This is just a convience property for allowing the
UI to easily show if this technology has an active
connection or not.
If this property is True it means that at least one
service of this technology is in ready state.
string Name [readonly]
Name of this technology.
string Type [readonly]
The technology type (for example "ethernet" etc.)
This information should only be used to determine
advanced properties or showing the correct icon
to the user.
boolean Tethering [readwrite]
This option allows to enable or disable the support
for tethering. When tethering is enabled then the
default service is bridged to all clients connected
through the technology.
string TetheringIdentifier [readwrite]
The tethering broadcasted identifier.
This property is only valid for the WiFi technology,
and is then mapped to the WiFi AP SSID clients will
have to join in order to gain internet connectivity.
string TetheringPassphrase [readwrite]
The tethering connection passphrase.
This property is only valid for the WiFi technology,
and is then mapped to the WPA pre-shared key clients
will have to use in order to establish a connection.
@@ -0,0 +1,158 @@
Agent hierarchy
===============
Service unique name
Interface net.connman.vpn.Agent
Object path freely definable
Methods void Release()
This method gets called when the service daemon
unregisters the agent. An agent can use it to do
cleanup tasks. There is no need to unregister the
agent, because when this method gets called it has
already been unregistered.
void ReportError(object service, string error)
This method gets called when an error has to be
reported to the user.
A special return value can be used to trigger a
retry of the failed transaction.
Possible Errors: net.connman.vpn.Agent.Error.Retry
dict RequestInput(object service, dict fields)
This method gets called when trying to connect to
a service and some extra input is required. For
example a password or username.
The return value should be a dictionary where the
keys are the field names and the values are the
actual fields. Alternatively an error indicating that
the request got canceled can be returned.
Most common return field names are "Username" and of
course "Password".
The dictionary arguments contains field names with
their input parameters.
Possible Errors: net.connman.vpn.Agent.Error.Canceled
void Cancel()
This method gets called to indicate that the agent
request failed before a reply was returned.
Fields string Username
Username for authentication. This field will be
requested when connecting to L2TP and PPTP.
string Password
Password for authentication.
boolean SaveCredentials
Tells if the user wants the user credentials
be saved by connman-vpnd.
string Host
End point of this VPN link i.e., the VPN gateway
we are trying to connect to.
string Name
Name of the VPN connection we are trying to connect to.
string OpenConnect.CACert
Informational field containing a path name for an
additional Certificate Authority file.
string OpenConnect.ClientCert
Informational field containing a pkcs11 URL or a path
name for the client certificate.
string OpenConnect.Cookie
Return the OpenConnect cookie value that is used for
authenticating the VPN session.
string OpenConnect.ServerCert
Return the OpenConnect server hash used to identify
the final server after possible web authentication
logins, selections and redirections.
string OpenConnect.VPNHost
Return the final VPN server to use after possible
web authentication logins, selections and redirections.
Arguments string Type
Contains the type of a field. For example "password",
"response", "boolean" or plain "string".
string Requirement
Contains the requirement option. Valid values are
"mandatory", "optional", "alternate" or
"informational".
The "alternate" value specifies that this field can be
returned as an alternative to another one.
All "mandatory" fields must be returned, while the
"optional" can be returned if available.
Nothing needs to be returned for "informational", as it
is here only to provide an information so a value is
attached to it.
array{string} Alternates
Contains the list of alternate field names this
field can be represented by.
string Value
Contains data as a string, relatively to an
"informational" argument.
Examples Requesting a username and password for L2TP network
RequestInput("/vpn1",
{ "Username" : { "Type" : "string",
"Requirement" : "mandatory"
} }
{ "Password" : { "Type" : "password",
"Requirement" : "mandatory"
} }
{ "SaveCredentials" : { "Type" : "boolean",
"Requirement" : "optional"
}
}
==> { "Username" : "foo", "Password" : "secret123",
"SaveCredentials" : true }
Requesting a OpenConnect cookie
RequestInput("/vpn2",
{ "OpenConnect.Cookie" : { "Type" : "string",
"Requirement" : "mandatory"
} }
{ "Host" : { "Type" : "string",
"Requirement" : "informational"
} }
{ "Name" : { "Type" : "string",
"Requirement" : "informational"
} }
==> { "OpenConnect.Cookie" : "0123456@adfsf@asasdf" }
@@ -0,0 +1,235 @@
Connman configuration file format for VPN
*****************************************
Connman VPN uses configuration files to provision existing providers.
vpnd will be looking for its configuration files at VPN_STORAGEDIR
which by default points to /var/lib/connman-vpn. Configuration file names
must not include other characters than letters or numbers and must have
a .config suffix. Those configuration files are text files with a simple
key-value pair format organized into sections. Values do not comprise leading
trailing whitespace. We typically have one file per provisioned network.
If the config file is removed, then vpnd tries to remove the
provisioned service. If an individual service entry inside a config is removed,
then the corresponding provisioned service is removed. If a service
section is changed, then the corresponding service is removed and immediately
re-provisioned.
Global section [global]
=======================
These files can have an optional global section describing the actual file.
The two allowed fields for this section are:
- Name: Name of the network.
- Description: Description of the network.
Provider section [provider_*]
=============================
Each provisioned provider must start with the [provider_*] tag.
Replace * with an identifier unique to the config file.
Allowed fields:
- Type: Provider type. Value of OpenConnect, OpenVPN, VPNC, L2TP or PPTP
VPN related parameters (M = mandatory, O = optional):
- Name: A user defined name for the VPN (M)
- Host: VPN server IP address (M)
- Domain: Domain name for the VPN service (M)
- Networks: The networks behind the VPN link can be defined here. This can
be missing if all traffic should go via VPN tunnel. If there are more
than one network, then separate them by comma. Format of the entry
is network/netmask/gateway. The gateway can be left out. (O)
Example: 192.168.100.0/24/10.1.0.1,192.168.200.0/255.255.255.0/10.1.0.2
For IPv6 addresses only prefix length is accepted like this 2001:db8::1/64
OpenConnect VPN supports following options (see openconnect(8) for details):
Option name OpenConnect option Description
OpenConnect.ServerCert --servercert SHA1 certificate fingerprint of the
final VPN server after possible web
authentication login, selection and
redirection (O)
OpenConnect.CACert --cafile File containing other Certificate
Authorities in addition to the ones
in the system trust database (O)
OpenConnect.ClientCert --certificate Client certificate file, if needed
by web authentication (O)
VPN.MTU --mtu Request MTU from server as the MTU
of the tunnel (O)
OpenConnect.Cookie --cookie-on-stdin Cookie received as a result of the
web authentication. As the cookie
lifetime can be very limited, it
does not usually make sense to add
it into the configuration file (O)
OpenConnect.VPNHost The final VPN server to use after
completing the web authentication.
Only usable for extremely simple VPN
configurations and should normally
be set only via the VPN Agent API.
If OpenConnect.Cookie or OpenConnect.ServerCert are missing, the VPN Agent will
be contacted to supply the information.
OpenVPN VPN supports following options (see openvpn(8) for details):
Option name OpenVPN option Description
OpenVPN.CACert --ca Certificate authority file (M)
OpenVPN.Cert --cert Local peer's signed certificate (M)
OpenVPN.Key --key Local peer's private key (M)
OpenVPN.MTU --mtu MTU of the tunnel (O)
OpenVPN.NSCertType --ns-cert-type Peer certificate type, value of
either server or client (O)
OpenVPN.Proto --proto Use protocol (O)
OpenVPN.Port --port TCP/UDP port number (O)
OpenVPN.AuthUserPass --auth-user-pass Authenticate with server using
username/password (O)
OpenVPN.AskPass --askpass Get certificate password from file (O)
OpenVPN.AuthNoCache --auth-nocache Don't cache --askpass or
--auth-user-pass value (O)
OpenVPN.TLSRemote --tls-remote Accept connections only from a host
with X509 name or common name equal
to name parameter (O)
OpenVPN.TLSAuth sub-option of --tls-remote (O)
OpenVPN.TLSAuthDir sub-option of --tls-remote (O)
OpenVPN.Cipher --cipher Encrypt packets with cipher algorithm
given as parameter (O)
OpenVPN.Auth --auth Authenticate packets with HMAC using
message digest algorithm alg (O)
OpenVPN.CompLZO --comp-lzo Use fast LZO compression. Value can
be "yes", "no", or "adaptive". Default
is adaptive (O)
OpenVPN.RemoteCertTls --remote-cert-tls Require that peer certificate was
signed based on RFC3280 TLS rules.
Value is "client" or "server" (O)
OpenVPN.ConfigFile --config OpenVPN config file that can contain
extra options not supported by OpenVPN
plugin (O)
VPNC VPN supports following options (see vpnc(8) for details):
Option name VPNC config value Description
VPNC.IPSec.ID IPSec ID your group username (M)
VPNC.IPSec.Secret IPSec secret your group password (cleartext) (O)
VPNC.Xauth.Username Xauth username your username (O)
VPNC.Xauth.Password Xauth password your password (cleartext) (O)
VPNC.IKE.Authmode IKE Authmode IKE Authentication mode (O)
VPNC.IKE.DHGroup IKE DH Group name of the IKE DH Group (O)
VPNC.PFS Perfect Forward Secrecy Diffie-Hellman group to use for PFS (O)
VPNC.Domain Domain Domain name for authentication (O)
VPNC.Vendor Vendor vendor of your IPSec gateway (O)
VPNC.LocalPort Local Port local ISAKMP port number to use
VPNC.CiscoPort Cisco UDP Encapsulation Port Local UDP port number to use (O)
VPNC.AppVersion Application Version Application Version to report (O)
VPNC.NATTMode NAT Traversal Mode Which NAT-Traversal Method to use (O)
VPNC.DPDTimeout DPD idle timeout (our side) Send DPD packet after timeout (O)
VPNC.SingleDES Enable Single DES enables single DES encryption (O)
VPNC.NoEncryption Enable no encryption enables using no encryption for data traffic (O)
L2TP VPN supports following options (see xl2tpd.conf(5) and pppd(8) for details)
Option name xl2tpd config value Description
L2TP.User - L2TP user name, asked from the user
if not set here (O)
L2TP.Password - L2TP password, asked from the user
if not set here (O)
L2TP.BPS bps Max bandwith to use (O)
L2TP.TXBPS tx bps Max transmit bandwith to use (O)
L2TP.RXBPS rx bps Max receive bandwith to use (O)
L2TP.LengthBit length bit Use length bit (O)
L2TP.Challenge challenge Use challenge authentication (O)
L2TP.DefaultRoute defaultroute Default route (O)
L2TP.FlowBit flow bit Use seq numbers (O)
L2TP.TunnelRWS tunnel rws Window size (O)
L2TP.Exclusive exclusive Use only one control channel (O)
L2TP.Redial redial Redial if disconnected (O)
L2TP.RedialTimeout redial timeout Redial timeout (O)
L2TP.MaxRedials max redials How many times to try redial (O)
L2TP.RequirePAP require pap Need pap (O)
L2TP.RequireCHAP require chap Need chap (O)
L2TP.ReqAuth require authentication Need auth (O)
L2TP.AccessControl access control Accept only these peers (O)
L2TP.AuthFile auth file Authentication file location (O)
L2TP.ListenAddr listen-addr Listen address (O)
L2TP.IPsecSaref ipsec saref Use IPSec SA (O)
L2TP.Port port What UDP port is used (O)
Option name pppd config value Description
PPPD.EchoFailure lcp-echo-failure Dead peer check count (O)
PPPD.EchoInterval lcp-echo-interval Dead peer check interval (O)
PPPD.Debug debug Debug level (O)
PPPD.RefuseEAP refuse-eap Deny eap auth (O)
PPPD.RefusePAP refuse-pap Deny pap auth (O)
PPPD.RefuseCHAP refuse-chap Deny chap auth (O)
PPPD.RefuseMSCHAP refuse-mschap Deny mschap auth (O)
PPPD.RefuseMSCHAP2 refuse-mschapv2 Deny mschapv2 auth (O)
PPPD.NoBSDComp nobsdcomp Disables BSD compression (O)
PPPD.NoPcomp nopcomp Disable protocol compression (O)
PPPD.UseAccomp accomp Disable address/control compression (O)
PPPD.NoDeflate nodeflate Disable deflate compression (O)
PPPD.ReqMPPE require-mppe Require the use of MPPE (O)
PPPD.ReqMPPE40 require-mppe-40 Require the use of MPPE 40 bit (O)
PPPD.ReqMPPE128 require-mppe-128 Require the use of MPPE 128 bit (O)
PPPD.ReqMPPEStateful mppe-stateful Allow MPPE to use stateful mode (O)
PPPD.NoVJ no-vj-comp No Van Jacobson compression (O)
PPTP VPN supports following options (see pptp(8) and pppd(8) for details)
Option name pptp config value Description
PPTP.User - PPTP user name, asked from the user
if not set here (O)
PPTP.Password - PPTP password, asked from the user
if not set here (O)
Option name pppd config value Description
PPPD.EchoFailure lcp-echo-failure Dead peer check count (O)
PPPD.EchoInterval lcp-echo-interval Dead peer check interval (O)
PPPD.Debug debug Debug level (O)
PPPD.RefuseEAP refuse-eap Deny eap auth (O)
PPPD.RefusePAP refuse-pap Deny pap auth (O)
PPPD.RefuseCHAP refuse-chap Deny chap auth (O)
PPPD.RefuseMSCHAP refuse-mschap Deny mschap auth (O)
PPPD.RefuseMSCHAP2 refuse-mschapv2 Deny mschapv2 auth (O)
PPPD.NoBSDComp nobsdcomp Disables BSD compression (O)
PPPD.NoDeflate nodeflate Disable deflate compression (O)
PPPD.RequirMPPE require-mppe Require the use of MPPE (O)
PPPD.RequirMPPE40 require-mppe-40 Require the use of MPPE 40 bit (O)
PPPD.RequirMPPE128 require-mppe-128 Require the use of MPPE 128 bit (O)
PPPD.RequirMPPEStateful mppe-stateful Allow MPPE to use stateful mode (O)
PPPD.NoVJ no-vj-comp No Van Jacobson compression (O)
Example
=======
This is a configuration file for a VPN providing L2TP, OpenVPN and
OpenConnect services.
example@example:[~]$ cat /var/lib/connman/vpn/example.config
[global]
Name = Example
Description = Example VPN configuration
[provider_l2tp]
Type = L2TP
Name = Connection to corporate network
Host = 1.2.3.4
Domain = corporate.com
Networks = 10.10.30.0/24
L2TP.User = username
[provider_openconnect]
Type = OpenConnect
Name = Connection to corporate network using Cisco VPN
Host = 7.6.5.4
Domain = corporate.com
Networks = 10.10.20.0/255.255.255.0/10.20.1.5,192.168.99.1/24,2001:db8::1/64
OpenConnect.ServerCert = 263AFAB4CB2E6621D12E90182008AEF44AEFA031
OpenConnect.CACert = /etc/certs/certificate.p12
[provider_openvpn]
Type = OpenVPN
Name = Connection to corporate network using OpenVPN
Host = 3.2.5.6
Domain = my.home.network
OpenVPN.CACert = /etc/certs/cacert.pem
OpenVPN.Cert = /etc/certs/cert.pem
OpenVPN.Key = /etc/certs/cert.key
@@ -0,0 +1,181 @@
vpn connection
==============
Service net.connman.vpn
Interface net.connman.vpn.Connection
Object path [variable prefix]/{connection0,connection1,...}
Methods dict GetProperties() [experimental]
Returns properties for the connection object. See
the properties section for available properties.
Possible Errors: [connection].Error.InvalidArguments
void SetProperty(string name, variant value) [experimental]
Changes the value of the specified property. Only
properties that are listed as read-write are
changeable. On success a PropertyChanged signal
will be emitted.
Possible Errors: [connection].Error.InvalidArguments
[connection].Error.InvalidProperty
void ClearProperty(string name) [experimental]
Clears the value of the specified property.
Possible Errors: [connection].Error.InvalidArguments
[connection].Error.InvalidProperty
void Connect() [experimental]
Connect this VPN connection. It will attempt to connect
to the VPN connection. The Connect() will wait until
the connection is created or there is an error. The
error description is returned in dbus error.
Possible Errors: [connection].Error.InvalidArguments
[connection].Error.InProgress
void Disconnect() [experimental]
Disconnect this VPN connection. If the connection is
not connected an error message will be generated.
Possible Errors: [connection].Error.InvalidArguments
Signals PropertyChanged(string name, variant value) [experimental]
This signal indicates a changed value of the given
property.
Properties string State [readonly]
The connection state information.
Valid states are "idle", "failure", "configuration",
"ready", "disconnect".
string Type [readonly]
The VPN type (for example "openvpn", "vpnc" etc.)
string Name [readonly]
The VPN name.
string Domain [readonly]
The domain name used behind the VPN connection.
This is optional for most VPN technologies.
string Host [readonly]
The VPN host (server) address.
boolean Immutable [readonly]
This value will be set to true if the connection is
configured externally via a configuration file.
The only valid operation are Connect(), Disconnect()
and GetProperties()
int Index [readonly]
The index of the VPN network tunneling interface.
If there is no tunneling device, then this value
is not returned.
dict IPv4 [readonly]
string Address
The current configured IPv4 address.
string Netmask
The current configured IPv4 netmask.
string Gateway
The current configured IPv4 gateway.
string Peer
The current configured VPN tunnel endpoint
IPv4 address.
dict IPv6 [readonly]
string Address
The current configured IPv6 address.
string PrefixLength
The prefix length of the IPv6 address.
string Gateway
The current configured IPv6 gateway.
string Peer
The current configured VPN tunnel endpoint
IPv6 address.
array{string} Nameservers [readonly]
The list of nameservers set by VPN.
array{dict} UserRoutes [readwrite]
int ProtocolFamily
Protocol family of the route. Set to 4
if IPv4 and 6 if IPv6 route.
string Network
The network part of the route.
string Netmask
The netmask of the route.
string Gateway
Gateway address of the route.
The list of currently active user activated
routes.
array{dict} ServerRoutes [readonly]
int ProtocolFamily
Protocol family of the route. Set to 4
if IPv4 and 6 if IPv6 route.
string Network
The network part of the route.
string Netmask
The netmask of the route.
string Gateway
Gateway address of the route.
The VPN server activated route. These routes
are pushed to connman by VPN server.
There can be other properties also but as the VPN
technologies are so different, they have different
kind of options that they need, so not all options
are mentioned in this document.
@@ -0,0 +1,50 @@
vpn manager
===========
Service net.connman.vpn
Interface net.connman.vpn.Manager
Object path /
Method object Create(dict settings) [experimental]
Create a new VPN connection and configuration using
the supplied settings.
void Remove(object vpn) [experimental]
Remove the previously created VPN configuration.
array{object,dict} GetConnections() [experimental]
Returns a list of tuples with VPN connection object
path and dictionary of their properties.
Possible Errors: [manager].Error.InvalidArguments
void RegisterAgent(object path) [experimental]
Register new agent for handling user requests.
Possible Errors: [manager].Error.InvalidArguments
void UnregisterAgent(object path) [experimental]
Unregister an existing agent.
Possible Errors: [manager].Error.InvalidArguments
Signals ConnectionAdded(object path, dict properties) [experimental]
Signal that is sent when a new VPN connection
is added.
It contains the object path of the VPN connection
and also its properties.
ConnectionRemoved(object path) [experimental]
Signal that is sent when a VPN connection
has been removed.
The object path is no longer accessible after this
signal and only emitted for reference.
@@ -0,0 +1,60 @@
VPN daemon overview
*******************
Manager interface
=================
Manager interface described in vpn-manager-api.txt is to be used
by both the connectivity UI and by ConnMan. The Create(),
Remove(), RegisterAgent() and UnregisterAgent() functions are for
UI usage. The GetConnections() method and ConnectionAdded() and
ConnectionRemoved() signals are for ConnMan VPN plugin to use.
The UI should use the methods like this:
- Ask VPN properties (like certs, usernames etc) from the user.
- Call Manager.Create() to create a VPN connection (note that
the system does not yet try to connect to VPN at this point)
- Register an agent to vpnd so that vpnd can ask any extra
parameters etc from the user if needed.
- If the user wants to connect to VPN gateway, then the
connection attempt should be done in ConnMan side as
there will be a service created there.
- If the user wishes to remove the VPN configuration, the UI
can call the Manager.Remove() which removes the VPN connection.
If the VPN was in use, the VPN connection is also disconnected.
- When UI is terminated, the UI should call the UnregisterAgent()
The ConnMan calls VPN daemon like this:
- There is a VPN plugin which at startup starts to listen the
ConnectionAdded() and ConnectionRemoved() signals.
- The VPN plugin will call GetConnections() in order to get
available VPN connections. It will then create a provider service
for each VPN connection that is returned.
- User can then connect to the VPN by calling the service Connect()
method
- The existing ConnMan Manager.ConnectProvider() interface can still
work by calling vpn.Manager.Create() and then call vpn.Connection.Connect()
but this ConnectProvider() interface will be deprecated at some
point.
Connection interface
====================
The Manager.Create() will return the object path of the created
vpn.Connection object and place it in idle state. Note that
vpn.Connection.PropertyChanged signal is not called when Connection
object is created because the same parameters are returned via
vpn.Manager.ConnectionAdded() signal.
The vpn.Connection object can be connected using the Connect() method
and disconnected by calling Disconnect() method. When the connection
is established (meaning VPN client has managed to create a connection
to VPN server), then State property is set to "ready" and PropertyChanged
signal is sent. If the connection cannot be established, then
State property is set to "failure".
After successfull connection, the relevant connection properties are sent
by PropertyChanged signal; like IPv[4|6] information, the index of the
VPN tunneling interface (if there is any), nameserver information,
server specified routes etc.
@@ -0,0 +1,54 @@
WiFi P2P Functionality [experimental]
*************************************
Note: Nothing about WiFi P2P Services is exposed, this is yet to be specified.
Summary
=======
WiFi P2P is supported as follows:
- if hardware and wpa_supplicant supports it, a "p2p" technology will appear
in the technology list
- "p2p" technology, as for "wifi" technology, supports a Scan() method. Such
method will trigger a P2P find process. The results will be available
through the Manager interface, comparable to services being available
through this same interface after a Scan() on "wifi" technology.
- the result of a "p2p" Scan() consists into a list of "peer" objects
- it is then possible to access peer information, connecting and disconnecting
it via the Peer API.
API Usage
=========
The UI willing to access to WiFi P2P technology should proceed this way:
- Request Manager.GetTechnologies() and figure out from the result if "p2p"
technology is provided. What comes next implies this successful case.
- Add a listener to signal Manager.PeersChanged(): this signal will provide
the results of a "p2p" technology Scan().
- From the "p2p" technology object, request a Technology.Scan() method. This
will run for a while a P2P find process.
- If P2P peers are found, it will be signaled through Manager.PeersChanged().
Objects are "Peer" objects. UI might use Manager.GetPeers() instead, if
listening to a signal is not the preferred way.
- Once selected the proper Peer object, request a Peer.Connect() method on it
so it will connect to it. Peer.Disconnect() will disconnect.
Internals
=========
Through such API, everything is made to hide irrelevant informations for the
applications, which are:
- Everything related to the P2P group and the Group Owner (GO)
- All low level peer settings
- All Service Request Discovery mechanism
Hiding this mean ConnMan will handle it properly behind.
For instance, if you connect to a Peer which happens to be a persistent GO
ConnMan will notice it and store the Group information for a later connection
to speed up such connection.
For Service Discovery (SD), this will be handled the same way: silently
behind, by ConnMan.
@@ -0,0 +1,3 @@
<filter name='allow-arp' chain='arp'>
<rule direction='inout' action='accept'/>
</filter>
@@ -0,0 +1,24 @@
<filter name='allow-dhcp-server' chain='ipv4'>
<!-- accept outgoing DHCP requests -->
<!-- note, this rule must be evaluated before general MAC broadcast
traffic is discarded since DHCP requests use MAC broadcast -->
<rule action='accept' direction='out' priority='100'>
<ip srcipaddr='0.0.0.0'
dstipaddr='255.255.255.255'
protocol='udp'
srcportstart='68'
dstportstart='67' />
</rule>
<!-- accept incoming DHCP responses from a specific DHCP server
parameter DHPCSERVER needs to be passed from where this filter is
referenced -->
<rule action='accept' direction='in' priority='100' >
<ip srcipaddr='$DHCPSERVER'
protocol='udp'
srcportstart='67'
dstportstart='68'/>
</rule>
</filter>
@@ -0,0 +1,21 @@
<filter name='allow-dhcp' chain='ipv4'>
<!-- accept outgoing DHCP requests -->
<!-- not, this rule must be evaluated before general MAC broadcast
traffic is discarded since DHCP requests use MAC broadcast -->
<rule action='accept' direction='out' priority='100'>
<ip srcipaddr='0.0.0.0'
dstipaddr='255.255.255.255'
protocol='udp'
srcportstart='68'
dstportstart='67' />
</rule>
<!-- accept incoming DHCP responses from any DHCP server -->
<rule action='accept' direction='in' priority='100' >
<ip protocol='udp'
srcportstart='67'
dstportstart='68'/>
</rule>
</filter>
@@ -0,0 +1,3 @@
<filter name='allow-incoming-ipv4' chain='ipv4'>
<rule direction='in' action='accept'/>
</filter>
@@ -0,0 +1,3 @@
<filter name='allow-ipv4' chain='ipv4'>
<rule direction='inout' action='accept'/>
</filter>
@@ -0,0 +1,30 @@
<filter name='clean-traffic' chain='root'>
<!-- An example of a traffic filter enforcing clean traffic
from a VM by
- preventing MAC spoofing -->
<filterref filter='no-mac-spoofing'/>
<!-- preventing IP spoofing on outgoing, allow all IPv4 in incoming -->
<filterref filter='no-ip-spoofing'/>
<rule direction='out' action='accept' priority='-650'>
<mac protocolid='ipv4'/>
</rule>
<filterref filter='allow-incoming-ipv4'/>
<!-- preventing ARP spoofing/poisoning -->
<filterref filter='no-arp-spoofing'/>
<!-- accept all other incoming and outgoing ARP traffic -->
<rule action='accept' direction='inout' priority='-500'>
<mac protocolid='arp'/>
</rule>
<!-- preventing any other traffic than IPv4 and ARP -->
<filterref filter='no-other-l2-traffic'/>
<!-- allow qemu to send a self-announce upon migration end -->
<filterref filter='qemu-announce-self'/>
</filter>
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE codermap [
<!ELEMENT codermap (coder)*>
<!ELEMENT coder (#PCDATA)>
<!ATTLIST coder magick CDATA #REQUIRED>
<!ATTLIST coder name CDATA #REQUIRED>
]>
<!--
Associate an image format with the specified coder module.
ImageMagick has a number of coder modules to support the reading and/or
writing of an image format (e.g. JPEG). Some coder modules support more
than one associated image format and the mapping between an associated
format and its respective coder module is defined in this configuration
file. For example, the PNG coder module not only supports the PNG image
format, but the JNG and MNG formats as well.
-->
<codermap>
<!-- <coder magick="GIF87" name="GIF"/> -->
<!-- <coder magick="JPG" name="JPEG"/> -->
<!-- <coder magick="PGM" name="PNM"/> -->
</codermap>
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE colormap [
<!ELEMENT colormap (color)+>
<!ELEMENT color (#PCDATA)>
<!ATTLIST color name CDATA "0">
<!ATTLIST color color CDATA "rgb(0,0,0)">
<!ATTLIST color compliance CDATA "SVG">
]>
<!--
Associate a color name with its red, green, blue, and alpha intensities.
A number of methods and options require a color parameter. It is often
convenient to refer to a color by name (e.g. white) rather than by hex
value (e.g. #fff). This file maps a color name to its equivalent red,
green, blue, and alpha intensities (e.g. for white, red = 255, green =
255, blue = 255, and alpha = 0).
-->
<colormap>
<!-- <color name="none" color="rgba(0,0,0,0)" compliance="SVG, XPM"/> -->
<!-- <color name="black" color="rgb(0,0,0)" compliance="SVG, X11, XPM"/> -->
<!-- <color name="red" color="rgb(255,0,0)" compliance="SVG, X11, XPM"/> -->
<!-- <color name="magenta" color="rgb(255,0,255)" compliance="SVG, X11, XPM"/> -->
<!-- <color name="green" color="rgb(0,128,0)" compliance="SVG"/> -->
<!-- <color name="cyan" color="rgb(0,255,255)" compliance="SVG, X11, XPM"/> -->
<!-- <color name="blue" color="rgb(0,0,255)" compliance="SVG, X11, XPM"/> -->
<!-- <color name="yellow" color="rgb(255,255,0)" compliance="SVG, X11, XPM"/> -->
<!-- <color name="white" color="rgb(255,255,255)" compliance="SVG, X11"/> -->
</colormap>
+138
View File
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE delegatemap [
<!ELEMENT delegatemap (delegate)+>
<!ELEMENT delegate (#PCDATA)>
<!ATTLIST delegate decode CDATA #IMPLIED>
<!ATTLIST delegate encode CDATA #IMPLIED>
<!ATTLIST delegate mode CDATA #IMPLIED>
<!ATTLIST delegate spawn CDATA #IMPLIED>
<!ATTLIST delegate stealth CDATA #IMPLIED>
<!ATTLIST delegate thread-support CDATA #IMPLIED>
<!ATTLIST delegate command CDATA #REQUIRED>
]>
<!--
Delegate command file.
Commands which specify
decode="in_format" encode="out_format"
specify the rules for converting from in_format to out_format These
rules may be used to translate directly between formats.
Commands which specify only
decode="in_format"
specify the rules for converting from in_format to some format that
ImageMagick will automatically recognize. These rules are used to
decode formats.
Commands which specify only
encode="out_format"
specify the rules for an "encoder" which may accept any input format.
For delegates other than ps:*, pcl:*, and mpeg:* the substitution rules are
as follows:
%i input image filename
%o output image filename
%u unique temporary filename
%Z unique temporary filename
%# input image signature
%b image file size
%c input image comment
%g image geometry
%h image rows (height)
%k input image number colors
%l image label
%m input image format
%p page number
%q input image depth
%s scene number
%w image columns (width)
%x input image x resolution
%y input image y resolution
Set option delegate:bimodal=true to process bimodal delegates otherwise they
are ignored.
If stealth="True" the delegate is not listed in user requested
"-list delegate" listings. These are typically special internal delegates.
If spawn="True" ImageMagick will not way for the delegate to finish,
nor will it read any output image. It will only wait for either the input
file to be removed (See "ephemeral:" coder) indicating that the input file
has been read, or a maximum time limit of 2 seconds.
-->
<delegatemap>
<delegate decode="autotrace" stealth="True" command="&quot;convert&quot; &quot;%i&quot; &quot;pnm:%u&quot;\n&quot;autotrace&quot; -input-format pnm -output-format svg -output-file &quot;%o&quot; &quot;%u&quot;"/>
<delegate decode="bpg" command="&quot;bpgdec&quot; -b 16 -o &quot;%o.png&quot; &quot;%i&quot;; mv &quot;%o.png&quot; &quot;%o&quot;"/>
<delegate decode="png" encode="bpg" command="&quot;bpgenc&quot; -b 12 -o &quot;%o&quot; &quot;%i&quot;"/>
<delegate decode="blender" command="&quot;blender&quot; -b &quot;%i&quot; -F PNG -o &quot;%o&quot;&quot;\n&quot;convert&quot; -concatenate &quot;%o*.png&quot; &quot;%o&quot;"/>
<delegate decode="browse" stealth="True" spawn="True" command="&quot;xdg-open&quot; http://www.imagemagick.org/; rm &quot;%i&quot;"/>
<delegate decode="cdr" command="&quot;uniconvertor&quot; &quot;%i&quot; &quot;%o.svg&quot;; mv &quot;%o.svg&quot; &quot;%o&quot;"/>
<delegate decode="cgm" command="&quot;uniconvertor&quot; &quot;%i&quot; &quot;%o.svg&quot;; mv &quot;%o.svg&quot; &quot;%o&quot;"/>
<delegate decode="dng:decode" command="&quot;ufraw-batch&quot; --silent --create-id=also --out-type=png --out-depth=16 &quot;--output=%u.png&quot; &quot;%i&quot;"/>
<delegate decode="doc" command="&quot;soffice&quot; --headless --convert-to pdf --outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%Z&quot;; mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="docx" command="&quot;soffice&quot; --headless --convert-to pdf --outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%Z&quot;; mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="dot" command='&quot;dot&quot; -Tsvg &quot;%i&quot; -o &quot;%o&quot;' />
<delegate decode="dvi" command="&quot;dvips&quot; -q -o &quot;%o&quot; &quot;%i&quot;"/>
<delegate decode="dxf" command="&quot;uniconvertor&quot; &quot;%i&quot; &quot;%o.svg&quot;; mv &quot;%o.svg&quot; &quot;%o&quot;"/>
<delegate decode="edit" stealth="True" command="&quot;xterm&quot; -title &quot;Edit Image Comment&quot; -e vi &quot;%o&quot;"/>
<delegate decode="eps" encode="pdf" mode="bi" command="&quot;gs&quot; -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 &quot;-sDEVICE=pdfwrite&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;"/>
<delegate decode="eps" encode="ps" mode="bi" command="&quot;gs&quot; -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ps2write&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;"/>
<delegate decode="fig" command="&quot;uniconvertor&quot; &quot;%i&quot; &quot;%o.svg&quot;; mv &quot;%o.svg&quot; &quot;%o&quot;"/>
<delegate decode="hpg" command="&quot;hp2xx&quot; -q -m eps -f `basename &quot;%o&quot;` &quot;%i&quot;; mv -f `basename &quot;%o&quot;` &quot;%o&quot;"/>
<delegate decode="hpgl" command="&quot;hp2xx&quot; -q -m eps -f `basename &quot;%o&quot;` &quot;%i&quot;; mv -f `basename &quot;%o&quot;` &quot;%o&quot;"/>
<delegate decode="htm" command="&quot;html2ps&quot; -U -o &quot;%o&quot; &quot;%i&quot;"/>
<delegate decode="html" command="&quot;html2ps&quot; -U -o &quot;%o&quot; &quot;%i&quot;"/>
<delegate decode="https" command="&quot;curl&quot; -s -k -L -o &quot;%o&quot; &quot;https:%M&quot;"/>
<delegate decode="ilbm" command="&quot;ilbmtoppm&quot; &quot;%i&quot; &gt; &quot;%o&quot;"/>
<delegate decode="jxr" command="mv &quot;%i&quot; &quot;%i.jxr&quot;; &quot;JxrDecApp&quot; -i &quot;%i.jxr&quot; -o &quot;%o.bmp&quot; -c 0; mv &quot;%i.jxr&quot; &quot;%i&quot;; mv &quot;%o.bmp&quot; &quot;%o&quot;"/>
<delegate decode="man" command="&quot;groff&quot; -man -Tps &quot;%i&quot; &gt; &quot;%o&quot;"/>
<delegate decode="miff" encode="show" spawn="True" command="&quot;display&quot; -delay 0 -window-group %[group] -title &quot;%l &quot; &quot;ephemeral:%i&quot;"/>
<delegate decode="miff" encode="win" stealth="True" spawn="True" command="&quot;display&quot; -immutable -delay 0 -window-group %[group] -title &quot;%l &quot; &quot;ephemeral:%i&quot;"/>
<delegate decode="mpeg:decode" command="&quot;ffmpeg&quot; -v -1 -i &quot;%i&quot; -vframes %S -vcodec pam -an -f rawvideo -y &quot;%u.pam&quot; 2&gt; &quot;%Z&quot;"/>
<delegate decode="odt" command="&quot;soffice&quot; --headless --convert-to pdf --outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%Z&quot;; mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="pcl:cmyk" stealth="True" command="&quot;pcl6&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pamcmyk32&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
<delegate decode="pcl:color" stealth="True" command="&quot;pcl6&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ppmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
<delegate decode="pcl:mono" stealth="True" command="&quot;pcl6&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pbmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
<delegate decode="pdf" encode="eps" mode="bi" command="&quot;gs&quot; -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=eps2write&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;"/>
<delegate decode="pdf" encode="ps" mode="bi" command="&quot;gs&quot; -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ps2write&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;"/>
<delegate decode="plt" command="&quot;echo&quot; &quot;set size 1.25,0.62; set terminal postscript portrait color solid; set output \'%o\'; load \'%i\'&quot; &gt; &quot;%u&quot;;&quot;gnuplot&quot; &quot;%u&quot;"/>
<delegate decode="png" encode="webp" command="&quot;cwebp&quot; -quiet -q %Q &quot;%i&quot; -o &quot;%o&quot;"/>
<delegate decode="pnm" encode="ilbm" mode="encode" command="&quot;ppmtoilbm&quot; -24if &quot;%i&quot; &gt; &quot;%o&quot;"/>
<delegate decode="bmp" encode="jxr" command="mv &quot;%i&quot; &quot;%i.bmp&quot;; &quot;JxrEncApp&quot; -i &quot;%i.bmp&quot; -o &quot;%o.jxr&quot;; mv &quot;%i.bmp&quot; &quot;%i&quot;; mv &quot;%o.jxr&quot; &quot;%o&quot;"/>
<delegate decode="bmp" encode="wdp" command="mv &quot;%i&quot; &quot;%i.bmp&quot;; &quot;JxrEncApp&quot; -i &quot;%i.bmp&quot; -o &quot;%o.jxr&quot;; mv &quot;%i.bmp&quot; &quot;%i&quot;; mv &quot;%o.jxr&quot; &quot;%o&quot;"/>
<delegate decode="pov" command="&quot;povray&quot; &quot;+i%i&quot; -D0 &quot;+o%o&quot; +fn%q +w%w +h%h +a -q9 &quot;-kfi%s&quot; &quot;-kff%n&quot;;&quot;convert&quot; -concatenate &quot;%o*.png&quot; &quot;%o&quot;"/>
<delegate decode="ppt" command="&quot;soffice&quot; --headless --convert-to pdf --outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%Z&quot;; mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="pptx" command="&quot;soffice&quot; --headless --convert-to pdf --outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%Z&quot;; mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="ps:alpha" stealth="True" command="&quot;gs&quot; -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pngalpha&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;-f%s&quot; &quot;-f%s&quot;"/>
<delegate decode="ps:cmyk" stealth="True" command="&quot;gs&quot; -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pam&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;-f%s&quot; &quot;-f%s&quot;"/>
<delegate decode="ps:color" stealth="True" command="&quot;gs&quot; -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pnmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;-f%s&quot; &quot;-f%s&quot;"/>
<delegate decode="ps" encode="eps" mode="bi" command="&quot;gs&quot; -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=eps2write&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;"/>
<delegate decode="ps" encode="pdf" mode="bi" command="&quot;gs&quot; -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pdfwrite&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;"/>
<delegate decode="ps" encode="print" mode="encode" command="lpr &quot;%i&quot;"/>
<delegate decode="ps:mono" stealth="True" command="&quot;gs&quot; -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pbmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;-f%s&quot; &quot;-f%s&quot;"/>
<delegate decode="rgba" encode="rle" mode="encode" command="&quot;rawtorle&quot; -o &quot;%o&quot; -v &quot;%i&quot;"/>
<delegate decode="scan" command="&quot;scanimage&quot; -d &quot;%i&quot; &gt; &quot;%o&quot;"/>
<delegate decode="scanx" command="&quot;scanimage&quot; &gt; &quot;%o&quot;"/>
<delegate decode="shtml" command="&quot;html2ps&quot; -U -o &quot;%o&quot; &quot;%i&quot;"/>
<delegate decode="sid" command="&quot;mrsidgeodecode&quot; -if sid -i &quot;%i&quot; -of tif -o &quot;%o&quot; &gt; &quot;%u&quot;"/>
<delegate decode="svg" command="&quot;rsvg-convert&quot; -o &quot;%o&quot; &quot;%i&quot;"/>
<delegate decode="svg:decode" stealth="True" command="&quot;inkscape&quot; &quot;%s&quot; --export-png=&quot;%s&quot; --export-dpi=&quot;%s&quot; --export-background=&quot;%s&quot; --export-background-opacity=&quot;%s&quot; &gt; &quot;%s&quot; 2&gt;&amp;1"/>
<delegate decode="tiff" encode="launch" mode="encode" command="&quot;gimp&quot; &quot;%i&quot;"/>
<delegate decode="txt" encode="ps" mode="bi" command="&quot;enscript&quot; -o &quot;%o&quot; &quot;%i&quot;"/>
<delegate decode="wdp" command="mv &quot;%i&quot; &quot;%i.jxr&quot;; &quot;JxrDecApp&quot; -i &quot;%i.jxr&quot; -o &quot;%o.bmp&quot;; mv &quot;%i.jxr&quot; &quot;%i&quot;; mv &quot;%o.bmp&quot; &quot;%o&quot;"/>
<delegate decode="webp" command="&quot;dwebp&quot; -pam &quot;%i&quot; -o &quot;%o&quot;"/>
<delegate decode="wmf" command="&quot;wmf2eps&quot; -o &quot;%o&quot; &quot;%i&quot;"/>
<delegate decode="xls" command="&quot;soffice&quot; --headless --convert-to pdf --outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%Z&quot;; mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="xlsx" command="&quot;soffice&quot; --headless --convert-to pdf --outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%Z&quot;; mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="xps:cmyk" stealth="True" command="&quot;gxps&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=bmpsep8&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
<delegate decode="xps:color" stealth="True" command="&quot;gxps&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ppmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
<delegate decode="xps:mono" stealth="True" command="&quot;gxps&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pbmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
<delegate encode="mpeg:encode" stealth="True" command="&quot;ffmpeg&quot; -v -1 -i &quot;%M%%d.jpg&quot; &quot;%u.%m&quot; 2&gt; &quot;%Z&quot;"/>
</delegatemap>
+40
View File
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE logmap [
<!ELEMENT logmap (log)+>
<!ELEMENT log (#PCDATA)>
<!ATTLIST log events CDATA #IMPLIED>
<!ATTLIST log output CDATA #IMPLIED>
<!ATTLIST log filename CDATA #IMPLIED>
<!ATTLIST log generations CDATA #IMPLIED>
<!ATTLIST log limit CDATA #IMPLIED>
<!ATTLIST log format CDATA #IMPLIED>
]>
<!--
The format of the log is defined by embedding special format characters:
%c client
%d domain
%e event
%f function
%g generation
%i thread id
%l line
%m module
%n log name
%p process id
%r real CPU time
%t wall clock time
%u user CPU time
%v version
%% percent sign
\n newline
\r carriage return
-->
<logmap>
<log events="None"/>
<log output="console"/>
<log filename="Magick-%g.log"/>
<log generations="3"/>
<log limit="2000"/>
<log format="%t %r %u %v %d %c[%p]: %m/%f/%l/%d\n %e"/>
</logmap>
+23
View File
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE magicmap [
<!ELEMENT magicmap (magic)+>
<!ELEMENT magic (#PCDATA)>
<!ATTLIST magic name CDATA #REQUIRED>
<!ATTLIST magic offset CDATA "0">
<!ATTLIST magic target CDATA #REQUIRED>
]>
<!--
Associate an image format with a unique identifier.
Many image formats have identifiers that uniquely identify a particular
image format. For example, the GIF image format always begins with GIF8
as the first 4 characters of the image. ImageMagick uses this information
to quickly determine the type of image it is dealing with when it reads
an image.
-->
<magicmap>
<!-- <magic name="GIF" offset="0" target="GIF8"/> -->
<!-- <magic name="JPEG" offset="0" target="\377\330\377"/> -->
<!-- <magic name="PNG" offset="0" target="\211PNG\r\n\032\n"/> -->
<!-- <magic name="TIFF" offset="0" target="\115\115\000\052"/> -->
</magicmap>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,9 @@
<filter name='no-arp-ip-spoofing' chain='arp-ip' priority='-510'>
<!-- no arp spoofing -->
<!-- drop if ipaddr does not belong to guest -->
<rule action='return' direction='out' priority='400' >
<arp match='yes' arpsrcipaddr='$IP' />
</rule>
<!-- drop everything else -->
<rule action='drop' direction='out' priority='1000' />
</filter>
@@ -0,0 +1,7 @@
<filter name='no-arp-mac-spoofing' chain='arp-mac' priority='-520'>
<rule action='return' direction='out' priority='350' >
<arp match='yes' arpsrcmacaddr='$MAC'/>
</rule>
<!-- drop everything else -->
<rule action='drop' direction='out' priority='1000' />
</filter>
@@ -0,0 +1,4 @@
<filter name='no-arp-spoofing' chain='root'>
<filterref filter='no-arp-mac-spoofing'/>
<filterref filter='no-arp-ip-spoofing'/>
</filter>
@@ -0,0 +1,9 @@
<filter name='no-ip-multicast' chain='ipv4'>
<!-- drop if destination IP address is in the 224.0.0.0/4 subnet -->
<rule action='drop' direction='out'>
<ip dstipaddr='224.0.0.0' dstipmask='4' />
</rule>
<!-- not doing anything with receiving side ... -->
</filter>
@@ -0,0 +1,14 @@
<filter name='no-ip-spoofing' chain='ipv4-ip' priority='-710'>
<!-- allow UDP sent from 0.0.0.0 (DHCP); filter more exact later -->
<rule action='return' direction='out' priority='100'>
<ip srcipaddr='0.0.0.0' protocol='udp'/>
</rule>
<!-- allow all known IP addresses -->
<rule direction='out' action='return' priority='500'>
<ip srcipaddr='$IP'/>
</rule>
<!-- drop everything else -->
<rule direction='out' action='drop' priority='1000'/>
</filter>
@@ -0,0 +1,8 @@
<filter name='no-mac-broadcast' chain='ipv4'>
<!-- drop if destination mac is bcast mac addr. -->
<rule action='drop' direction='out'>
<mac dstmacaddr='ff:ff:ff:ff:ff:ff' />
</rule>
<!-- not doing anything with receiving side ... -->
</filter>
@@ -0,0 +1,10 @@
<filter name='no-mac-spoofing' chain='mac' priority='-800'>
<!-- return packets with VM's MAC address as source address -->
<rule direction='out' action='return'>
<mac srcmacaddr='$MAC'/>
</rule>
<!-- drop everything else -->
<rule direction='out' action='drop'>
<mac/>
</rule>
</filter>
@@ -0,0 +1,7 @@
<filter name='no-other-l2-traffic'>
<!-- drop all other l2 traffic than for which rules have been
written for; i.e., drop all other than arp and ipv4 traffic -->
<rule action='drop' direction='inout' priority='1000'/>
</filter>
@@ -0,0 +1,3 @@
<filter name='no-other-rarp-traffic' chain='rarp'>
<rule action='drop' direction='inout' priority='1000'/>
</filter>
+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policymap [
<!ELEMENT policymap (policy)+>
<!ELEMENT policy (#PCDATA)>
<!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED>
<!ATTLIST policy name CDATA #IMPLIED>
<!ATTLIST policy rights CDATA #IMPLIED>
<!ATTLIST policy pattern CDATA #IMPLIED>
<!ATTLIST policy value CDATA #IMPLIED>
]>
<!--
Configure ImageMagick policies.
Domains include system, delegate, coder, filter, path, or resource.
Rights include none, read, write, and execute. Use | to combine them,
for example: "read | write" to permit read from, or write to, a path.
Use a glob expression as a pattern.
Suppose we do not want users to process MPEG video images:
<policy domain="delegate" rights="none" pattern="mpeg:decode" />
Here we do not want users reading images from HTTP:
<policy domain="coder" rights="none" pattern="HTTP" />
Lets prevent users from executing any image filters:
<policy domain="filter" rights="none" pattern="*" />
The /repository file system is restricted to read only. We use a glob
expression to match all paths that start with /repository:
<policy domain="path" rights="read" pattern="/repository/*" />
Any large image is cached to disk rather than memory:
<policy domain="resource" name="area" value="1GB"/>
Define arguments for the memory, map, area, width, height, and disk resources
with SI prefixes (.e.g 100MB). In addition, resource policies are maximums
for each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
exceeds policy maximum so memory limit is 1GB).
-->
<policymap>
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
<!-- <policy domain="resource" name="memory" value="2GiB"/> -->
<!-- <policy domain="resource" name="map" value="4GiB"/> -->
<!-- <policy domain="resource" name="width" value="10MP"/> -->
<!-- <policy domain="resource" name="height" value="10MP"/> -->
<!-- <policy domain="resource" name="area" value="1GB"/> -->
<!-- <policy domain="resource" name="disk" value="16EB"/> -->
<!-- <policy domain="resource" name="file" value="768"/> -->
<!-- <policy domain="resource" name="thread" value="4"/> -->
<!-- <policy domain="resource" name="throttle" value="0"/> -->
<!-- <policy domain="resource" name="time" value="3600"/> -->
<!-- <policy domain="system" name="precision" value="6"/> -->
<policy domain="cache" name="shared-secret" value="passphrase"/>
</policymap>
@@ -0,0 +1,14 @@
<filter name='qemu-announce-self-rarp' chain='rarp'>
<rule action='accept' direction='out' priority='500'>
<rarp opcode='Request_Reverse'
srcmacaddr='$MAC' dstmacaddr='ff:ff:ff:ff:ff:ff'
arpsrcmacaddr='$MAC' arpdstmacaddr='$MAC'
arpsrcipaddr='0.0.0.0' arpdstipaddr='0.0.0.0'/>
</rule>
<rule action='accept' direction='in' priority='500'>
<rarp opcode='Request_Reverse'
dstmacaddr='ff:ff:ff:ff:ff:ff'
arpsrcmacaddr='$MAC' arpdstmacaddr='$MAC'
arpsrcipaddr='0.0.0.0' arpdstipaddr='0.0.0.0'/>
</rule>
</filter>
@@ -0,0 +1,13 @@
<filter name='qemu-announce-self' chain='root'>
<!-- as of 4/26/2010 qemu sends out a bogus packet with
wrong rarp protocol ID -->
<!-- accept what is being sent now -->
<rule action='accept' direction='out'>
<mac protocolid='0x835'/>
</rule>
<!-- accept if it was changed to rarp -->
<filterref filter='qemu-announce-self-rarp'/>
<filterref filter='no-other-rarp-traffic'/>
</filter>
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE quantization-tables [
<!ELEMENT quantization-tables (table)+>
<!ELEMENT table (description , levels)>
<!ELEMENT description (CDATA)>
<!ELEMENT levels (CDATA)>
<!ATTLIST table slot ID #REQUIRED>
<!ATTLIST levels width CDATA #REQUIRED>
<!ATTLIST levels height CDATA #REQUIRED>
<!ATTLIST levels divisor CDATA #REQUIRED>
]>
<!--
JPEG quantization table created by Dr. Nicolas Robidoux, Senior Research
Scientist at Phase One (www.phaseone.com) for use with 2x2 Chroma
subsampling and (IJG-style, hence ImageMagick-style) quality level
around 75.
It is based on the one recommended in
Relevance of human vision to JPEG-DCT compression by Stanley A. Klein,
Amnon D. Silverstein and Thom Carney. In Human Vision, Visual
Processing and Digital Display III, 1992.
for 1 minute per pixel viewing.
Specifying only one table in this xml file has two effects when used with
the ImageMagick option
-define jpeg:q-table=PATH/TO/THIS/FILE
1) This quantization table is automatically used for all three channels;
2) Only one copy is embedded in the JPG file, which saves a few bits
(only worthwhile for very small thumbnails).
-->
<quantization-tables>
<table slot="0" alias="luma">
<description>Luma Quantization Table</description>
<levels width="8" height="8" divisor="1">
16, 16, 16, 18, 25, 37, 56, 85,
16, 17, 20, 27, 34, 40, 53, 75,
16, 20, 24, 31, 43, 62, 91, 135,
18, 27, 31, 40, 53, 74, 106, 156,
25, 34, 43, 53, 69, 94, 131, 189,
37, 40, 62, 74, 94, 124, 169, 238,
56, 53, 91, 106, 131, 169, 226, 311,
85, 75, 135, 156, 189, 238, 311, 418
</levels>
</table>
<!--
If you want to use a different quantization table for Chroma (say), just add
<table slot="1" alias="chroma">
<description>Chroma Quantization Table</description>
INSERT 64 POSITIVE INTEGERS HERE, COMMA-SEPARATED
</levels>
</table>
here (but outside of these comments).
-->
</quantization-tables>
+334
View File
@@ -0,0 +1,334 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE thresholds [
<!ELEMENT thresholds (threshold)+>
<!ELEMENT threshold (description , levels)>
<!ELEMENT description (CDATA)>
<!ELEMENT levels (CDATA)>
<!ATTLIST threshold map ID #REQUIRED>
<!ATTLIST levels width CDATA #REQUIRED>
<!ATTLIST levels height CDATA #REQUIRED>
<!ATTLIST levels divisor CDATA #REQUIRED>
]>
<!--
Threshold Maps for Ordered Posterized Dither
Each "<threshold>" element defines the map name, description, and an array
of "levels" used to provide the threshold map for ordered dithering and
digital halftoning.
The "alias" attribute provides a backward compatible name for this threshold
map (pre-dating IM v6.2.9-6), and are deprecated.
The description is a english description of what the threshold map achieves
and is only used for 'listing' the maps.
The map itself is a rectangular array of integers or threshold "levels"
of the given "width" and "height" declared within the enclosing <levels>
element. That is "width*height" integers or "levels" *must* be provided
within each map.
Each of the "levels" integer values (each value representing the threshold
intensity "level/divisor" at which that pixel is turned on. The "levels"
integers given can be any postive integers between "0" and the "divisor",
excluding those limits.
The "divisor" not only defines the upper limit and threshold divisor for each
"level" but also the total number of pseudo-levels the threshold mapping
creates and fills with a dither pattern. That is a ordered bitmap dither
of a pure greyscale gradient will use a maximum of "divisor" ordered bitmap
patterns, including the patterns with all the pixels 'on' and all the pixel
'off'. It may define less patterns than that, but the color channels will
be thresholded in units based on "divisor".
Alternatively for a multi-level posterization, ImageMagick inserts
"divisor-2" dither patterns (as defined by the threshold map) between each of
channel color level produced.
For example the map "o2x2" has a divisor of 5, which will define 3 bitmap
patterns plus the patterns with all pixels 'on' and 'off'. A greyscale
gradient will thus have 5 distinct areas.
-->
<thresholds>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Minimal Dither and Non-Dither Threshold Maps
-->
<threshold map="threshold" alias="1x1">
<description>Threshold 1x1 (non-dither)</description>
<levels width="1" height="1" divisor="2">
1
</levels>
</threshold>
<threshold map="checks" alias="2x1">
<description>Checkerboard 2x1 (dither)</description>
<levels width="2" height="2" divisor="3">
1 2
2 1
</levels>
</threshold>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(dispersed) Ordered Dither Patterns
-->
<threshold map="o2x2" alias="2x2">
<description>Ordered 2x2 (dispersed)</description>
<levels width="2" height="2" divisor="5">
1 3
4 2
</levels>
</threshold>
<threshold map="o3x3" alias="3x3">
<description>Ordered 3x3 (dispersed)</description>
<levels width="3" height="3" divisor="10">
3 7 4
6 1 9
2 8 5
</levels>
</threshold>
<threshold map="o4x4" alias="4x4">
<!--
From "Dithering Algorithms"
http://www.efg2.com/Lab/Library/ImageProcessing/DHALF.TXT
-->
<description>Ordered 4x4 (dispersed)</description>
<levels width="4" height="4" divisor="17">
1 9 3 11
13 5 15 7
4 12 2 10
16 8 14 6
</levels>
</threshold>
<threshold map="o8x8" alias="8x8">
<!-- Extracted from original 'OrderedDither()' Function -->
<description>Ordered 8x8 (dispersed)</description>
<levels width="8" height="8" divisor="65">
1 49 13 61 4 52 16 64
33 17 45 29 36 20 48 32
9 57 5 53 12 60 8 56
41 25 37 21 44 28 40 24
3 51 15 63 2 50 14 62
35 19 47 31 34 18 46 30
11 59 7 55 10 58 6 54
43 27 39 23 42 26 38 22
</levels>
</threshold>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Halftones - Angled 45 degrees
Initially added to ImageMagick by Glenn Randers-Pehrson, IM v6.2.8-6,
modified to be more symmetrical with intensity by Anthony, IM v6.2.9-7
These patterns initially start as circles, but then form diamonds
pattern at the 50% threshold level, before forming negated circles,
as it approached the other threshold extereme.
-->
<threshold map="h4x4a" alias="4x1">
<description>Halftone 4x4 (angled)</description>
<levels width="4" height="4" divisor="9">
4 2 7 5
3 1 8 6
7 5 4 2
8 6 3 1
</levels>
</threshold>
<threshold map="h6x6a" alias="6x1">
<description>Halftone 6x6 (angled)</description>
<levels width="6" height="6" divisor="19">
14 13 10 8 2 3
16 18 12 7 1 4
15 17 11 9 6 5
8 2 3 14 13 10
7 1 4 16 18 12
9 6 5 15 17 11
</levels>
</threshold>
<threshold map="h8x8a" alias="8x1">
<description>Halftone 8x8 (angled)</description>
<levels width="8" height="8" divisor="33">
13 7 8 14 17 21 22 18
6 1 3 9 28 31 29 23
5 2 4 10 27 32 30 24
16 12 11 15 20 26 25 19
17 21 22 18 13 7 8 14
28 31 29 23 6 1 3 9
27 32 30 24 5 2 4 10
20 26 25 19 16 12 11 15
</levels>
</threshold>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Halftones - Orthogonally Aligned, or Un-angled
Initially added by Anthony Thyssen, IM v6.2.9-5 using techniques from
"Dithering & Halftoning" by Gernot Haffmann
http://www.fho-emden.de/~hoffmann/hilb010101.pdf
These patterns initially start as circles, but then form square
pattern at the 50% threshold level, before forming negated circles,
as it approached the other threshold extereme.
-->
<threshold map="h4x4o">
<description>Halftone 4x4 (orthogonal)</description>
<levels width="4" height="4" divisor="17">
7 13 11 4
12 16 14 8
10 15 6 2
5 9 3 1
</levels>
</threshold>
<threshold map="h6x6o">
<description>Halftone 6x6 (orthogonal)</description>
<levels width="6" height="6" divisor="37">
7 17 27 14 9 4
21 29 33 31 18 11
24 32 36 34 25 22
19 30 35 28 20 10
8 15 26 16 6 2
5 13 23 12 3 1
</levels>
</threshold>
<threshold map="h8x8o">
<description>Halftone 8x8 (orthogonal)</description>
<levels width="8" height="8" divisor="65">
7 21 33 43 36 19 9 4
16 27 51 55 49 29 14 11
31 47 57 61 59 45 35 23
41 53 60 64 62 52 40 38
37 44 58 63 56 46 30 22
15 28 48 54 50 26 17 10
8 18 34 42 32 20 6 2
5 13 25 39 24 12 3 1
</levels>
</threshold>
<threshold map="h16x16o">
<!--
Direct extract from "Dithering & Halftoning" by Gernot Haffmann.
This may need some fine tuning for symmetry of the halftone dots,
as it was a mathematically formulated pattern.
-->
<description>Halftone 16x16 (orthogonal)</description>
<levels width="16" height="16" divisor="257">
4 12 24 44 72 100 136 152 150 134 98 70 42 23 11 3
7 16 32 52 76 104 144 160 158 142 102 74 50 31 15 6
19 27 40 60 92 132 168 180 178 166 130 90 58 39 26 18
36 48 56 80 124 176 188 204 203 187 175 122 79 55 47 35
64 68 84 116 164 200 212 224 223 211 199 162 114 83 67 63
88 96 112 156 192 216 232 240 239 231 214 190 154 111 95 87
108 120 148 184 208 228 244 252 251 243 226 206 182 147 119 107
128 140 172 196 219 235 247 256 255 246 234 218 194 171 139 127
126 138 170 195 220 236 248 253 254 245 233 217 193 169 137 125
106 118 146 183 207 227 242 249 250 241 225 205 181 145 117 105
86 94 110 155 191 215 229 238 237 230 213 189 153 109 93 85
62 66 82 115 163 198 210 221 222 209 197 161 113 81 65 61
34 46 54 78 123 174 186 202 201 185 173 121 77 53 45 33
20 28 37 59 91 131 167 179 177 165 129 89 57 38 25 17
8 13 29 51 75 103 143 159 157 141 101 73 49 30 14 5
1 9 21 43 71 99 135 151 149 133 97 69 41 22 10 2
</levels>
</threshold>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Halftones - Orthogonally Expanding Circle Patterns
Added by Glenn Randers-Pehrson, 4 Nov 2010, ImageMagick 6.6.5-6
Rather than producing a diamond 50% threshold pattern, these
continue to generate larger (overlapping) circles. They are
more like a true halftone pattern formed by covering a surface
with either pure white or pure black circular dots.
WARNING: true halftone patterns only use true circles even in
areas of highly varying intensity. Threshold dither patterns
can generate distorted circles in such areas.
-->
<threshold map="c5x5b" alias="c5x5">
<description>Circles 5x5 (black)</description>
<levels width="5" height="5" divisor="26">
1 21 16 15 4
5 17 20 19 14
6 21 25 24 12
7 18 22 23 11
2 8 9 10 3
</levels>
</threshold>
<threshold map="c5x5w">
<description>Circles 5x5 (white)</description>
<levels width="5" height="5" divisor="26">
25 21 10 11 22
20 9 6 7 12
19 5 1 2 13
18 8 4 3 14
24 17 16 15 23
</levels>
</threshold>
<threshold map="c6x6b" alias="c6x6">
<description>Circles 6x6 (black)</description>
<levels width="6" height="6" divisor="37">
1 5 14 13 12 4
6 22 28 27 21 11
15 29 35 34 26 20
16 30 36 33 25 19
7 23 31 32 24 10
2 8 17 18 9 3
</levels>
</threshold>
<threshold map="c6x6w">
<description>Circles 6x6 (white)</description>
<levels width="6" height="6" divisor="37">
36 32 23 24 25 33
31 15 9 10 16 26
22 8 2 3 11 17
21 7 1 4 12 18
30 14 6 5 13 27
35 29 20 19 28 34
</levels>
</threshold>
<threshold map="c7x7b" alias="c7x7">
<description>Circles 7x7 (black)</description>
<levels width="7" height="7" divisor="50">
3 9 18 28 17 8 2
10 24 33 39 32 23 7
19 34 44 48 43 31 16
25 40 45 49 47 38 27
20 35 41 46 42 29 15
11 21 36 37 28 22 6
4 12 13 26 14 5 1
</levels>
</threshold>
<threshold map="c7x7w">
<description>Circles 7x7 (white)</description>
<levels width="7" height="7" divisor="50">
47 41 32 22 33 42 48
40 26 17 11 18 27 43
31 16 6 2 7 19 34
25 10 5 1 3 12 23
30 15 9 4 8 20 35
39 29 14 13 21 28 44
46 38 37 24 36 45 49
</levels>
</threshold>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Special Purpose Dithers
-->
</thresholds>
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE typemap [
<!ELEMENT typemap (type)+>
<!ELEMENT type (#PCDATA)>
<!ELEMENT include (#PCDATA)>
<!ATTLIST type name CDATA #REQUIRED>
<!ATTLIST type fullname CDATA #IMPLIED>
<!ATTLIST type fullname="" family CDATA #IMPLIED>
<!ATTLIST type foundry CDATA #IMPLIED>
<!ATTLIST type weight CDATA #IMPLIED>
<!ATTLIST type style CDATA #IMPLIED>
<!ATTLIST type stretch CDATA #IMPLIED>
<!ATTLIST type format CDATA #IMPLIED>
<!ATTLIST type metrics CDATA #IMPLIED>
<!ATTLIST type glyphs CDATA #REQUIRED>
<!ATTLIST type version CDATA #IMPLIED>
<!ATTLIST include file CDATA #REQUIRED>
]>
<typemap>
<type name="DejaVu-LGC-Sans-Bold" fullname="DejaVu LGC Sans Bold" family="DejaVuGC Sans" style="Normal" stretch="Normal" weight="700" glyphs="DejaVuLGCSans-Bold.ttf"/>
<type name="DejaVu-LGC-Sans-Bold-Oblique" fullname="DejaVu LGC Sans Bold Oblique" family="DejaVuGC Sans" style="Oblique" stretch="Normal" weight="700" glyphs="DejaVuLGCSans-BoldOblique.ttf"/>
<type name="DejaVu-LGC-Sans-Book" fullname="DejaVu LGC Sans Book" family="DejaVuGC Sans" style="Normal" stretch="Normal" weight="400" glyphs="DejaVuLGCSans.ttf"/>
<type name="DejaVu-LGC-Sans-Condensed" fullname="DejaVu LGC Sans Condensed" family="DejaVuGC Sans" style="Normal" stretch="SemiCondensed" weight="400" glyphs="DejaVuLGCSansCondensed.ttf"/>
<type name="DejaVu-LGC-Sans-Condensed-Bold" fullname="DejaVu LGC Sans Condensed Bold" family="DejaVuGC Sans" style="Normal" stretch="SemiCondensed" weight="700" glyphs="DejaVuLGCSansCondensed-Bold.ttf"/>
<type name="DejaVu-LGC-Sans-Condensed-Bold-Oblique" fullname="DejaVu LGC Sans Condensed Bold Oblique" family="DejaVuGC Sans" style="Oblique" stretch="SemiCondensed" weight="700" glyphs="DejaVuLGCSansCondensed-BoldOblique.ttf"/>
<type name="DejaVu-LGC-Sans-Condensed-Oblique" fullname="DejaVu LGC Sans Condensed Oblique" family="DejaVuGC Sans" style="Oblique" stretch="SemiCondensed" weight="400" glyphs="DejaVuLGCSansCondensed-Oblique.ttf"/>
<type name="DejaVu-LGC-Sans-ExtraLight" fullname="DejaVu LGC Sans ExtraLight" family="DejaVuGC Sans" style="Normal" stretch="Normal" weight="200" glyphs="DejaVuLGCSans-ExtraLight.ttf"/>
<type name="DejaVu-LGC-Sans-Mono-Bold" fullname="DejaVu LGC Sans Mono Bold" family="DejaVuGC Sans Mono" style="Normal" stretch="Normal" weight="700" glyphs="DejaVuLGCSansMono-Bold.ttf"/>
<type name="DejaVu-LGC-Sans-Mono-Bold-Oblique" fullname="DejaVu LGC Sans Mono Bold Oblique" family="DejaVuGC Sans Mono" style="Oblique" stretch="Normal" weight="700" glyphs="DejaVuLGCSansMono-BoldOblique.ttf"/>
<type name="DejaVu-LGC-Sans-Mono-Book" fullname="DejaVu LGC Sans Mono Book" family="DejaVuGC Sans Mono" style="Normal" stretch="Normal" weight="400" glyphs="DejaVuLGCSansMono.ttf"/>
<type name="DejaVu-LGC-Sans-Mono-Oblique" fullname="DejaVu LGC Sans Mono Oblique" family="DejaVuGC Sans Mono" style="Oblique" stretch="Normal" weight="400" glyphs="DejaVuLGCSansMono-Oblique.ttf"/>
<type name="DejaVu-LGC-Sans-Oblique" fullname="DejaVu LGC Sans Oblique" family="DejaVuGC Sans" style="Oblique" stretch="Normal" weight="400" glyphs="DejaVuLGCSans-Oblique.ttf"/>
<type name="DejaVu-LGC-Serif-Bold" fullname="DejaVu LGC Serif Bold" family="DejaVuGC Serif" style="Normal" stretch="Normal" weight="700" glyphs="DejaVuLGCSerif-Bold.ttf"/>
<type name="DejaVu-LGC-Serif-Bold-Italic" fullname="DejaVu LGC Serif Bold Italic" family="DejaVuGC Serif" style="Italic" stretch="Normal" weight="700" glyphs="DejaVuLGCSerif-BoldItalic.ttf"/>
<type name="DejaVu-LGC-Serif-Book" fullname="DejaVu LGC Serif Book" family="DejaVuGC Serif" style="Normal" stretch="Normal" weight="400" glyphs="DejaVuLGCSerif.ttf"/>
<type name="DejaVu-LGC-Serif-Condensed" fullname="DejaVu LGC Serif Condensed" family="DejaVuGC Serif" style="Normal" stretch="SemiCondensed" weight="400" glyphs="DejaVuLGCSerifCondensed.ttf"/>
<type name="DejaVu-LGC-Serif-Condensed-Bold" fullname="DejaVu LGC Serif Condensed Bold" family="DejaVuGC Serif" style="Normal" stretch="SemiCondensed" weight="700" glyphs="DejaVuLGCSerifCondensed-Bold.ttf"/>
<type name="DejaVu-LGC-Serif-Condensed-Bold-Italic" fullname="DejaVu LGC Serif Condensed Bold Italic" family="DejaVuGC Serif" style="Italic" stretch="SemiCondensed" weight="700" glyphs="DejaVuLGCSerifCondensed-BoldItalic.ttf"/>
<type name="DejaVu-LGC-Serif-Condensed-Italic" fullname="DejaVu LGC Serif -Condensed Italic" family="DejaVuGC Serif" style="Italic" stretch="SemiCondensed" weight="400" glyphs="DejaVuLGCSerifCondensed-Italic.ttf"/>
<type name="DejaVu-LGC-Serif-Italic" fullname="DejaVu LGC Serif Italic" family="DejaVuGC Serif" style="Italic" stretch="Normal" weight="400" glyphs="DejaVuLGCSerif-Italic.ttf"/>
<type name="DejaVu-Sans-Bold" fullname="DejaVu Sans Bold" family="DejaVu Sans" style="Normal" stretch="Normal" weight="700" glyphs="DejaVuSans-Bold.ttf"/>
<type name="DejaVu-Sans-Bold-Oblique" fullname="DejaVu Sans Bold Oblique" family="DejaVu Sans" style="Oblique" stretch="Normal" weight="700" glyphs="DejaVuSans-BoldOblique.ttf"/>
<type name="DejaVu-Sans-Book" fullname="DejaVu Sans Book" family="DejaVu Sans" style="Normal" stretch="Normal" weight="400" glyphs="DejaVuSans.ttf"/>
<type name="DejaVu-Sans-Condensed" fullname="DejaVu Sans Condensed" family="DejaVu Sans" style="Normal" stretch="SemiCondensed" weight="400" glyphs="DejaVuSansCondensed.ttf"/>
<type name="DejaVu-Sans-Condensed-Bold" fullname="DejaVu Sans Condensed Bold" family="DejaVu Sans" style="Normal" stretch="SemiCondensed" weight="700" glyphs="DejaVuSansCondensed-Bold.ttf"/>
<type name="DejaVu-Sans-Condensed-Bold-Oblique" fullname="DejaVu Sans Condensed Bold Oblique" family="DejaVu Sans" style="Oblique" stretch="SemiCondensed" weight="700" glyphs="DejaVuSansCondensed-BoldOblique.ttf"/>
<type name="DejaVu-Sans-Condensed-Oblique" fullname="DejaVu Sans Condensed Oblique" family="DejaVu Sans" style="Oblique" stretch="SemiCondensed" weight="400" glyphs="DejaVuSansCondensed-Oblique.ttf"/>
<type name="DejaVu-Sans-ExtraLight" fullname="DejaVu Sans ExtraLight" family="DejaVu Sans" style="Normal" stretch="Normal" weight="200" glyphs="DejaVuSans-ExtraLight.ttf"/>
<type name="DejaVu-Sans-Mono-Bold" fullname="DejaVu Sans Mono Bold" family="DejaVu Sans Mono" style="Normal" stretch="Normal" weight="700" glyphs="DejaVuSansMono-Bold.ttf"/>
<type name="DejaVu-Sans-Mono-Bold-Oblique" fullname="DejaVu Sans Mono Bold Oblique" family="DejaVu Sans Mono" style="Oblique" stretch="Normal" weight="700" glyphs="DejaVuSansMono-BoldOblique.ttf"/>
<type name="DejaVu-Sans-Mono-Book" fullname="DejaVu Sans Mono Book" family="DejaVu Sans Mono" style="Normal" stretch="Normal" weight="400" glyphs="DejaVuSansMono.ttf"/>
<type name="DejaVu-Sans-Mono-Oblique" fullname="DejaVu Sans Mono Oblique" family="DejaVu Sans Mono" style="Oblique" stretch="Normal" weight="400" glyphs="DejaVuSansMono-Oblique.ttf"/>
<type name="DejaVu-Sans-Oblique" fullname="DejaVu Sans Oblique" family="DejaVu Sans" style="Oblique" stretch="Normal" weight="400" glyphs="DejaVuSans-Oblique.ttf"/>
<type name="DejaVu-Serif-Bold" fullname="DejaVu Serif Bold" family="DejaVu Serif" style="Normal" stretch="Normal" weight="700" glyphs="DejaVuSerif-Bold.ttf"/>
<type name="DejaVu-Serif-Bold-Italic" fullname="DejaVu Serif Bold Italic" family="DejaVu Serif" style="Italic" stretch="Normal" weight="700" glyphs="DejaVuSerif-BoldItalic.ttf"/>
<type name="DejaVu-Serif-Book" fullname="DejaVu Serif Book" family="DejaVu Serif" style="Normal" stretch="Normal" weight="400" glyphs="DejaVuSerif.ttf"/>
<type name="DejaVu-Serif-Condensed" fullname="DejaVu Serif Condensed" family="DejaVu Serif" style="Normal" stretch="SemiCondensed" weight="400" glyphs="DejaVuSerifCondensed.ttf"/>
<type name="DejaVu-Serif-Condensed-Bold" fullname="DejaVu Serif Condensed Bold" family="DejaVu Serif" style="Normal" stretch="SemiCondensed" weight="700" glyphs="DejaVuSerifCondensed-Bold.ttf"/>
<type name="DejaVu-Serif-Condensed-Bold-Italic" fullname="DejaVu Serif Condensed Bold Italic" family="DejaVu Serif" style="Italic" stretch="SemiCondensed" weight="700" glyphs="DejaVuSerifCondensed-BoldItalic.ttf"/>
<type name="DejaVu-Serif-Condensed-Italic" fullname="DejaVu Serif Condensed Italic" family="DejaVu Serif" style="Italic" stretch="SemiCondensed" weight="400" glyphs="DejaVuSerifCondensed-Italic.ttf"/>
<type name="DejaVu-Serif-Italic" fullname="DejaVu Serif Italic" family="DejaVu Serif" style="Italic" stretch="Normal" weight="400" glyphs="DejaVuSerif-Italic.ttf"/>
</typemap>
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE typemap [
<!ELEMENT typemap (type)+>
<!ELEMENT type (#PCDATA)>
<!ELEMENT include (#PCDATA)>
<!ATTLIST type name CDATA #REQUIRED>
<!ATTLIST type fullname CDATA #IMPLIED>
<!ATTLIST type family CDATA #IMPLIED>
<!ATTLIST type foundry CDATA #IMPLIED>
<!ATTLIST type weight CDATA #IMPLIED>
<!ATTLIST type style CDATA #IMPLIED>
<!ATTLIST type stretch CDATA #IMPLIED>
<!ATTLIST type format CDATA #IMPLIED>
<!ATTLIST type metrics CDATA #IMPLIED>
<!ATTLIST type glyphs CDATA #REQUIRED>
<!ATTLIST type version CDATA #IMPLIED>
<!ATTLIST include file CDATA #REQUIRED>
]>
<typemap>
<type name="AvantGarde-Book" fullname="AvantGarde Book" family="AvantGarde" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/a010013l.afm" glyphs="/usr/share/fonts/Type1/a010013l.pfb"/>
<type name="AvantGarde-BookOblique" fullname="AvantGarde Book Oblique" family="AvantGarde" foundry="URW" weight="400" style="oblique" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/a010033l.afm" glyphs="/usr/share/fonts/Type1/a010033l.pfb"/>
<type name="AvantGarde-Demi" fullname="AvantGarde DemiBold" family="AvantGarde" foundry="URW" weight="600" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/a010015l.afm" glyphs="/usr/share/fonts/Type1/a010015l.pfb"/>
<type name="AvantGarde-DemiOblique" fullname="AvantGarde DemiOblique" family="AvantGarde" foundry="URW" weight="600" style="oblique" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/a010035l.afm" glyphs="/usr/share/fonts/Type1/a010035l.pfb"/>
<type name="Bookman-Demi" fullname="Bookman DemiBold" family="Bookman" foundry="URW" weight="600" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/b018015l.afm" glyphs="/usr/share/fonts/Type1/b018015l.pfb"/>
<type name="Bookman-DemiItalic" fullname="Bookman DemiBold Italic" family="Bookman" foundry="URW" weight="600" style="italic" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/b018035l.afm" glyphs="/usr/share/fonts/Type1/b018035l.pfb"/>
<type name="Bookman-Light" fullname="Bookman Light" family="Bookman" foundry="URW" weight="300" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/b018012l.afm" glyphs="/usr/share/fonts/Type1/b018012l.pfb"/>
<type name="Bookman-LightItalic" fullname="Bookman Light Italic" family="Bookman" foundry="URW" weight="300" style="italic" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/b018032l.afm" glyphs="/usr/share/fonts/Type1/b018032l.pfb"/>
<type name="Courier" fullname="Courier Regular" family="Courier" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n022003l.afm" glyphs="/usr/share/fonts/Type1/n022003l.pfb"/>
<type name="Courier-Bold" fullname="Courier Bold" family="Courier" foundry="URW" weight="700" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n022004l.afm" glyphs="/usr/share/fonts/Type1/n022004l.pfb"/>
<type name="Courier-Oblique" fullname="Courier Regular Oblique" family="Courier" foundry="URW" weight="400" style="oblique" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n022023l.afm" glyphs="/usr/share/fonts/Type1/n022023l.pfb"/>
<type name="Courier-BoldOblique" fullname="Courier Bold Oblique" family="Courier" foundry="URW" weight="700" style="oblique" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n022024l.afm" glyphs="/usr/share/fonts/Type1/n022024l.pfb"/>
<type name="fixed" fullname="Helvetica Regular" family="Helvetica" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n019003l.afm" glyphs="/usr/share/fonts/Type1/n019003l.pfb"/>
<type name="Helvetica" fullname="Helvetica Regular" family="Helvetica" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n019003l.afm" glyphs="/usr/share/fonts/Type1/n019003l.pfb"/>
<type name="Helvetica-Bold" fullname="Helvetica Bold" family="Helvetica" foundry="URW" weight="700" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n019004l.afm" glyphs="/usr/share/fonts/Type1/n019004l.pfb"/>
<type name="Helvetica-Oblique" fullname="Helvetica Regular Italic" family="Helvetica" foundry="URW" weight="400" style="italic" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n019023l.afm" glyphs="/usr/share/fonts/Type1/n019023l.pfb"/>
<type name="Helvetica-BoldOblique" fullname="Helvetica Bold Italic" family="Helvetica" foundry="URW" weight="700" style="italic" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n019024l.afm" glyphs="/usr/share/fonts/Type1/n019024l.pfb"/>
<type name="Helvetica-Narrow" fullname="Helvetica Narrow" family="Helvetica Narrow" foundry="URW" weight="400" style="normal" stretch="condensed" format="type1" metrics="/usr/share/fonts/Type1/n019043l.afm" glyphs="/usr/share/fonts/Type1/n019043l.pfb"/>
<type name="Helvetica-Narrow-Oblique" fullname="Helvetica Narrow Oblique" family="Helvetica Narrow" foundry="URW" weight="400" style="oblique" stretch="condensed" format="type1" metrics="/usr/share/fonts/Type1/n019063l.afm" glyphs="/usr/share/fonts/Type1/n019063l.pfb"/>
<type name="Helvetica-Narrow-Bold" fullname="Helvetica Narrow Bold" family="Helvetica Narrow" foundry="URW" weight="700" style="normal" stretch="condensed" format="type1" metrics="/usr/share/fonts/Type1/n019044l.afm" glyphs="/usr/share/fonts/Type1/n019044l.pfb"/>
<type name="Helvetica-Narrow-BoldOblique" fullname="Helvetica Narrow Bold Oblique" family="Helvetica Narrow" foundry="URW" weight="700" style="oblique" stretch="condensed" format="type1" metrics="/usr/share/fonts/Type1/n019064l.afm" glyphs="/usr/share/fonts/Type1/n019064l.pfb"/>
<type name="NewCenturySchlbk-Roman" fullname="New Century Schoolbook" family="NewCenturySchlbk" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/c059013l.afm" glyphs="/usr/share/fonts/Type1/c059013l.pfb"/>
<type name="NewCenturySchlbk-Italic" fullname="New Century Schoolbook Italic" family="NewCenturySchlbk" foundry="URW" weight="400" style="italic" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/c059033l.afm" glyphs="/usr/share/fonts/Type1/c059033l.pfb"/>
<type name="NewCenturySchlbk-Bold" fullname="New Century Schoolbook Bold" family="NewCenturySchlbk" foundry="URW" weight="700" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/c059016l.afm" glyphs="/usr/share/fonts/Type1/c059016l.pfb"/>
<type name="NewCenturySchlbk-BoldItalic" fullname="New Century Schoolbook Bold Italic" family="NewCenturySchlbk" foundry="URW" weight="700" style="italic" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/c059036l.afm" glyphs="/usr/share/fonts/Type1/c059036l.pfb"/>
<type name="Palatino-Roman" fullname="Palatino Regular" family="Palatino" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/p052003l.afm" glyphs="/usr/share/fonts/Type1/p052003l.pfb"/>
<type name="Palatino-Italic" fullname="Palatino Italic" family="Palatino" foundry="URW" weight="400" style="italic" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/p052023l.afm" glyphs="/usr/share/fonts/Type1/p052023l.pfb"/>
<type name="Palatino-Bold" fullname="Palatino Bold" family="Palatino" foundry="URW" weight="700" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/p052004l.afm" glyphs="/usr/share/fonts/Type1/p052004l.pfb"/>
<type name="Palatino-BoldItalic" fullname="Palatino Bold Italic" family="Palatino" foundry="URW" weight="700" style="italic" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/p052024l.afm" glyphs="/usr/share/fonts/Type1/p052024l.pfb"/>
<type name="Times-Roman" fullname="Times Regular" family="Times" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n021003l.afm" glyphs="/usr/share/fonts/Type1/n021003l.pfb"/>
<type name="Times-Bold" fullname="Times Medium" family="Times" foundry="URW" weight="700" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n021004l.afm" glyphs="/usr/share/fonts/Type1/n021004l.pfb"/>
<type name="Times-Italic" fullname="Times Regular Italic" family="Times" foundry="URW" weight="400" style="italic" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n021023l.afm" glyphs="/usr/share/fonts/Type1/n021023l.pfb"/>
<type name="Times-BoldItalic" fullname="Times Medium Italic" family="Times" foundry="URW" weight="700" style="italic" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/n021024l.afm" glyphs="/usr/share/fonts/Type1/n021024l.pfb"/>
<type name="Symbol" fullname="Symbol" family="Symbol" foundry="URW" weight="400" style="normal" stretch="normal" format="type1" metrics="/usr/share/fonts/Type1/s050000l.afm" glyphs="/usr/share/fonts/Type1/s050000l.pfb" version="0.1" encoding="AdobeCustom"/>
</typemap>
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE typemap [
<!ELEMENT typemap (type)+>
<!ELEMENT type (#PCDATA)>
<!ELEMENT include (#PCDATA)>
<!ATTLIST type name CDATA #REQUIRED>
<!ATTLIST type fullname CDATA #IMPLIED>
<!ATTLIST type family CDATA #IMPLIED>
<!ATTLIST type foundry CDATA #IMPLIED>
<!ATTLIST type weight CDATA #IMPLIED>
<!ATTLIST type style CDATA #IMPLIED>
<!ATTLIST type stretch CDATA #IMPLIED>
<!ATTLIST type format CDATA #IMPLIED>
<!ATTLIST type metrics CDATA #IMPLIED>
<!ATTLIST type glyphs CDATA #REQUIRED>
<!ATTLIST type version CDATA #IMPLIED>
<!ATTLIST include file CDATA #REQUIRED>
]>
<typemap>
<type name="Arial" fullname="Arial" family="Arial" weight="400" style="normal" stretch="normal" glyphs="arial.ttf"/>
<type name="Arial-Black" fullname="Arial Black" family="Arial" weight="900" style="normal" stretch="normal" glyphs="ariblk.ttf"/>
<type name="Arial-Bold" fullname="Arial Bold" family="Arial" weight="700" style="normal" stretch="normal" glyphs="arialbd.ttf"/>
<type name="Arial-Bold-Italic" fullname="Arial Bold Italic" family="Arial" weight="700" style="italic" stretch="normal" glyphs="arialbi.ttf"/>
<type name="Arial-Italic" fullname="Arial Italic" family="Arial" weight="400" style="italic" stretch="normal" glyphs="ariali.ttf"/>
<type name="Arial-Narrow" fullname="Arial Narrow" family="Arial Narrow" weight="400" style="normal" stretch="condensed" glyphs="arialn.ttf"/>
<type name="Arial-Narrow-Bold" fullname="Arial Narrow Bold" family="Arial Narrow" weight="700" style="normal" stretch="condensed" glyphs="arialnb.ttf"/>
<type name="Arial-Narrow-Bold-Italic" fullname="Arial Narrow Bold Italic" family="Arial Narrow" weight="700" style="italic" stretch="condensed" glyphs="arialnbi.ttf"/>
<type name="Arial-Narrow-Italic" fullname="Arial Narrow Italic" family="Arial Narrow" weight="400" style="italic" stretch="condensed" glyphs="arnari.ttf"/>
<type name="Arial-Narrow-Special-G1" fullname="Arial Narrow Special G1" family="Arial Narrow Special G1" weight="400" style="normal" stretch="condensed" glyphs="msgeonr1.ttf"/>
<type name="Arial-Narrow-Special-G1-Bold" fullname="Arial Narrow Special G1 Bold" family="Arial Narrow Special G1" weight="700" style="normal" stretch="condensed" glyphs="msgeonb1.ttf"/>
<type name="Arial-Narrow-Special-G1-Italic" fullname="Arial Narrow Special G1 Italic" family="Arial Narrow Special G1" weight="400" style="italic" stretch="condensed" glyphs="msgeoni1.ttf"/>
<type name="Arial-Narrow-Special-G2" fullname="Arial Narrow Special G2" family="Arial Narrow Special G2" weight="400" style="normal" stretch="condensed" glyphs="msgeonr2.ttf"/>
<type name="Arial-Narrow-Special-G2-Bold" fullname="Arial Narrow Special G2 Bold" family="Arial Narrow Special G2" weight="700" style="Narrow" stretch="normal" glyphs="msgeonb2.ttf"/>
<type name="Arial-Narrow-Special-G2-Italic" fullname="Arial Narrow Special G2 Italic" family="Arial Narrow Special G2" weight="400" style="italic" stretch="condensed" glyphs="msgeoni2.ttf"/>
<type name="Arial-Rounded-MT-Bold" fullname="Arial Rounded MT Bold" family="Arial Rounded MT" weight="700" style="normal" stretch="normal" glyphs="arlrdbd.ttf"/>
<type name="Arial-Special-G1" fullname="Arial Special G1" family="Arial Special G1" weight="400" style="normal" stretch="normal" glyphs="msgeor1.ttf"/>
<type name="Arial-Special-G1-Bold" fullname="Arial Special G1 Bold" family="Arial Special G1" weight="700" style="normal" stretch="normal" glyphs="msgeoab1.ttf"/>
<type name="Arial-Special-G1-Bold-Italic" fullname="Arial Special G1 Bold Italic" family="Arial Special G1" weight="700" style="italic" stretch="normal" glyphs="msgeoax1.ttf"/>
<type name="Arial-Special-G1-Italic" fullname="Arial Special G1 Italic" family="Arial Special G1" weight="400" style="italic" stretch="normal" glyphs="msgeoai1.ttf"/>
<type name="Arial-Special-G2" fullname="Arial Special G2" family="Arial Special G2" weight="400" style="normal" stretch="normal" glyphs="msgeoar2.ttf"/>
<type name="Arial-Special-G2-Bold" fullname="Arial Special G2 Bold" family="Arial Special G2" weight="700" style="normal" stretch="normal" glyphs="msgeoab2.ttf"/>
<type name="Arial-Special-G2-Bold-Italic" fullname="Arial Special G2 Bold Italic" family="Arial Special G2" weight="700" style="italic" stretch="normal" glyphs="msgeoax2.ttf"/>
<type name="Arial-Special-G2-Italic" fullname="Arial Special G2 Italic" family="Arial Special G2" weight="400" style="italic" stretch="normal" glyphs="msgeoai2.ttf"/>
<type name="Bookman-Old-Style" fullname="Bookman Old Style" family="Bookman Old Style" weight="400" style="normal" stretch="normal" glyphs="bkmnos.ttf"/>
<type name="Bookman-Old-Style-Bold" fullname="Bookman Old Style Bold" family="Bookman Old Style" weight="700" style="normal" stretch="normal" glyphs="bookosb.ttf"/>
<type name="Bookman-Old-Style-Bold-Italic" fullname="Bookman Old Style Bold Italic" family="Bookman Old Style" weight="400" style="italic" stretch="normal" glyphs="bookosbi.ttf"/>
<type name="Bookman-Old-Style-Italic" fullname="Bookman Old Style Italic" family="Bookman Old Style" weight="400" style="italic" stretch="normal" glyphs="boookosi.ttf"/>
<type name="Century-Schoolbook" fullname="Century Schoolbook" family="Century Schoolbook" weight="400" style="normal" stretch="normal" glyphs="censcbk.ttf"/>
<type name="Century-Schoolbook-Bold" fullname="Century Schoolbook Bold" family="Century Schoolbook" weight="700" style="normal" stretch="normal" glyphs="schlbkb.ttf"/>
<type name="Century-Schoolbook-Bold-Italic" fullname="Century Schoolbook Bold Italic" family="Century Schoolbook" weight="700" style="italic" stretch="normal" glyphs="schlbkbi.ttf"/>
<type name="Century-Schoolbook-Italic" fullname="Century Schoolbook Italic" family="Century Schoolbook" weight="400" style="italic" stretch="normal" glyphs="schlbki.ttf"/>
<type name="Comic-Sans-MS" fullname="Comic Sans MS" family="Comic Sans MS" weight="400" style="normal" stretch="normal" glyphs="comic.ttf"/>
<type name="Comic-Sans-MS-Bold" fullname="Comic Sans MS Bold" family="Comic Sans MS" weight="700" style="normal" stretch="normal" glyphs="comicbd.ttf"/>
<type name="Courier-New" fullname="Courier New" family="Courier New" weight="400" style="normal" stretch="normal" glyphs="cour.ttf"/>
<type name="Courier-New-Bold" fullname="Courier New Bold" family="Courier New" weight="700" style="normal" stretch="normal" glyphs="courbd.ttf"/>
<type name="Courier-New-Bold-Italic" fullname="Courier New Bold Italic" family="Courier New" weight="700" style="italic" stretch="normal" glyphs="courbi.ttf"/>
<type name="Courier-New-Italic" fullname="Courier New Italic" family="Courier New" weight="400" style="italic" stretch="normal" glyphs="couri.ttf"/>
<type name="Garamond" fullname="Garamond" family="Garamond" weight="400" style="normal" stretch="normal" glyphs="gara.ttf"/>
<type name="Garamond-Bold" fullname="Garamond Bold" family="Garamond" weight="700" style="normal" stretch="normal" glyphs="garabd.ttf"/>
<type name="Garamond-Italic" fullname="Garamond Italic" family="Garamond" weight="400" style="italic" stretch="normal" glyphs="Italic"/>
<type name="Gill-Sans-MT-Ext-Condensed-Bold" fullname="Gill Sans MT Ext Condensed Bold" family="Gill Sans MT" weight="700" style="normal" stretch="extra-condensed" glyphs="glsnecb.ttf"/>
<type name="Impact" fullname="Impact" family="Impact" weight="400" style="normal" stretch="normal" glyphs="impact.ttf"/>
<type name="Lucida-Blackletter" fullname="Lucida Blackletter" family="Lucida Blackletter" weight="400" style="normal" stretch="normal" glyphs="lblack.ttf"/>
<type name="Lucida-Bright" fullname="Lucida Bright" family="Lucida Bright" weight="400" style="normal" stretch="normal" glyphs="lbrite.ttf"/>
<type name="Lucida-Bright-Demibold" fullname="Lucida Bright Demibold" family="Lucida Bright" weight="600" style="normal" stretch="normal" glyphs="lbrited.ttf"/>
<type name="Lucida-Bright-Demibold-Italic" fullname="Lucida Bright Demibold Italic" family="Lucida Bright" weight="600" style="italic" stretch="normal" glyphs="lbritedi.ttf"/>
<type name="Lucida-Bright-Italic" fullname="Lucida Bright Italic" family="Lucida Bright" weight="400" style="italic" stretch="normal" glyphs="lbritei.ttf"/>
<type name="Lucida-Caligraphy-Italic" fullname="Lucida Caligraphy Italic" family="Lucida Caligraphy" weight="400" style="italic" stretch="normal" glyphs="lcalig.ttf"/>
<type name="Lucida-Console, Lucida-Console" fullname="Lucida Console, Lucida Console" family="Regular" weight="400" style="lucon.ttf" stretch="normal" glyphs=""/>
<type name="Lucida-Fax-Demibold" fullname="Lucida Fax Demibold" family="Lucida Fax" weight="600" style="normal" stretch="normal" glyphs="lfaxd.ttf"/>
<type name="Lucida-Fax-Demibold-Italic" fullname="Lucida Fax Demibold Italic" family="Lucida Fax" weight="600" style="italic" stretch="normal" glyphs="lfaxdi.ttf"/>
<type name="Lucida-Fax-Italic" fullname="Lucida Fax Italic" family="Lucida Fax" weight="400" style="italic" stretch="normal" glyphs="lfaxi.ttf"/>
<type name="Lucida-Fax-Regular" fullname="Lucida Fax Regular" family="Lucida Fax" weight="400" style="normal" stretch="normal" glyphs="lfax.ttf"/>
<type name="Lucida-Handwriting-Italic" fullname="Lucida Handwriting Italic" family="Lucida Handwriting" weight="400" style="italic" stretch="normal" glyphs="lhandw.ttf"/>
<type name="Lucida-Sans-Demibold-Italic" fullname="Lucida Sans Demibold Italic" family="Lucida Sans" weight="600" style="italic" stretch="normal" glyphs="lsansdi.ttf"/>
<type name="Lucida-Sans-Demibold-Roman" fullname="Lucida Sans Demibold Roman" family="Lucida Sans Demibold" weight="400" style="normal" stretch="normal" glyphs="lsansd.ttf"/>
<type name="Lucida-Sans-Regular" fullname="Lucida Sans Regular" family="Lucida Sans" weight="400" style="normal" stretch="normal" glyphs="lsans.ttf"/>
<type name="Lucida-Sans-Typewriter-Bold" fullname="Lucida Sans Typewriter Bold" family="Lucida Sans Typewriter" weight="700" style="normal" stretch="normal" glyphs="ltypeb.ttf"/>
<type name="Lucida-Sans-Typewriter-Bold-Oblique" fullname="Lucida Sans Typewriter Bold Oblique" family="Lucida Sans Typewriter" weight="700" style="normal" stretch="normal" glyphs="ltypebo.ttf"/>
<type name="Lucida-Sans-Typewriter-Oblique" fullname="Lucida Sans Typewriter Oblique" family="Lucida Sans Typewriter" weight="700" style="normal" stretch="normal" glyphs="ltypeo.ttf"/>
<type name="Lucida-Sans-Typewriter-Regular" fullname="Lucida Sans Typewriter Regular" family="Lucida Sans Typewriter" weight="400" style="normal" stretch="normal" glyphs="ltype.ttf"/>
<type name="MS-Sans-Serif" fullname="MS Sans Serif" family="MS Sans Serif" weight="400" style="normal" stretch="normal" glyphs="sseriff.ttf"/>
<type name="MS-Serif" fullname="MS Serif" family="MS Serif" weight="400" style="normal" stretch="normal" glyphs="seriff.ttf"/>
<type name="Modern" fullname="Modern" family="Modern" weight="400" style="normal" stretch="normal" glyphs="modern.ttf"/>
<type name="Monotype-Corsiva" fullname="Monotype Corsiva" family="Monotype Corsiva" weight="400" style="normal" stretch="normal" glyphs="mtcorsva.ttf"/>
<type name="Small-Fonts" fullname="Small Fonts" family="Small Fonts" weight="400" style="normal" stretch="normal" glyphs="smallf.ttf"/>
<type name="Symbol" fullname="Symbol" family="Symbol" weight="400" style="normal" stretch="normal" glyphs="symbol.ttf" encoding="AppleRoman"/>
<type name="Tahoma" fullname="Tahoma" family="Tahoma" weight="400" style="normal" stretch="normal" glyphs="tahoma.ttf"/>
<type name="Tahoma-Bold" fullname="Tahoma Bold" family="Tahoma" weight="700" style="normal" stretch="normal" glyphs="tahomabd.ttf"/>
<type name="Times-New-Roman" fullname="Times New Roman" family="Times New Roman" weight="400" style="normal" stretch="normal" glyphs="times.ttf"/>
<type name="Times-New-Roman-Bold" fullname="Times New Roman Bold" family="Times New Roman" weight="700" style="normal" stretch="normal" glyphs="timesbd.ttf"/>
<type name="Times-New-Roman-Bold-Italic" fullname="Times New Roman Bold Italic" family="Times New Roman" weight="700" style="italic" stretch="normal" glyphs="timesbi.ttf"/>
<type name="Times-New-Roman-Italic" fullname="Times New Roman Italic" family="Times New Roman" weight="400" style="italic" stretch="normal" glyphs="timesi.ttf"/>
<type name="Times-New-Roman-MT-Extra-Bold" fullname="Times New Roman MT Extra Bold" family="Times New Roman MT" weight="800" style="normal" stretch="normal" glyphs="timnreb.ttf"/>
<type name="Verdana" fullname="Verdana" family="Verdana" weight="400" style="normal" stretch="normal" glyphs="verdana.ttf"/>
<type name="Verdana-Bold" fullname="Verdana Bold" family="Verdana" weight="700" style="normal" stretch="normal" glyphs="verdanab.ttf"/>
<type name="Verdana-Bold-Italic" fullname="Verdana Bold Italic" family="Verdana" weight="700" style="italic" stretch="normal" glyphs="verdanaz.ttf"/>
<type name="Verdana-Italic" fullname="Verdana Italic" family="Verdana" weight="400" style="italic" stretch="normal" glyphs="verdanai.ttf"/>
<type name="Wingdings" fullname="Wingdings" family="Wingdings" weight="400" style="normal" stretch="normal" glyphs="wingding.ttf" encoding="AppleRoman"/>
<type name="Wingdings-2" fullname="Wingdings 2" family="Wingdings 2" weight="400" style="normal" stretch="normal" glyphs="wingdng2.ttf" encoding="AppleRoman"/>
<type name="Wingdings-3" fullname="Wingdings 3" family="Wingdings 3" weight="400" style="normal" stretch="normal" glyphs="wingdng3.ttf" encoding="AppleRoman"/>
</typemap>
+21
View File
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE typemap [
<!ELEMENT typemap (type)+>
<!ELEMENT type (#PCDATA)>
<!ELEMENT include (#PCDATA)>
<!ATTLIST type name CDATA #REQUIRED>
<!ATTLIST type fullname CDATA #IMPLIED>
<!ATTLIST type family CDATA #IMPLIED>
<!ATTLIST type foundry CDATA #IMPLIED>
<!ATTLIST type weight CDATA #IMPLIED>
<!ATTLIST type style CDATA #IMPLIED>
<!ATTLIST type stretch CDATA #IMPLIED>
<!ATTLIST type format CDATA #IMPLIED>
<!ATTLIST type metrics CDATA #IMPLIED>
<!ATTLIST type glyphs CDATA #REQUIRED>
<!ATTLIST type version CDATA #IMPLIED>
<!ATTLIST include file CDATA #REQUIRED>
]>
<typemap>
<include file="type-ghostscript.xml" />
</typemap>
+58
View File
@@ -0,0 +1,58 @@
#!/bin/bash
mkdir -p ./{diffs,errors,failed,fulldownload,patched,results}
sudo find results/* -name "*" -delete
function run_test()
{
mkdir results/$1
./creatediffs.sh $2 $3
sudo cp -r diffs errors failed fulldownload patched results/$1
sudo mv RESULTS.txt results/$1
echo -e "[$test]\n$(cat results/$test/RESULTS.txt)\n" >> results/ALL_RESULTS.txt
}
# To write a test:
# run_test <folder_to_diff_files_from> <file_to_diff_with>
# This will attempt to create a diff from given file -> each file in folder
test="empty_test"
echo -e "[ Running emtpy->full file diff test ]"
echo -e "--------------------------------------\n"
run_test $test inputs/miscellaneous inputs/miscellaneous/empty_mem.c
test="text_tests"
echo -e "[ Running simple text file test ]"
echo -e "---------------------------------\n"
run_test $test inputs/text inputs/text/counter-api.txt
test="html_tests"
echo -e "[ Running html file diff test ]"
echo -e "-------------------------------\n"
run_test $test inputs/html inputs/html/840_update.html
test="xml_tests"
echo -e "[ Running xml file diff test ]"
echo -e "------------------------------\n"
run_test $test inputs/xml inputs/xml/log.xml
test="xml_html_tests"
echo -e "[ Running html -> xml file diff test ]"
echo -e "--------------------------------------\n"
run_test $test inputs/xml inputs/html/840_update.html
test="html_xml_tests"
echo -e "[ Running xml -> html file diff tests ]"
echo -e "---------------------------------------\n"
run_test $test inputs/html inputs/xml/log.xml
test="empty_to_xml"
echo -e "[ Running empty-> XML test ]"
echo -e "----------------------------\n"
run_test $test inputs/xml inputs/miscellaneous/empty_mem.c
test="empty_to_html"
echo -e "[ Running empty-> HTML test ]"
echo -e "-----------------------------\n"
run_test $test inputs/html inputs/miscellaneous/empty_mem.c
+6
View File
@@ -0,0 +1,6 @@
raw
bzip2
gzip
xz
zeros
any
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
set -e
rm -f web-dir/*/*.tar
tar -C web-dir/10 -cf web-dir/10/Manifest.MoM.tar Manifest.MoM Manifest.MoM.signed
tar -C web-dir/10 -cf web-dir/10/Manifest.test-bundle.tar Manifest.test-bundle Manifest.test-bundle.signed
sudo chown root:root web-dir/10/staged/24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af
tar -C web-dir/10 -cf web-dir/10/pack-test-bundle-from-0.tar staged/24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af --exclude=staged/24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af/*
@@ -0,0 +1,9 @@
NAME="Clear Linux Software for Intel Architecture"
VERSION=1
ID=clear-linux-os
VERSION_ID=10
PRETTY_NAME="Clear Linux Software for Intel Architecture"
ANSI_COLOR="1;35"
HOME_URL="https://clearlinux.org"
SUPPORT_URL="https://clearlinux.org"
BUG_REPORT_URL="https://bugs.clearlinux.org/jira"
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
set -e
sudo chown $(ls -l setup.sh | awk '{ print $3 ":" $4 }') web-dir/10/staged/24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af
sudo rmdir target-dir/usr/bin/
@@ -0,0 +1,9 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451940175
contentsize: 13805671819
M... 6259043bcbac93ffff65097ec52ba0e8658e8b2b7cdb99bd2939d639ee23209e 10 os-core
M... 0259043bcbac93ffff65097ec52ba0e8658e8b2b7cdb99bd2939d639ee23209e 10 test-bundle
@@ -0,0 +1,3 @@
-----BEGIN PKCS7-----
Empty
-----END PKCS7-----
@@ -0,0 +1,8 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
D... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin
@@ -0,0 +1,3 @@
-----BEGIN PKCS7-----
Empty
-----END PKCS7-----
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
set -e
rm -f web-dir/*/*.tar
tar -C web-dir/10 -cf web-dir/10/Manifest.MoM.tar Manifest.MoM Manifest.MoM.signed
tar -C web-dir/10 -cf web-dir/10/Manifest.os-core.tar Manifest.os-core Manifest.os-core.signed
@@ -0,0 +1,9 @@
NAME="Clear Linux Software for Intel Architecture"
VERSION=1
ID=clear-linux-os
VERSION_ID=10
PRETTY_NAME="Clear Linux Software for Intel Architecture"
ANSI_COLOR="1;35"
HOME_URL="https://clearlinux.org"
SUPPORT_URL="https://clearlinux.org"
BUG_REPORT_URL="https://bugs.clearlinux.org/jira"
@@ -0,0 +1,8 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451940175
contentsize: 13805671819
M... 6259043bcbac93ffff65097ec52ba0e8658e8b2b7cdb99bd2939d639ee23209e 10 os-core
@@ -0,0 +1,3 @@
-----BEGIN PKCS7-----
Empty
-----END PKCS7-----
@@ -0,0 +1,8 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
D... a4d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin
@@ -0,0 +1,3 @@
-----BEGIN PKCS7-----
Empty
-----END PKCS7-----
@@ -0,0 +1 @@
10
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
rm -f web-dir/*/*.tar
touch target-dir/test-file
touch target-dir/usr/share/clear/bundles/test-bundle
tar -C web-dir/10 -cf web-dir/10/Manifest.MoM.tar Manifest.MoM Manifest.MoM.signed
tar -C web-dir/10 -cf web-dir/10/Manifest.os-core.tar Manifest.os-core Manifest.os-core.signed
tar -C web-dir/10 -cf web-dir/10/Manifest.test-bundle.tar Manifest.test-bundle Manifest.test-bundle.signed
@@ -0,0 +1,9 @@
NAME="Clear Linux Software for Intel Architecture"
VERSION=1
ID=clear-linux-os
VERSION_ID=10
PRETTY_NAME="Clear Linux Software for Intel Architecture"
ANSI_COLOR="1;35"
HOME_URL="https://clearlinux.org"
SUPPORT_URL="https://clearlinux.org"
BUG_REPORT_URL="https://bugs.clearlinux.org/jira"
@@ -0,0 +1,9 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451940175
contentsize: 13805671819
M... 6259043bcbac93ffff65097ec52ba0e8658e8b2b7cdb99bd2939d639ee23209e 10 os-core
M... 0259043bcbac93ffff65097ec52ba0e8658e8b2b7cdb99bd2939d639ee23209e 10 test-bundle
@@ -0,0 +1,3 @@
-----BEGIN PKCS7-----
Empty
-----END PKCS7-----
@@ -0,0 +1,8 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
D... a4d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /usr/bin
@@ -0,0 +1,3 @@
-----BEGIN PKCS7-----
Empty
-----END PKCS7-----
@@ -0,0 +1,8 @@
MANIFEST 3
version: 10
previous: 0
filecount: 1
timestamp: 1451936779
contentsize: 17929151
F... 24d8955d9952c3fcb2241b0f8d225205a5861cec9757b3a075d34810da9b08af 10 /test-file
@@ -0,0 +1,3 @@
-----BEGIN PKCS7-----
Empty
-----END PKCS7-----
@@ -0,0 +1,9 @@
NAME="Clear Linux Software for Intel Architecture"
VERSION=1
ID=clear-linux-os
VERSION_ID=10
PRETTY_NAME="Clear Linux Software for Intel Architecture"
ANSI_COLOR="1;35"
HOME_URL="https://clearlinux.org"
SUPPORT_URL="https://clearlinux.org"
BUG_REPORT_URL="https://bugs.clearlinux.org/jira"

Some files were not shown because too many files have changed in this diff Show More