[Olsr-cvs] olsrd-current/lib/nameservice/src nameservice.h, 1.10, 1.11 nameservice.c, 1.17, 1.18
Bernd Petrovitsch
(spam-protected)
Tue Feb 6 22:07:13 CET 2007
Update of /cvsroot/olsrd/olsrd-current/lib/nameservice/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21704/lib/nameservice/src
Modified Files:
nameservice.h nameservice.c
Log Message:
* killed in_addr
Index: nameservice.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/src/nameservice.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** nameservice.h 4 Feb 2007 21:11:48 -0000 1.10
--- nameservice.h 6 Feb 2007 21:07:11 -0000 1.11
***************
*** 119,123 ****
struct name_entry*
! add_name_to_list(struct name_entry *my_list, char *value, int type, struct in_addr *ip);
struct name_entry*
--- 119,123 ----
struct name_entry*
! add_name_to_list(struct name_entry *my_list, char *value, int type, const union olsr_ip_addr *ip);
struct name_entry*
Index: nameservice.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/src/nameservice.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** nameservice.c 4 Feb 2007 21:11:48 -0000 1.17
--- nameservice.c 6 Feb 2007 21:07:11 -0000 1.18
***************
*** 184,192 ****
}
else if(!strcmp(key, "dns-server")) {
! struct in_addr ip;
if (strlen(value) == 0) {
my_forwarders = add_name_to_list(my_forwarders, "", NAME_FORWARDER, NULL);
olsr_printf(1,"\nNAME PLUGIN: parameter dns-server: (main address)");
! } else if (inet_aton(value, &ip)) {
my_forwarders = add_name_to_list(my_forwarders, "", NAME_FORWARDER, &ip);
olsr_printf(1,"\nNAME PLUGIN: parameter dns-server: (%s)", value);
--- 184,192 ----
}
else if(!strcmp(key, "dns-server")) {
! union olsr_ip_addr ip;
if (strlen(value) == 0) {
my_forwarders = add_name_to_list(my_forwarders, "", NAME_FORWARDER, NULL);
olsr_printf(1,"\nNAME PLUGIN: parameter dns-server: (main address)");
! } else if (inet_pton(olsr_cnf->ip_version, value, &ip)) {
my_forwarders = add_name_to_list(my_forwarders, "", NAME_FORWARDER, &ip);
olsr_printf(1,"\nNAME PLUGIN: parameter dns-server: (%s)", value);
***************
*** 207,211 ****
else {
// assume this is an IP address and hostname
! struct in_addr ip;
if (inet_pton(olsr_cnf->ip_version, key, &ip) == 1) {
--- 207,211 ----
else {
// assume this is an IP address and hostname
! union olsr_ip_addr ip;
if (inet_pton(olsr_cnf->ip_version, key, &ip) == 1) {
***************
*** 228,235 ****
*/
struct name_entry*
! add_name_to_list(struct name_entry *my_list, char *value, int type, struct in_addr *ip)
{
! struct name_entry *tmp;
! tmp = olsr_malloc(sizeof(struct name_entry), "new name_entry add_name_to_list");
tmp->name = strndup( value, MAX_NAME );
tmp->len = strlen( tmp->name );
--- 228,234 ----
*/
struct name_entry*
! add_name_to_list(struct name_entry *my_list, char *value, int type, const union olsr_ip_addr *ip)
{
! struct name_entry *tmp = olsr_malloc(sizeof(struct name_entry), "new name_entry add_name_to_list");
tmp->name = strndup( value, MAX_NAME );
tmp->len = strlen( tmp->name );
***************
*** 239,243 ****
memset(&tmp->ip, 0, sizeof(tmp->ip));
else
! tmp->ip.v4 = ip->s_addr;
tmp->next = my_list;
return tmp;
--- 238,242 ----
memset(&tmp->ip, 0, sizeof(tmp->ip));
else
! tmp->ip = *ip;
tmp->next = my_list;
return tmp;
***************
*** 548,552 ****
*/
void
! olsr_parser(union olsr_message *m, struct interface *in_if, union olsr_ip_addr *in_addr)
{
struct namemsg *namemessage;
--- 547,551 ----
*/
void
! olsr_parser(union olsr_message *m, struct interface *in_if, union olsr_ip_addr *ipaddr)
{
struct namemsg *namemessage;
***************
*** 584,589 ****
/* Check that the neighbor this message was received from is symmetric.
If not - back off*/
! if(check_neighbor_link(in_addr) != SYM_LINK) {
! olsr_printf(3, "NAME PLUGIN: Received msg from NON SYM neighbor %s\n", olsr_ip_to_string(in_addr));
return;
}
--- 583,588 ----
/* Check that the neighbor this message was received from is symmetric.
If not - back off*/
! if(check_neighbor_link(ipaddr) != SYM_LINK) {
! olsr_printf(3, "NAME PLUGIN: Received msg from NON SYM neighbor %s\n", olsr_ip_to_string(ipaddr));
return;
}
***************
*** 593,607 ****
* processed if nessecary
*/
! if(!olsr_check_dup_table_proc(&originator, seqno)) {
! /* If so - do not process */
! goto forward;
}
- update_name_entry(&originator, namemessage, size, vtime);
-
- forward:
/* Forward the message if nessecary
* default_fwd does all the work for us! */
! olsr_forward_message(m, &originator, seqno, in_if, in_addr);
}
--- 592,603 ----
* processed if nessecary
*/
! if(olsr_check_dup_table_proc(&originator, seqno)) {
! /* If not so - process */
! update_name_entry(&originator, namemessage, size, vtime);
}
/* Forward the message if nessecary
* default_fwd does all the work for us! */
! olsr_forward_message(m, &originator, seqno, in_if, ipaddr);
}
***************
*** 1267,1271 ****
{
char *hostname_or_ip;
- struct in_addr ip;
union olsr_ip_addr olsr_ip;
struct name_entry *name;
--- 1263,1266 ----
***************
*** 1286,1291 ****
//ip in service-line is allowed
! if (inet_aton(hostname_or_ip, &ip)) {
! olsr_ip.v4 = ip.s_addr;
if (allowed_ip(&olsr_ip)) {
olsr_printf(2, "NAME PLUGIN: ip %s in service %s is OK\n", olsr_ip_to_string(&olsr_ip), service_line);
--- 1281,1285 ----
//ip in service-line is allowed
! if (inet_pton(olsr_cnf->ip_version, hostname_or_ip, &olsr_ip)) {
if (allowed_ip(&olsr_ip)) {
olsr_printf(2, "NAME PLUGIN: ip %s in service %s is OK\n", olsr_ip_to_string(&olsr_ip), service_line);
More information about the Olsr-cvs
mailing list