Taken from https://gitorious.org/connman/mainline.git