/*
*
* Licensed under the Academic Free License version 2.1
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <netdb.h>
#include <libhal.h>
#include <logger.h>
#include <glib.h>
#include "network-discovery.h"
void
{
char *element;
int i;
udi[0] = '\0';
if (element[0] != '/')
}
if (udi[i] == '.')
udi[i] = '_';
}
static int
{
void (*hndlr)(int);
alarm(1);
alarm(0);
return ((rc < 0) ? 1 : 0);
}
int
{
int errnum;
} else
return (-1);
}
static char *
{
int i, n = 0;
buf[0] = '\0';
return (buf);
}
static char *
{
return (NULL);
} else {
}
} else { /* use the IPv4 address */
}
}
int
{
goto out;
goto out;
if (manufacturer != NULL)
if (description != NULL)
/* commit the changes to the new UDI */
out:
if (manufacturer != NULL)
if (description != NULL)
if (dbus_error_is_set(&error)) {
}
return (rc);
}
static int
number_of_interfaces(int s)
{
struct lifnum n;
memset(&n, 0 , sizeof (n));
n.lifn_family = AF_INET;
if (ioctl(s, SIOCGLIFNUM, (char *)&n) == 0)
rc = n.lifn_count;
return (rc);
}
static char *
{
struct lifreq r;
memset(&r, 0, sizeof (r));
HAL_DEBUG(("broadcast_address: ioctl(SIOCGLIFFLAGS) failed."));
return (NULL);
}
return (NULL);
}
if (ioctl(s, SIOCGLIFBRDADDR, (char *)&r) >= 0) {
struct sockaddr_in *s =
(struct sockaddr_in *)&r.lifr_broadaddr;
}
return (result);
}
GList *
{
int s;
struct lifconf c;
int count;
return (NULL);
count = number_of_interfaces(s);
memset(&c, 0, sizeof (c));
c.lifc_family = AF_INET;
c.lifc_flags = 0;
if (ioctl(s, SIOCGLIFCONF, (char *)&c) == 0) {
}
}
close(s);
return (result);
}