NetworkManager/src/NetworkManagerUtils.h
Tambet Ingo 326d1e8679 2007-09-12 Tambet Ingo <tambet@gmail.com>
* src/vpn-manager/nm-vpn-connection.[ch]: 
        * src/vpn-manager/nm-vpn-manager.[ch]:
        * src/vpn-manager/nm-vpn-service.[ch]: Rewrite the vpn handling
        * code. Using 
        dbus-glib, GObjects, signals etc.

        * libnm-glib/nm-vpn-manager.[ch]: 
        * libnm-glib/nm-vpn-connection.[ch]: Now that the NM
        * implementation changed
        so much, rewrite these too.

        * libnm-glib/Makefile.am: Add new files to build, build new
        * binding files for
        the new introspection files.

        * libnm-glib/nm-client.[ch]: Remove all VPN related stuff from
        * here.

        * libnm-glib/nm-dbus-utils.[ch]: Renamed from nm-utils.[ch] that
        * was shadowing
        the header with the same name from libnm-utils.

        * libnm-glib/nm-vpn-plugin.[ch]: Implement.

        * libnm-util/Makefile.am: Add nm-utils.[ch] to build.

        * introspection/nm-vpn-plugin.xml: Implement.

        * introspection/nm-vpn-connection.xml: Implement.

        * introspection/nm-vpn-manager.xml: Implement.

        * src/NetworkManagerSystem.c
        * (nm_system_vpn_device_set_from_ip4_config): Remove
        the named manager argument, it can just as easily get it as the
caller.
        (nm_system_vpn_device_unset_from_ip4_config): Ditto.

        * src/vpn-manager/nm-dbus-vpn.[ch]: Remove.

        * src/nm-dbus-manager.h: Fix up the name_owner signal signature.

        * src/dhcp-manager/nm-dhcp-manager.c (garray_to_string): Remove,
        * use one from
        libnm-utils.

        * libnm-util/nm-connection.c: Ditto.

        * src/NetworkManagerMain.h: Remove, it's finally empty.

        * configure.in: Remove utils/ from build.

        * include/NetworkManagerVPN.h: Add some more defines to reduce
        * the amount
        of hard-coded strings.

        * utils/: Move it over to libnm-util.

        * test/Makefile.am: Link against libnm-util now that util/ is
        * gone.

        * dispatcher-daemon/Makefile.am: Ditto.

        * src/Makefile.am: Ditto.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2798 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-09-12 16:23:53 +00:00

118 lines
3.5 KiB
C

/* NetworkManager -- Network link manager
*
* Dan Williams <dcbw@redhat.com>
*
* 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; either version 2 of the License, or
* (at your option) any later version.
*
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* (C) Copyright 2004 Red Hat, Inc.
*/
#ifndef NETWORK_MANAGER_UTILS_H
#define NETWORK_MANAGER_UTILS_H
#include <glib.h>
#include <stdio.h>
#include <syslog.h>
#include <net/ethernet.h>
#include <iwlib.h>
#include <sys/time.h>
#include <stdarg.h>
#include "NetworkManager.h"
#include "nm-device.h"
typedef enum SockType
{
DEV_WIRELESS,
DEV_GENERAL,
NETWORK_CONTROL
} SockType;
typedef struct NMSock NMSock;
NMSock * nm_dev_sock_open (const char *iface,
SockType type,
const char *func_name,
const char *desc);
void nm_dev_sock_close (NMSock *sock);
int nm_dev_sock_get_fd (NMSock *sock);
void nm_print_open_socks (void);
int nm_null_safe_strcmp (const char *s1, const char *s2);
gboolean nm_ethernet_address_is_valid (const struct ether_addr *test_addr);
gboolean nm_ethernet_addresses_are_equal (const struct ether_addr *a, const struct ether_addr *b);
int nm_spawn_process (const char *args);
void nm_print_device_capabilities (NMDevice *dev);
#define NM_COMPLETION_TRIES_INFINITY -1
typedef void * nm_completion_args[8];
typedef gboolean (*nm_completion_func)(int tries, nm_completion_args args);
typedef gboolean (*nm_completion_boolean_function_1)(u_int64_t arg);
typedef gboolean (*nm_completion_boolean_function_2)(
u_int64_t arg0, u_int64_t arg1);
void nm_wait_for_completion(
const int max_tries,
const guint interval_usecs,
nm_completion_func test_func,
nm_completion_func action_func,
nm_completion_args args);
void nm_wait_for_completion_or_timeout(
const int max_tries,
const struct timeval *max_time,
const guint interval_usecs,
nm_completion_func test_func,
nm_completion_func action_func,
nm_completion_args args);
void nm_wait_for_timeout(
const struct timeval *max_time,
const guint interval_usecs,
nm_completion_func test_func,
nm_completion_func action_func,
nm_completion_args args);
gboolean nm_completion_boolean_test(int tries, nm_completion_args args);
gboolean nm_completion_boolean_function1_test(int tries,
nm_completion_args args);
gboolean nm_completion_boolean_function2_test(int tries,
nm_completion_args args);
#define nm_completion_boolean_function_test nm_completion_boolean_function1_test
gchar* nm_utils_inet_ip4_address_as_string (guint32 ip);
struct nl_addr * nm_utils_ip4_addr_to_nl_addr (guint32 ip4_addr);
int nm_utils_ip4_netmask_to_prefix (guint32 ip4_netmask);
gboolean nm_utils_is_empty_ssid (const char * ssid, int len);
const char * nm_utils_escape_ssid (const guint8 *ssid, guint32 len);
gboolean nm_utils_same_ssid (const GByteArray * ssid1,
const GByteArray * ssid2,
gboolean ignore_trailing_null);
char * nm_utils_hexstr2bin (const char *hex, size_t len);
#endif