[connman] dnsproxy: Prefer responses with ancount>0 if append_domain is true

If domain_append is true and a valid domain tld (eg. com. net. bz.)
is queried we need to make sure that responses with ancount>0 are
preferred over ones with ancount==0. This is due queries againts
valid domain tld's will always have response code ns_r_noerror even
there are no valid records. This will solve the issue dnsproxy not
returning the expected response if hostname queried is equal to any
valid tld.
Merge pull request #97 from tigeli/dns_reply

[connman] dnsproxy: Prefer responses with ancount>0 if append_domain is true
AUTHORS: Mention Alexandru's contributions
AUTHORS: Mention Pasi's contributions
dnsproxy: Fix for queries without domain name part

If user does a DNS query to hostname without domain part, then
ConnMan will generate two queries, one without domain part and
one with configured domain name. When the result has been returned
the dnsproxy code then strips away the domain name part from the
result so that the DNS client will get data in correct format.

If the result DNS packet contains compressed data, this stripping will
cause problems as the DNS packet will get corrupted. So in this case
what we will need to do is to uncompress the DNS data, then strip away
the domain part from the answer and re-create the query result.
dnsproxy: Uncompressed label was not set to internal format

The label was uncompressed by dn_expand() which changes label
lengths to dots but the dots were not set back to length bytes
later.
dnsproxy: Remove domain part from answers

If user resolver tries to resolve a name without domain part,
then glibc gethostbyname() expects that returned answers do
not contain any domain name either. The getaddrinfo() works
differently and accepts FQDN in answers.
dnsproxy: Use defined error codes instead of plain numbers for rcode

The DNS return codes (rcode) are defined in arpa/nameser.h so
use them instead of hard coded values.
dhcp: Keep the retry timeout nor the ipv4ll task in dhcp_invalidate

dhcp_invalidate is called it no_lease_cb, which one actually starts the
retry callback and the ipv4ll task, thus this is bogus to remove them
right after.
[connman] service: check for 32-bit counter wraparound

Depending on device driver implementation, network statistics counters
may wrap around at 4 GiB on a 32-bit kernel. To work around this,
check for wraparound when updating statistics. Since there is no other
way to reset network statistics than to unload drivers there should not
be much chance for false positives in wraparound detection.

Of course, only a single wraparound can be detected so counters need
to be updated frequently enough.
Merge pull request #99 from tigeli/merge2upstream

patches from upstream
Merge pull request #100 from hmallat/wraparound-check-for-32bit-counters

[connman] service: check for 32-bit counter wraparound
[connman] Append extra wifi service properties

This commit contains two patches:

From a5eded6f3a9cff14ab19ee696ce27cedd633cca3 Mon Sep 17 00:00:00 2001
From: Arron Wang <arron.wang@intel.com>
Date: Mon, 24 Sep 2012 14:42:02 +0800
Subject: [PATCH 04/63] Tizen: Append extra wifi service property

Append wifi property bssid, maxrate, frequency, encryptionmode to wifi
service

From 0b571435f46d1c2acbe154c43d2e2b28403694c2 Mon Sep 17 00:00:00 2001
From: Arron Wang <arron.wang@intel.com>
Date: Mon, 24 Sep 2012 14:18:07 +0800
Subject: [PATCH 03/63] Tizen: Export more wifi info in ConnMan network
API

Network client requires additional wifi specific info

Export the BSSID property
Export the MaxRate property
Export the detailed info for encryption mode(mixed,aes,tkip,wep,none)

Export the connman_network get/set method for bssid, maxrate,
encryption_mode property
[connman] gdhcp: adjust discovery/request timeout and retry values

Some dhcp servers are acting lazy (eg. Buffalo WBMR-G125)
therefore 3 second timeout value for discovery or request
is not enough. Adjusting the timeout value from 3 seconds
to 5 will fix the problem together with adjusting the
retry value not to increase the total time for waiting
for getting the lease.
Merge pull request #103 from tigeli/dhcpdiscovery

[connman] gdhcp: adjust discovery/request timeout and retry values
Merge pull request #102 from lpotter/bssid

[connman] Append extra wifi service properties
[connman] Export the Hidden property for wifi services
Merge pull request #104 from lpotter/master

[connman] Export the Hidden property for wifi services
[connman] plugins: Create an interface for wakeup timers

Mobile phones and other battery-powered systems may suspend often and
for long periods of time. However, connman may need to perform
scheduled operations such as DHCP renewal at specific times regardless
of whether the system is suspended or not.

Provide a plugin interface for implementing wakeup timers which can be
used to request the system to wake up from suspend at a given
time. These timers are intended for relatively infrequent events which
do not need high timing precision, not as general purpose replacement
for g_timeout functions, as wakeup from suspend can be a slow and
expensive operation.

If no wakeup timer is implemented, regular glib timeouts are used.

Note that only one wakeup timer plugin may be registered at a time.
[connman] plugins: Implement IPHB wakeup timer

Implement a wakeup timer based on libiphb (DSME).