Skip to content

Commit

Permalink
make it compile on NetBSD 1.5.2.
Browse files Browse the repository at this point in the history
XXX uses yacc/lex version dependent macro, thus it won't compile on NetBSD 1.6
  • Loading branch information
itojun committed Apr 3, 2002
1 parent 90548ed commit e858499
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 8 deletions.
8 changes: 7 additions & 1 deletion kame/kame/pim6sd/cfparse.y
@@ -1,4 +1,4 @@
/* $KAME: cfparse.y,v 1.18 2001/08/09 08:46:56 suz Exp $ */
/* $KAME: cfparse.y,v 1.19 2002/04/03 02:47:04 itojun Exp $ */

/*
* Copyright (C) 1999 WIDE Project.
Expand Down Expand Up @@ -710,6 +710,7 @@ phyint_config()
}
break;
case IFA_QUERY_INT:
#ifdef MLDV2_LISTENER_REPORT
/* if the mld version is 2 we have to verify if this */
/* value is codable in the QQIC field */

Expand All @@ -720,6 +721,7 @@ phyint_config()
yywarn("unrepresentable query int. value %.0f, corrected to %d",
al->attru.number,realnbr);
}
#endif

if(v->uv_mld_version == MLDv2)
v->uv_mld_query_interval = realnbr;
Expand All @@ -734,6 +736,7 @@ phyint_config()
v->uv_mld_query_interval);
break;
case IFA_QUERY_INT_RESP:
#ifdef MLDV2_LISTENER_REPORT
/* if the mld version is 2 we have to verify if this */
/* value is codable in the MAX RESP CODE field */
/* if this is mld version 1 we have to verify if this */
Expand All @@ -745,6 +748,7 @@ phyint_config()
yywarn("unrepresentable query resp. value %.0f, corrected to %d",
al->attru.number,realnbr);
}
#endif

if(v->uv_mld_version == MLDv2 )
v->uv_mld_query_rsp_interval = realnbr;
Expand All @@ -766,6 +770,7 @@ phyint_config()
v->uv_mld_query_rsp_interval);
break;
case IFA_LLQI:
#ifdef MLDV2_LISTENER_REPORT
/* if the mld version is 2 we have to verify if this */
/* value is codable in the MAX RESP CODE field */
/* if this is mld version 1 we have to verify if this */
Expand All @@ -777,6 +782,7 @@ phyint_config()
yywarn("unrepresentable llqi value %.0f, corrected to %d",
al->attru.number,realnbr);
}
#endif

if(v->uv_mld_version == MLDv2 )
v->uv_mld_llqi = realnbr;
Expand Down
3 changes: 2 additions & 1 deletion kame/kame/pim6sd/debug.c
@@ -1,4 +1,4 @@
/* $KAME: debug.c,v 1.49 2001/12/18 03:10:42 jinmei Exp $ */
/* $KAME: debug.c,v 1.50 2002/04/03 02:47:04 itojun Exp $ */

/*
* Copyright (c) 1998-2001
Expand Down Expand Up @@ -76,6 +76,7 @@
#include "vif.h"
#include "rp.h"
#include "inet6.h"
#include "mld6.h"

#ifdef __STDC__
#include <stdarg.h>
Expand Down
11 changes: 10 additions & 1 deletion kame/kame/pim6sd/mld6.c
@@ -1,4 +1,4 @@
/* $KAME: mld6.c,v 1.40 2002/03/29 13:34:50 jinmei Exp $ */
/* $KAME: mld6.c,v 1.41 2002/04/03 02:47:04 itojun Exp $ */

/*
* Copyright (C) 1998 WIDE Project.
Expand Down Expand Up @@ -102,6 +102,7 @@
#include "mld6v2_proto.h"
#include "route.h"
#include "trace.h"
#include "mld6.h"

/*
* Exported variables.
Expand Down Expand Up @@ -196,8 +197,10 @@ init_mld6()
ICMP6_FILTER_SETPASS(ICMP6_MEMBERSHIP_QUERY, &filt);
ICMP6_FILTER_SETPASS(ICMP6_MEMBERSHIP_REPORT, &filt);
ICMP6_FILTER_SETPASS(ICMP6_MEMBERSHIP_REDUCTION, &filt);
#ifdef MLD_MTRACE_RESP
ICMP6_FILTER_SETPASS(MLD_MTRACE_RESP, &filt);
ICMP6_FILTER_SETPASS(MLD_MTRACE, &filt);
#endif
#ifdef MLD6V2_LISTENER_REPORT
ICMP6_FILTER_SETPASS(MLD6V2_LISTENER_REPORT,&filt);
#endif
Expand Down Expand Up @@ -361,11 +364,13 @@ int recvlen;
#endif /* NOSUCHDEF */

/* for an mtrace message, we don't need strict checks */
#ifdef MLD_MTRACE
if (mldh->mld_type == MLD_MTRACE) {
accept_mtrace(src, dst, group, ifindex, (char *)(mldh + 1),
mldh->mld_code, recvlen - sizeof(struct mld_hdr));
return;
}
#endif

/* hop limit check */
if (*hlimp != 1)
Expand Down Expand Up @@ -408,8 +413,10 @@ int recvlen;
if (recvlen == 24)
accept_listener_query(src, dst, group,
ntohs(mldh->mld_maxdelay));
#ifdef MLD6V2_LISTENER_REPORT
if (recvlen >= 28)
accept_listenerV2_query(src, dst, (char *)(mldh), recvlen);
#endif
return;

case MLD_LISTENER_REPORT:
Expand Down Expand Up @@ -451,10 +458,12 @@ make_mld6_msg(type, code, src, dst, group, ifindex, delay, datalen, alert)
dst_sa.sin6_len = sizeof(dst_sa);

switch(type) {
#ifdef MLD_MTRACE
case MLD_MTRACE:
case MLD_MTRACE_RESP:
sndmh.msg_name = (caddr_t)dst;
break;
#endif
default:
if (IN6_IS_ADDR_UNSPECIFIED(group))
dst_sa.sin6_addr = allnodes_group.sin6_addr;
Expand Down
18 changes: 17 additions & 1 deletion kame/kame/pim6sd/mld6.h
@@ -1,4 +1,4 @@
/* $KAME: mld6.h,v 1.10 2001/11/27 07:19:16 suz Exp $ */
/* $KAME: mld6.h,v 1.11 2002/04/03 02:47:04 itojun Exp $ */

/*
* Copyright (C) 1998 WIDE Project.
Expand Down Expand Up @@ -68,4 +68,20 @@ void send_mld6 __P((int type, int code, struct sockaddr_in6 *src,
struct sockaddr_in6 *dst, struct in6_addr *group,
int index, int delay, int datalen, int alert));

/* portability with older KAME headers */
#ifndef MLD_LISTENER_QUERY
#define MLD_LISTENER_QUERY MLD6_LISTENER_QUERY
#define MLD_LISTENER_REPORT MLD6_LISTENER_REPORT
#define MLD_LISTENER_DONE MLD6_LISTENER_DONE
#define MLD_MTRACE_RESP MLD6_MTRACE_RESP
#define MLD_MTRACE MLD6_MTRACE
#define mld_hdr mld6_hdr
#define mld_type mld6_type
#define mld_code mld6_code
#define mld_cksum mld6_cksum
#define mld_maxdelay mld6_maxdelay
#define mld_reserved mld6_reserved
#define mld_addr mld6_addr
#endif

#endif
5 changes: 4 additions & 1 deletion kame/kame/pim6sd/mld6v2.c
@@ -1,5 +1,5 @@
/*
* $KAME: mld6v2.c,v 1.9 2002/03/29 13:34:50 jinmei Exp $
* $KAME: mld6v2.c,v 1.10 2002/04/03 02:47:04 itojun Exp $
*/

/*
Expand Down Expand Up @@ -69,6 +69,8 @@
#include "callout.h"
#include "timer.h"

#ifdef MLDV2_LISTENER_REPORT

#ifndef USE_RFC2292BIS
extern u_int8_t raopt[IP6OPT_RTALERT_LEN];
#endif
Expand Down Expand Up @@ -488,3 +490,4 @@ decodeafloat(unsigned int nbr,unsigned int sizeexp,unsigned int sizemant)
onebit <<= sizemant;
return (mant|onebit)<<(exp+3);
}
#endif
4 changes: 3 additions & 1 deletion kame/kame/pim6sd/mld6v2_proto.c
@@ -1,5 +1,5 @@
/*
* $KAME: mld6v2_proto.c,v 1.9 2002/02/04 06:07:50 suz Exp $
* $KAME: mld6v2_proto.c,v 1.10 2002/04/03 02:47:04 itojun Exp $
*/

/*
Expand Down Expand Up @@ -70,6 +70,7 @@
#include "callout.h"
#include "pim6.h"

#ifdef MLDV2_LISTENER_REPORT

/* MLDv2 implementation on SSM range i.e only MODE_IS_INCLUDE,
* ALLOW_NEW_SOURCES,BLOCK_OLD_SOURCES Multicast address record
Expand Down Expand Up @@ -789,3 +790,4 @@ check_multicastV2_listener(v, group, g, source)

return NULL; /* group not found, source not found */
}
#endif
6 changes: 5 additions & 1 deletion kame/kame/pim6sd/timer.c
@@ -1,4 +1,4 @@
/* $KAME: timer.c,v 1.18 2002/03/26 05:23:49 suz Exp $ */
/* $KAME: timer.c,v 1.19 2002/04/03 02:47:04 itojun Exp $ */

/*
* Copyright (c) 1998-2001
Expand Down Expand Up @@ -239,9 +239,11 @@ age_vifs()
case MLDv1:
query_groups(v);
break;
#ifdef MLDV2_LISTENER_REPORT
case MLDv2:
query_groupsV2(v);
break;
#endif
}

/* act as a querier by myself */
Expand All @@ -258,9 +260,11 @@ age_vifs()
case 1:
query_groups(v);
break;
#ifdef MLDV2_LISTENER_REPORT
case 2:
query_groupsV2(v);
break;
#endif
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion kame/kame/pim6sd/vif.c
@@ -1,4 +1,4 @@
/* $KAME: vif.c,v 1.23 2001/11/30 02:26:14 suz Exp $ */
/* $KAME: vif.c,v 1.24 2002/04/03 02:47:04 itojun Exp $ */

/*
* Copyright (c) 1998-2001
Expand Down Expand Up @@ -364,9 +364,11 @@ void start_vif (mifi_t vifi)
case MLDv1:
query_groups(v);
break;
#ifdef MLD6V2_LISTENER_REPORT
case MLDv2:
query_groupsV2(v);
break;
#endif
default:
break;
}
Expand Down

0 comments on commit e858499

Please sign in to comment.