2002-05-30 01:40:29 +00:00
|
|
|
/*
|
2005-09-14 20:46:50 +00:00
|
|
|
* Asterisk -- An open source telephony toolkit.
|
2002-05-30 01:40:29 +00:00
|
|
|
*
|
2006-03-28 03:28:52 +00:00
|
|
|
* Copyright (C) 1999 - 2006, Digium, Inc.
|
2002-05-30 01:40:29 +00:00
|
|
|
*
|
2005-07-19 23:17:02 +00:00
|
|
|
* Mark Spencer <markster@digium.com>
|
2002-05-30 01:40:29 +00:00
|
|
|
*
|
2005-09-14 20:46:50 +00:00
|
|
|
* See http://www.asterisk.org for more information about
|
|
|
|
* the Asterisk project. Please do not directly contact
|
|
|
|
* any of the maintainers of this project for assistance;
|
|
|
|
* the project provides a web site, mailing lists and IRC
|
|
|
|
* channels for your use.
|
|
|
|
*
|
2002-05-30 01:40:29 +00:00
|
|
|
* This program is free software, distributed under the terms of
|
2005-09-14 20:46:50 +00:00
|
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
|
|
* at the top of the source tree.
|
|
|
|
*/
|
|
|
|
|
2005-10-24 20:12:06 +00:00
|
|
|
/*! \file
|
2005-09-14 20:46:50 +00:00
|
|
|
*
|
2005-10-24 20:12:06 +00:00
|
|
|
* \brief Various sorts of access control
|
2005-12-30 21:18:06 +00:00
|
|
|
*
|
2006-03-28 13:58:34 +00:00
|
|
|
* \author Mark Spencer <markster@digium.com>
|
2002-05-30 01:40:29 +00:00
|
|
|
*/
|
|
|
|
|
2006-06-07 18:54:56 +00:00
|
|
|
#include "asterisk.h"
|
|
|
|
|
|
|
|
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|
|
|
|
2002-05-30 01:40:29 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <unistd.h>
|
2005-05-04 04:35:27 +00:00
|
|
|
#include <netinet/in.h>
|
2002-05-30 01:40:29 +00:00
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netdb.h>
|
2003-05-04 05:52:52 +00:00
|
|
|
#include <net/if.h>
|
2005-08-09 16:41:28 +00:00
|
|
|
#include <netinet/in.h>
|
2003-05-04 05:52:52 +00:00
|
|
|
#include <netinet/in_systm.h>
|
|
|
|
#include <netinet/ip.h>
|
|
|
|
#include <sys/ioctl.h>
|
2005-04-22 13:11:34 +00:00
|
|
|
|
2004-02-02 06:39:23 +00:00
|
|
|
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
|
2003-10-22 04:09:28 +00:00
|
|
|
#include <fcntl.h>
|
2003-10-22 03:10:34 +00:00
|
|
|
#include <net/route.h>
|
|
|
|
#endif
|
2002-05-30 01:40:29 +00:00
|
|
|
|
2005-09-08 02:24:02 +00:00
|
|
|
#if defined(SOLARIS)
|
2004-12-14 23:36:30 +00:00
|
|
|
#include <sys/sockio.h>
|
2005-09-08 02:24:02 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* netinet/ip.h may not define the following (See RFCs 791 and 1349) */
|
|
|
|
#if !defined(IPTOS_LOWCOST)
|
2005-08-11 05:39:09 +00:00
|
|
|
#define IPTOS_LOWCOST 0x02
|
2005-09-08 02:24:02 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(IPTOS_MINCOST)
|
2005-08-11 05:39:09 +00:00
|
|
|
#define IPTOS_MINCOST IPTOS_LOWCOST
|
2004-12-14 23:36:30 +00:00
|
|
|
#endif
|
|
|
|
|
2005-04-22 13:11:34 +00:00
|
|
|
#include "asterisk/acl.h"
|
|
|
|
#include "asterisk/logger.h"
|
|
|
|
#include "asterisk/channel.h"
|
|
|
|
#include "asterisk/options.h"
|
|
|
|
#include "asterisk/utils.h"
|
|
|
|
#include "asterisk/lock.h"
|
|
|
|
#include "asterisk/srv.h"
|
|
|
|
|
2002-05-30 01:40:29 +00:00
|
|
|
struct ast_ha {
|
|
|
|
/* Host access rule */
|
|
|
|
struct in_addr netaddr;
|
|
|
|
struct in_addr netmask;
|
|
|
|
int sense;
|
|
|
|
struct ast_ha *next;
|
|
|
|
};
|
|
|
|
|
2003-05-04 05:52:52 +00:00
|
|
|
struct my_ifreq {
|
|
|
|
char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "eth0", "ppp0", etc. */
|
|
|
|
struct sockaddr_in ifru_addr;
|
|
|
|
};
|
|
|
|
|
2004-05-27 20:53:02 +00:00
|
|
|
/* Free HA structure */
|
2002-05-30 01:40:29 +00:00
|
|
|
void ast_free_ha(struct ast_ha *ha)
|
|
|
|
{
|
|
|
|
struct ast_ha *hal;
|
2006-07-10 19:05:48 +00:00
|
|
|
while (ha) {
|
2002-05-30 01:40:29 +00:00
|
|
|
hal = ha;
|
|
|
|
ha = ha->next;
|
|
|
|
free(hal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-05-27 20:53:02 +00:00
|
|
|
/* Copy HA structure */
|
|
|
|
static void ast_copy_ha(struct ast_ha *from, struct ast_ha *to)
|
2004-06-22 20:11:15 +00:00
|
|
|
{
|
|
|
|
memcpy(&to->netaddr, &from->netaddr, sizeof(from->netaddr));
|
|
|
|
memcpy(&to->netmask, &from->netmask, sizeof(from->netmask));
|
|
|
|
to->sense = from->sense;
|
|
|
|
}
|
2004-05-27 20:53:02 +00:00
|
|
|
|
|
|
|
/* Create duplicate of ha structure */
|
|
|
|
static struct ast_ha *ast_duplicate_ha(struct ast_ha *original)
|
|
|
|
{
|
2006-02-14 22:28:01 +00:00
|
|
|
struct ast_ha *new_ha;
|
|
|
|
|
|
|
|
if ((new_ha = ast_malloc(sizeof(*new_ha)))) {
|
|
|
|
/* Copy from original to new object */
|
|
|
|
ast_copy_ha(original, new_ha);
|
|
|
|
}
|
2004-05-27 20:53:02 +00:00
|
|
|
|
2005-07-19 23:35:45 +00:00
|
|
|
return new_ha;
|
2004-05-27 20:53:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Create duplicate HA link list */
|
|
|
|
/* Used in chan_sip2 templates */
|
|
|
|
struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original)
|
|
|
|
{
|
2006-07-10 19:05:48 +00:00
|
|
|
struct ast_ha *start = original;
|
2004-05-27 20:53:02 +00:00
|
|
|
struct ast_ha *ret = NULL;
|
2006-07-10 19:05:48 +00:00
|
|
|
struct ast_ha *link, *prev = NULL;
|
2004-05-27 20:53:02 +00:00
|
|
|
|
2005-07-19 23:35:45 +00:00
|
|
|
while (start) {
|
2004-05-27 20:53:02 +00:00
|
|
|
link = ast_duplicate_ha(start); /* Create copy of this object */
|
2004-05-27 21:31:25 +00:00
|
|
|
if (prev)
|
|
|
|
prev->next = link; /* Link previous to this object */
|
2004-05-27 20:53:02 +00:00
|
|
|
|
2006-03-28 13:58:34 +00:00
|
|
|
if (!ret)
|
2004-05-27 20:53:02 +00:00
|
|
|
ret = link; /* Save starting point */
|
|
|
|
|
2004-06-22 20:11:15 +00:00
|
|
|
start = start->next; /* Go to next object */
|
|
|
|
prev = link; /* Save pointer to this object */
|
|
|
|
}
|
2005-07-19 23:35:45 +00:00
|
|
|
return ret; /* Return start of list */
|
2004-05-27 20:53:02 +00:00
|
|
|
}
|
|
|
|
|
2007-01-01 19:20:46 +00:00
|
|
|
struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path, int *error)
|
2002-05-30 01:40:29 +00:00
|
|
|
{
|
2006-02-14 22:28:01 +00:00
|
|
|
struct ast_ha *ha;
|
2005-07-19 23:35:45 +00:00
|
|
|
char *nm = "255.255.255.255";
|
2005-09-07 21:01:31 +00:00
|
|
|
char tmp[256];
|
2002-05-30 01:40:29 +00:00
|
|
|
struct ast_ha *prev = NULL;
|
|
|
|
struct ast_ha *ret;
|
2005-07-19 23:35:45 +00:00
|
|
|
int x, z;
|
2006-03-28 13:58:34 +00:00
|
|
|
unsigned int y;
|
2006-02-14 22:28:01 +00:00
|
|
|
|
2002-05-30 01:40:29 +00:00
|
|
|
ret = path;
|
2005-07-19 23:35:45 +00:00
|
|
|
while (path) {
|
2002-05-30 01:40:29 +00:00
|
|
|
prev = path;
|
|
|
|
path = path->next;
|
|
|
|
}
|
2006-02-14 22:28:01 +00:00
|
|
|
if ((ha = ast_malloc(sizeof(*ha)))) {
|
2005-07-10 22:56:21 +00:00
|
|
|
ast_copy_string(tmp, stuff, sizeof(tmp));
|
2004-01-10 21:19:56 +00:00
|
|
|
nm = strchr(tmp, '/');
|
2005-07-19 23:35:45 +00:00
|
|
|
if (!nm) {
|
2002-05-30 01:40:29 +00:00
|
|
|
nm = "255.255.255.255";
|
2005-07-19 23:35:45 +00:00
|
|
|
} else {
|
2004-01-10 21:19:56 +00:00
|
|
|
*nm = '\0';
|
|
|
|
nm++;
|
|
|
|
}
|
2004-01-10 21:43:17 +00:00
|
|
|
if (!strchr(nm, '.')) {
|
2005-04-29 17:00:33 +00:00
|
|
|
if ((sscanf(nm, "%d", &x) == 1) && (x >= 0) && (x <= 32)) {
|
2004-01-10 21:43:17 +00:00
|
|
|
y = 0;
|
2006-07-10 19:05:48 +00:00
|
|
|
for (z = 0; z < x; z++) {
|
2004-01-10 21:43:17 +00:00
|
|
|
y >>= 1;
|
2004-01-10 22:19:31 +00:00
|
|
|
y |= 0x80000000;
|
2004-01-10 21:43:17 +00:00
|
|
|
}
|
|
|
|
ha->netmask.s_addr = htonl(y);
|
|
|
|
}
|
|
|
|
} else if (!inet_aton(nm, &ha->netmask)) {
|
2005-01-17 22:53:36 +00:00
|
|
|
ast_log(LOG_WARNING, "%s is not a valid netmask\n", nm);
|
2007-01-01 19:20:46 +00:00
|
|
|
if (error)
|
|
|
|
*error = 1;
|
2002-05-30 01:40:29 +00:00
|
|
|
free(ha);
|
2006-10-13 23:03:36 +00:00
|
|
|
return ret;
|
2002-05-30 01:40:29 +00:00
|
|
|
}
|
2004-01-10 21:43:17 +00:00
|
|
|
if (!inet_aton(tmp, &ha->netaddr)) {
|
2005-01-17 22:53:36 +00:00
|
|
|
ast_log(LOG_WARNING, "%s is not a valid IP\n", tmp);
|
2007-01-01 19:20:46 +00:00
|
|
|
if (error)
|
|
|
|
*error = 1;
|
2002-05-30 01:40:29 +00:00
|
|
|
free(ha);
|
2006-10-13 23:03:36 +00:00
|
|
|
return ret;
|
2002-05-30 01:40:29 +00:00
|
|
|
}
|
|
|
|
ha->netaddr.s_addr &= ha->netmask.s_addr;
|
|
|
|
if (!strncasecmp(sense, "p", 1)) {
|
|
|
|
ha->sense = AST_SENSE_ALLOW;
|
|
|
|
} else {
|
|
|
|
ha->sense = AST_SENSE_DENY;
|
|
|
|
}
|
|
|
|
ha->next = NULL;
|
2005-07-19 23:35:45 +00:00
|
|
|
if (prev) {
|
2002-05-30 01:40:29 +00:00
|
|
|
prev->next = ha;
|
2005-07-19 23:35:45 +00:00
|
|
|
} else {
|
2002-05-30 01:40:29 +00:00
|
|
|
ret = ha;
|
2005-07-19 23:35:45 +00:00
|
|
|
}
|
2002-05-30 01:40:29 +00:00
|
|
|
}
|
2007-01-01 19:20:46 +00:00
|
|
|
if (option_debug)
|
|
|
|
ast_log(LOG_DEBUG, "%s/%s appended to acl for peer\n", stuff, nm);
|
2003-05-05 06:14:25 +00:00
|
|
|
return ret;
|
2002-05-30 01:40:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin)
|
|
|
|
{
|
|
|
|
/* Start optimistic */
|
|
|
|
int res = AST_SENSE_ALLOW;
|
2005-07-19 23:35:45 +00:00
|
|
|
while (ha) {
|
2004-06-30 16:56:51 +00:00
|
|
|
char iabuf[INET_ADDRSTRLEN];
|
|
|
|
char iabuf2[INET_ADDRSTRLEN];
|
2004-05-27 20:53:02 +00:00
|
|
|
/* DEBUG */
|
2006-07-21 17:31:28 +00:00
|
|
|
ast_copy_string(iabuf, ast_inet_ntoa(sin->sin_addr), sizeof(iabuf));
|
|
|
|
ast_copy_string(iabuf2, ast_inet_ntoa(ha->netaddr), sizeof(iabuf2));
|
2007-02-11 19:15:55 +00:00
|
|
|
if (option_debug)
|
|
|
|
ast_log(LOG_DEBUG, "##### Testing %s with %s\n", iabuf, iabuf2);
|
2002-05-30 01:40:29 +00:00
|
|
|
/* For each rule, if this address and the netmask = the net address
|
|
|
|
apply the current rule */
|
2005-07-19 23:35:45 +00:00
|
|
|
if ((sin->sin_addr.s_addr & ha->netmask.s_addr) == ha->netaddr.s_addr)
|
2002-05-30 01:40:29 +00:00
|
|
|
res = ha->sense;
|
|
|
|
ha = ha->next;
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2004-12-03 23:34:45 +00:00
|
|
|
int ast_get_ip_or_srv(struct sockaddr_in *sin, const char *value, const char *service)
|
2002-05-30 01:40:29 +00:00
|
|
|
{
|
|
|
|
struct hostent *hp;
|
2004-04-22 00:20:34 +00:00
|
|
|
struct ast_hostent ahp;
|
2004-12-03 23:34:45 +00:00
|
|
|
char srv[256];
|
|
|
|
char host[256];
|
|
|
|
int tportno = ntohs(sin->sin_port);
|
|
|
|
if (service) {
|
|
|
|
snprintf(srv, sizeof(srv), "%s.%s", service, value);
|
|
|
|
if (ast_get_srv(NULL, host, sizeof(host), &tportno, srv) > 0) {
|
|
|
|
sin->sin_port = htons(tportno);
|
|
|
|
value = host;
|
|
|
|
}
|
|
|
|
}
|
2004-04-22 00:20:34 +00:00
|
|
|
hp = ast_gethostbyname(value, &ahp);
|
2002-05-30 01:40:29 +00:00
|
|
|
if (hp) {
|
|
|
|
memcpy(&sin->sin_addr, hp->h_addr, sizeof(sin->sin_addr));
|
|
|
|
} else {
|
|
|
|
ast_log(LOG_WARNING, "Unable to lookup '%s'\n", value);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-03-28 03:28:52 +00:00
|
|
|
struct dscp_codepoint {
|
|
|
|
char *name;
|
|
|
|
unsigned int space;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* IANA registered DSCP codepoints */
|
|
|
|
|
|
|
|
static const struct dscp_codepoint dscp_pool1[] = {
|
|
|
|
{ "CS0", 0x00 },
|
|
|
|
{ "CS1", 0x08 },
|
|
|
|
{ "CS2", 0x10 },
|
|
|
|
{ "CS3", 0x18 },
|
|
|
|
{ "CS4", 0x20 },
|
|
|
|
{ "CS5", 0x28 },
|
|
|
|
{ "CS6", 0x30 },
|
|
|
|
{ "CS7", 0x38 },
|
|
|
|
{ "AF11", 0x0A },
|
|
|
|
{ "AF12", 0x0C },
|
|
|
|
{ "AF13", 0x0E },
|
|
|
|
{ "AF21", 0x12 },
|
|
|
|
{ "AF22", 0x14 },
|
|
|
|
{ "AF23", 0x16 },
|
|
|
|
{ "AF31", 0x1A },
|
|
|
|
{ "AF32", 0x1C },
|
|
|
|
{ "AF33", 0x1E },
|
|
|
|
{ "AF41", 0x22 },
|
|
|
|
{ "AF42", 0x24 },
|
|
|
|
{ "AF43", 0x26 },
|
|
|
|
{ "EF", 0x2E },
|
|
|
|
};
|
2007-04-30 16:16:26 +00:00
|
|
|
|
|
|
|
int ast_str2cos(const char *value, unsigned int *cos)
|
|
|
|
{
|
|
|
|
int fval;
|
|
|
|
|
|
|
|
if (sscanf(value, "%d", &fval) == 1) {
|
|
|
|
if (fval < 8) {
|
|
|
|
*cos = fval;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
2006-03-28 03:28:52 +00:00
|
|
|
|
|
|
|
int ast_str2tos(const char *value, unsigned int *tos)
|
2005-08-09 16:41:28 +00:00
|
|
|
{
|
|
|
|
int fval;
|
2006-03-28 03:28:52 +00:00
|
|
|
unsigned int x;
|
|
|
|
|
|
|
|
if (sscanf(value, "%i", &fval) == 1) {
|
|
|
|
*tos = fval & 0xFF;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
|
|
|
|
if (!strcasecmp(value, dscp_pool1[x].name)) {
|
|
|
|
*tos = dscp_pool1[x].space << 2;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-21 22:23:49 +00:00
|
|
|
return -1;
|
2005-08-09 16:41:28 +00:00
|
|
|
}
|
|
|
|
|
2006-03-28 03:28:52 +00:00
|
|
|
const char *ast_tos2str(unsigned int tos)
|
|
|
|
{
|
|
|
|
unsigned int x;
|
|
|
|
|
2006-09-21 22:23:49 +00:00
|
|
|
for (x = 0; x < sizeof(dscp_pool1) / sizeof(dscp_pool1[0]); x++) {
|
|
|
|
if (dscp_pool1[x].space == (tos >> 2))
|
|
|
|
return dscp_pool1[x].name;
|
2006-03-28 03:28:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return "unknown";
|
|
|
|
}
|
|
|
|
|
2004-12-03 23:34:45 +00:00
|
|
|
int ast_get_ip(struct sockaddr_in *sin, const char *value)
|
|
|
|
{
|
|
|
|
return ast_get_ip_or_srv(sin, value, NULL);
|
|
|
|
}
|
|
|
|
|
2003-05-04 05:52:52 +00:00
|
|
|
int ast_ouraddrfor(struct in_addr *them, struct in_addr *us)
|
|
|
|
{
|
2004-12-18 21:54:58 +00:00
|
|
|
int s;
|
|
|
|
struct sockaddr_in sin;
|
|
|
|
socklen_t slen;
|
2003-10-22 03:10:34 +00:00
|
|
|
|
2004-12-18 21:54:58 +00:00
|
|
|
s = socket(PF_INET, SOCK_DGRAM, 0);
|
2005-07-08 14:27:39 +00:00
|
|
|
if (s < 0) {
|
2004-12-18 21:54:58 +00:00
|
|
|
ast_log(LOG_WARNING, "Cannot create socket\n");
|
2003-10-22 03:10:34 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2005-01-11 17:08:52 +00:00
|
|
|
sin.sin_family = AF_INET;
|
|
|
|
sin.sin_port = 5060;
|
2004-12-18 21:54:58 +00:00
|
|
|
sin.sin_addr = *them;
|
|
|
|
if (connect(s, (struct sockaddr *)&sin, sizeof(sin))) {
|
|
|
|
ast_log(LOG_WARNING, "Cannot connect\n");
|
2004-12-28 07:44:13 +00:00
|
|
|
close(s);
|
2003-10-22 03:10:34 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2004-12-18 21:54:58 +00:00
|
|
|
slen = sizeof(sin);
|
|
|
|
if (getsockname(s, (struct sockaddr *)&sin, &slen)) {
|
|
|
|
ast_log(LOG_WARNING, "Cannot get socket name\n");
|
2004-12-28 07:44:13 +00:00
|
|
|
close(s);
|
2003-10-22 03:10:34 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2003-10-22 04:09:28 +00:00
|
|
|
close(s);
|
2004-12-18 21:54:58 +00:00
|
|
|
*us = sin.sin_addr;
|
2003-05-04 05:52:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2005-01-11 17:08:52 +00:00
|
|
|
|
2005-02-09 03:22:42 +00:00
|
|
|
int ast_find_ourip(struct in_addr *ourip, struct sockaddr_in bindaddr)
|
|
|
|
{
|
2005-07-19 23:35:45 +00:00
|
|
|
char ourhost[MAXHOSTNAMELEN] = "";
|
2005-02-09 03:22:42 +00:00
|
|
|
struct ast_hostent ahp;
|
|
|
|
struct hostent *hp;
|
|
|
|
struct in_addr saddr;
|
|
|
|
|
|
|
|
/* just use the bind address if it is nonzero */
|
|
|
|
if (ntohl(bindaddr.sin_addr.s_addr)) {
|
|
|
|
memcpy(ourip, &bindaddr.sin_addr, sizeof(*ourip));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* try to use our hostname */
|
2005-07-19 23:35:45 +00:00
|
|
|
if (gethostname(ourhost, sizeof(ourhost) - 1)) {
|
2005-02-09 03:22:42 +00:00
|
|
|
ast_log(LOG_WARNING, "Unable to get hostname\n");
|
|
|
|
} else {
|
|
|
|
hp = ast_gethostbyname(ourhost, &ahp);
|
|
|
|
if (hp) {
|
|
|
|
memcpy(ourip, hp->h_addr, sizeof(*ourip));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* A.ROOT-SERVERS.NET. */
|
|
|
|
if (inet_aton("198.41.0.4", &saddr) && !ast_ouraddrfor(&saddr, ourip))
|
|
|
|
return 0;
|
|
|
|
return -1;
|
|
|
|
}
|
2006-07-10 19:05:48 +00:00
|
|
|
|