+
/*
*
* Connection Manager
*
- * Copyright (C) 2007-2009 Intel Corporation. All rights reserved.
+ * Copyright (C) 2007-2012 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
#ifndef __CONNMAN_NETWORK_H
#define __CONNMAN_NETWORK_H
+#include <stdint.h>
+
#include <connman/types.h>
#include <connman/device.h>
+#include <connman/ipconfig.h>
#ifdef __cplusplus
extern "C" {
enum connman_network_type {
CONNMAN_NETWORK_TYPE_UNKNOWN = 0,
- CONNMAN_NETWORK_TYPE_WIFI = 1,
+ CONNMAN_NETWORK_TYPE_ETHERNET = 1,
+ CONNMAN_NETWORK_TYPE_WIFI = 2,
CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN = 8,
CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN = 9,
- CONNMAN_NETWORK_TYPE_HSO = 23,
+ CONNMAN_NETWORK_TYPE_CELLULAR = 10,
CONNMAN_NETWORK_TYPE_VENDOR = 10000,
};
-enum connman_network_protocol {
- CONNMAN_NETWORK_PROTOCOL_UNKNOWN = 0,
- CONNMAN_NETWORK_PROTOCOL_IP = 1,
- CONNMAN_NETWORK_PROTOCOL_PPP = 2,
+enum connman_network_error {
+ CONNMAN_NETWORK_ERROR_UNKNOWN = 0,
+ CONNMAN_NETWORK_ERROR_ASSOCIATE_FAIL = 1,
+ CONNMAN_NETWORK_ERROR_CONFIGURE_FAIL = 2,
+ CONNMAN_NETWORK_ERROR_INVALID_KEY = 3,
+ CONNMAN_NETWORK_ERROR_CONNECT_FAIL = 4,
};
+#define CONNMAN_NETWORK_PRIORITY_LOW -100
+#define CONNMAN_NETWORK_PRIORITY_DEFAULT 0
+#define CONNMAN_NETWORK_PRIORITY_HIGH 100
+
struct connman_network;
-extern struct connman_network *connman_network_create(const char *identifier,
- enum connman_network_type type);
-extern struct connman_network *connman_network_ref(struct connman_network *network);
-extern void connman_network_unref(struct connman_network *network);
+struct connman_network *connman_network_create(const char *identifier,
+ enum connman_network_type type);
-extern const char *connman_network_get_identifier(struct connman_network *network);
+#define connman_network_ref(network) \
+ connman_network_ref_debug(network, __FILE__, __LINE__, __func__)
-extern const char *connman_network_get_path(struct connman_network *network);
-extern void connman_network_set_index(struct connman_network *network,
- int index);
-extern int connman_network_get_index(struct connman_network *network);
+#define connman_network_unref(network) \
+ connman_network_unref_debug(network, __FILE__, __LINE__, __func__)
-extern void connman_network_set_protocol(struct connman_network *network,
- enum connman_network_protocol protocol);
+struct connman_network *
+connman_network_ref_debug(struct connman_network *network,
+ const char *file, int line, const char *caller);
+void connman_network_unref_debug(struct connman_network *network,
+ const char *file, int line, const char *caller);
-extern int connman_network_set_available(struct connman_network *network,
- connman_bool_t available);
-extern connman_bool_t connman_network_get_available(struct connman_network *network);
-extern int connman_network_set_connected(struct connman_network *network,
- connman_bool_t connected);
-extern int connman_network_set_remember(struct connman_network *network,
- connman_bool_t remember);
-extern connman_bool_t connman_network_get_remember(struct connman_network *network);
+enum connman_network_type connman_network_get_type(struct connman_network *network);
+const char *connman_network_get_identifier(struct connman_network *network);
-extern int connman_network_connect(struct connman_network *network);
+void connman_network_set_index(struct connman_network *network, int index);
+int connman_network_get_index(struct connman_network *network);
-extern int connman_network_set_string(struct connman_network *network,
+void connman_network_set_group(struct connman_network *network,
+ const char *group);
+const char *connman_network_get_group(struct connman_network *network);
+
+connman_bool_t connman_network_get_connecting(struct connman_network *network);
+int connman_network_set_available(struct connman_network *network,
+ connman_bool_t available);
+connman_bool_t connman_network_get_available(struct connman_network *network);
+int connman_network_set_associating(struct connman_network *network,
+ connman_bool_t associating);
+void connman_network_set_error(struct connman_network *network,
+ enum connman_network_error error);
+void connman_network_clear_error(struct connman_network *network);
+int connman_network_set_connected(struct connman_network *network,
+ connman_bool_t connected);
+connman_bool_t connman_network_get_connected(struct connman_network *network);
+
+connman_bool_t connman_network_get_associating(struct connman_network *network);
+
+void connman_network_clear_hidden(void *user_data);
+int connman_network_connect_hidden(struct connman_network *network,
+ char *identity, char* passphrase, void *user_data);
+
+void connman_network_set_ipv4_method(struct connman_network *network,
+ enum connman_ipconfig_method method);
+void connman_network_set_ipv6_method(struct connman_network *network,
+ enum connman_ipconfig_method method);
+int connman_network_set_ipaddress(struct connman_network *network,
+ struct connman_ipaddress *ipaddress);
+int connman_network_set_nameservers(struct connman_network *network,
+ const char *nameservers);
+int connman_network_set_domain(struct connman_network *network,
+ const char *domain);
+int connman_network_set_name(struct connman_network *network,
+ const char *name);
+int connman_network_set_strength(struct connman_network *network,
+ uint8_t strength);
+uint8_t connman_network_get_strength(struct connman_network *network);
+int connman_network_set_frequency(struct connman_network *network,
+ uint16_t frequency);
+uint16_t connman_network_get_frequency(struct connman_network *network);
+int connman_network_set_wifi_channel(struct connman_network *network,
+ uint16_t channel);
+uint16_t connman_network_get_wifi_channel(struct connman_network *network);
+
+int connman_network_set_string(struct connman_network *network,
const char *key, const char *value);
-extern const char *connman_network_get_string(struct connman_network *network,
+const char *connman_network_get_string(struct connman_network *network,
const char *key);
-extern int connman_network_set_uint8(struct connman_network *network,
- const char *key, connman_uint8_t value);
-extern int connman_network_set_blob(struct connman_network *network,
+int connman_network_set_bool(struct connman_network *network,
+ const char *key, connman_bool_t value);
+connman_bool_t connman_network_get_bool(struct connman_network *network,
+ const char *key);
+int connman_network_set_blob(struct connman_network *network,
const char *key, const void *data, unsigned int size);
-extern const void *connman_network_get_blob(struct connman_network *network,
+const void *connman_network_get_blob(struct connman_network *network,
const char *key, unsigned int *size);
-extern struct connman_device *connman_network_get_device(struct connman_network *network);
+struct connman_device *connman_network_get_device(struct connman_network *network);
+
+void *connman_network_get_data(struct connman_network *network);
+void connman_network_set_data(struct connman_network *network, void *data);
-extern void *connman_network_get_data(struct connman_network *network);
-extern void connman_network_set_data(struct connman_network *network, void *data);
+void connman_network_update(struct connman_network *network);
struct connman_network_driver {
const char *name;
int (*disconnect) (struct connman_network *network);
};
-extern int connman_network_driver_register(struct connman_network_driver *driver);
-extern void connman_network_driver_unregister(struct connman_network_driver *driver);
+int connman_network_driver_register(struct connman_network_driver *driver);
+void connman_network_driver_unregister(struct connman_network_driver *driver);
#ifdef __cplusplus
}