X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=include%2Fiface.h;h=3530f23bc5671931979bdd90c93336085f13792b;hb=6d8e8898bd6b68dc07305b0e2b1d3e007fa37dfd;hp=ed85984bf6b5a22bdc252a1ad54a108f27913263;hpb=ca2197bc2724ed4534fc052d99d8815845d9315e;p=connman diff --git a/include/iface.h b/include/iface.h index ed85984..3530f23 100644 --- a/include/iface.h +++ b/include/iface.h @@ -2,7 +2,7 @@ * * Connection Manager * - * Copyright (C) 2007 Intel Corporation. All rights reserved. + * Copyright (C) 2007-2008 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 @@ -33,24 +33,52 @@ enum connman_iface_type { CONNMAN_IFACE_TYPE_80203 = 1, CONNMAN_IFACE_TYPE_80211 = 2, CONNMAN_IFACE_TYPE_WIMAX = 3, - CONNMAN_IFACE_TYPE_BLUETOOTH = 4, + CONNMAN_IFACE_TYPE_MODEM = 4, + CONNMAN_IFACE_TYPE_BLUETOOTH = 5, }; enum connman_iface_flags { - CONNMAN_IFACE_FLAG_RTNL = (1 << 0), - CONNMAN_IFACE_FLAG_IPV4 = (1 << 1), - CONNMAN_IFACE_FLAG_IPV6 = (1 << 2), - CONNMAN_IFACE_FLAG_CARRIER_DETECT = (1 << 3), + CONNMAN_IFACE_FLAG_RTNL = (1 << 0), + CONNMAN_IFACE_FLAG_IPV4 = (1 << 1), + CONNMAN_IFACE_FLAG_IPV6 = (1 << 2), + CONNMAN_IFACE_FLAG_SCANNING = (1 << 3), + CONNMAN_IFACE_FLAG_NOCARRIER = (1 << 4), + + CONNMAN_IFACE_FLAG_STARTED = (1 << 16), + CONNMAN_IFACE_FLAG_RUNNING = (1 << 17), + CONNMAN_IFACE_FLAG_DHCP = (1 << 18), }; enum connman_iface_state { CONNMAN_IFACE_STATE_UNKNOWN = 0, - CONNMAN_IFACE_STATE_ACTIVE = 1, - CONNMAN_IFACE_STATE_CONNECTED = 2, - CONNMAN_IFACE_STATE_READY = 3, + CONNMAN_IFACE_STATE_OFF = 1, + CONNMAN_IFACE_STATE_ENABLED = 2, + CONNMAN_IFACE_STATE_SCANNING = 3, + CONNMAN_IFACE_STATE_CONNECT = 4, + CONNMAN_IFACE_STATE_CONNECTED = 5, + CONNMAN_IFACE_STATE_CARRIER = 6, + CONNMAN_IFACE_STATE_CONFIGURE = 7, + CONNMAN_IFACE_STATE_READY = 8, + CONNMAN_IFACE_STATE_SHUTDOWN = 9, +}; + +enum connman_iface_policy { + CONNMAN_IFACE_POLICY_UNKNOWN = 0, + CONNMAN_IFACE_POLICY_OFF = 1, + CONNMAN_IFACE_POLICY_IGNORE = 2, + CONNMAN_IFACE_POLICY_AUTO = 3, + CONNMAN_IFACE_POLICY_ASK = 4, +}; + +enum connman_ipv4_method { + CONNMAN_IPV4_METHOD_UNKNOWN = 0, + CONNMAN_IPV4_METHOD_OFF = 1, + CONNMAN_IPV4_METHOD_STATIC = 2, + CONNMAN_IPV4_METHOD_DHCP = 3, }; struct connman_ipv4 { + enum connman_ipv4_method method; struct in_addr address; struct in_addr netmask; struct in_addr gateway; @@ -60,22 +88,30 @@ struct connman_ipv4 { }; struct connman_network { + struct connman_iface *iface; + char *path; + char *identifier; + char *passphrase; }; struct connman_iface { char *path; char *udi; char *sysfs; + char *identifier; int index; - int carrier; enum connman_iface_type type; - enum connman_iface_flags flags; + unsigned long flags; enum connman_iface_state state; + enum connman_iface_policy policy; + struct connman_network network; struct connman_ipv4 ipv4; struct connman_iface_driver *driver; void *driver_data; + void *rtnl_data; + struct { char *driver; char *vendor; @@ -86,22 +122,17 @@ struct connman_iface { struct connman_iface_driver { const char *name; const char *capability; + int (*probe) (struct connman_iface *iface); void (*remove) (struct connman_iface *iface); - int (*activate) (struct connman_iface *iface); - int (*shutdown) (struct connman_iface *iface); - int (*get_ipv4) (struct connman_iface *iface, - struct connman_ipv4 *ipv4); - int (*set_ipv4) (struct connman_iface *iface, - struct connman_ipv4 *ipv4); + + int (*start) (struct connman_iface *iface); + int (*stop) (struct connman_iface *iface); + int (*scan) (struct connman_iface *iface); int (*connect) (struct connman_iface *iface, struct connman_network *network); - - void (*set_network) (struct connman_iface *iface, - const char *network); - void (*set_passphrase) (struct connman_iface *iface, - const char *passphrase); + int (*disconnect) (struct connman_iface *iface); void (*rtnl_carrier) (struct connman_iface *iface, int carrier); void (*rtnl_wireless) (struct connman_iface *iface, @@ -122,11 +153,15 @@ static inline void connman_iface_set_data(struct connman_iface *iface, iface->driver_data = data; } -extern int connman_iface_update(struct connman_iface *iface, - enum connman_iface_state state); +extern void connman_iface_indicate_ifup(struct connman_iface *iface); +extern void connman_iface_indicate_ifdown(struct connman_iface *iface); +extern void connman_iface_indicate_connected(struct connman_iface *iface); +extern void connman_iface_indicate_carrier_on(struct connman_iface *iface); +extern void connman_iface_indicate_carrier_off(struct connman_iface *iface); +extern void connman_iface_indicate_configured(struct connman_iface *iface); -extern void connman_iface_indicate_carrier(struct connman_iface *iface, - int carrier); +extern void connman_iface_indicate_station(struct connman_iface *iface, + const char *name, int strength, int security); extern int connman_iface_get_ipv4(struct connman_iface *iface, struct connman_ipv4 *ipv4);