"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/cfparse.c" between
mrouted-4.3.tar.gz and mrouted-4.4.tar.gz

About: mrouted is an implementation of the DVMRP multicast routing protocol.

cfparse.c  (mrouted-4.3):cfparse.c  (mrouted-4.4)
skipping to change at line 656 skipping to change at line 656
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54 45, 46, 47, 48, 49, 50, 51, 52, 53, 54
}; };
#if YYDEBUG #if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_int16 yyrline[] = static const yytype_int16 yyrline[] =
{ {
0, 88, 88, 91, 92, 95, 96, 98, 97, 113, 0, 88, 88, 91, 92, 95, 96, 98, 97, 113,
112, 153, 160, 167, 172, 176, 180, 191, 201, 210, 112, 146, 153, 160, 165, 169, 173, 184, 194, 203,
217, 228, 232, 236, 240, 244, 250, 256, 264, 265, 210, 221, 225, 229, 233, 237, 243, 249, 257, 258,
268, 269, 273, 280, 286, 287, 290, 291, 292, 293, 261, 262, 266, 273, 279, 280, 283, 284, 285, 286,
294, 295, 296, 313, 325, 329, 354, 358, 362, 371, 287, 288, 289, 306, 318, 322, 347, 351, 355, 364,
377, 381, 387, 391, 397, 401, 407, 411, 429, 433, 370, 374, 380, 384, 390, 394, 400, 404, 422, 426,
437, 444, 448, 452, 456, 461, 465, 472, 499, 503, 430, 437, 441, 445, 449, 454, 458, 465, 492, 496,
530, 534, 544, 548, 565, 569, 597, 601, 617, 630, 523, 527, 537, 541, 558, 562, 590, 594, 610, 623,
631, 634, 635, 638, 639, 642, 643, 646 624, 627, 628, 631, 632, 635, 636, 639
}; };
#endif #endif
#if YYDEBUG || YYERROR_VERBOSE || 0 #if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] = static const char *const yytname[] =
{ {
"$end", "error", "$undefined", "CACHE_LIFETIME", "PRUNE_LIFETIME", "$end", "error", "$undefined", "CACHE_LIFETIME", "PRUNE_LIFETIME",
"PRUNING", "BLACK_HOLE", "NOFLOOD", "QUERY_INTERVAL", "PRUNING", "BLACK_HOLE", "NOFLOOD", "QUERY_INTERVAL",
skipping to change at line 1573 skipping to change at line 1573
} }
} }
#line 1599 "cfparse.c" #line 1599 "cfparse.c"
break; break;
case 10: case 10:
#line 142 "cfparse.y" #line 142 "cfparse.y"
{ {
if (!(v->uv_flags & VIFF_OTUNNEL)) if (!(v->uv_flags & VIFF_OTUNNEL))
init_ipip_on_vif(v); init_ipip_on_vif(v);
logit(LOG_INFO, 0, "installing tunnel from %s to %s as vif #%u - rate
=%d",
inet_fmt((yyvsp[-3].addr), s1, sizeof(s1)), inet_fmt((yyvsp[-2]
.addr), s2, sizeof(s2)),
numvifs, v->uv_rate_limit);
++numvifs;
} }
#line 1615 "cfparse.c" #line 1608 "cfparse.c"
break; break;
case 11: case 11:
#line 154 "cfparse.y" #line 147 "cfparse.y"
{ {
if ((yyvsp[0].num) < MIN_CACHE_LIFETIME) if ((yyvsp[0].num) < MIN_CACHE_LIFETIME)
warn("cache-lifetime %d must be at least %d", (yyvsp[0].num), MIN _CACHE_LIFETIME); warn("cache-lifetime %d must be at least %d", (yyvsp[0].num), MIN _CACHE_LIFETIME);
else else
cache_lifetime = (yyvsp[0].num); cache_lifetime = (yyvsp[0].num);
} }
#line 1626 "cfparse.c" #line 1619 "cfparse.c"
break; break;
case 12: case 12:
#line 161 "cfparse.y" #line 154 "cfparse.y"
{ {
if ((yyvsp[0].num) < MIN_PRUNE_LIFETIME) if ((yyvsp[0].num) < MIN_PRUNE_LIFETIME)
warn("prune-lifetime %d must be at least %d", (yyvsp[0].num), MIN _PRUNE_LIFETIME); warn("prune-lifetime %d must be at least %d", (yyvsp[0].num), MIN _PRUNE_LIFETIME);
else else
prune_lifetime = (yyvsp[0].num); prune_lifetime = (yyvsp[0].num);
} }
#line 1637 "cfparse.c" #line 1630 "cfparse.c"
break; break;
case 13: case 13:
#line 168 "cfparse.y" #line 161 "cfparse.y"
{ {
if ((yyvsp[0].num) != 1) if ((yyvsp[0].num) != 1)
warn("Disabling pruning is no longer supported"); warn("Disabling pruning is no longer supported");
} }
#line 1646 "cfparse.c" #line 1639 "cfparse.c"
break; break;
case 14: case 14:
#line 173 "cfparse.y" #line 166 "cfparse.y"
{ {
router_alert = 0; router_alert = 0;
} }
#line 1654 "cfparse.c" #line 1647 "cfparse.c"
break; break;
case 15: case 15:
#line 177 "cfparse.y" #line 170 "cfparse.y"
{ {
router_alert = (yyvsp[0].num); router_alert = (yyvsp[0].num);
} }
#line 1662 "cfparse.c" #line 1655 "cfparse.c"
break; break;
case 16: case 16:
#line 181 "cfparse.y" #line 174 "cfparse.y"
{ {
#ifdef ALLOW_BLACK_HOLES #ifdef ALLOW_BLACK_HOLES
allow_black_holes = 1; allow_black_holes = 1;
#endif #endif
} }
#line 1672 "cfparse.c" #line 1665 "cfparse.c"
break; break;
case 17: case 17:
#line 192 "cfparse.y" #line 185 "cfparse.y"
{ {
noflood = VIFF_NOFLOOD; noflood = VIFF_NOFLOOD;
config_set_ifflag(VIFF_NOFLOOD); config_set_ifflag(VIFF_NOFLOOD);
} }
#line 1681 "cfparse.c" #line 1674 "cfparse.c"
break; break;
case 18: case 18:
#line 202 "cfparse.y" #line 195 "cfparse.y"
{ {
config_set_ifflag(VIFF_REXMIT_PRUNES); config_set_ifflag(VIFF_REXMIT_PRUNES);
} }
#line 1689 "cfparse.c" #line 1682 "cfparse.c"
break; break;
case 19: case 19:
#line 211 "cfparse.y" #line 204 "cfparse.y"
{ {
if ((yyvsp[0].num)) if ((yyvsp[0].num))
config_set_ifflag(VIFF_REXMIT_PRUNES); config_set_ifflag(VIFF_REXMIT_PRUNES);
else else
rexmit = 0; rexmit = 0;
} }
#line 1700 "cfparse.c" #line 1693 "cfparse.c"
break; break;
case 20: case 20:
#line 218 "cfparse.y" #line 211 "cfparse.y"
{ {
size_t len = strlen((yyvsp[-1].ptr)) + 1; size_t len = strlen((yyvsp[-1].ptr)) + 1;
if (numbounds >= MAXBOUNDS) if (numbounds >= MAXBOUNDS)
fatal("Too many named boundaries (max %d)", MAXBOUNDS); fatal("Too many named boundaries (max %d)", MAXBOUNDS);
boundlist[numbounds].name = malloc(len); boundlist[numbounds].name = malloc(len);
strlcpy(boundlist[numbounds].name, (yyvsp[-1].ptr), len); strlcpy(boundlist[numbounds].name, (yyvsp[-1].ptr), len);
boundlist[numbounds++].bound = (yyvsp[0].addrmask); boundlist[numbounds++].bound = (yyvsp[0].addrmask);
} }
#line 1715 "cfparse.c" #line 1708 "cfparse.c"
break; break;
case 21: case 21:
#line 229 "cfparse.y" #line 222 "cfparse.y"
{ {
/* Removed SNMP support */ /* Removed SNMP support */
} }
#line 1723 "cfparse.c" #line 1716 "cfparse.c"
break; break;
case 22: case 22:
#line 233 "cfparse.y" #line 226 "cfparse.y"
{ {
/* Removed SNMP support */ /* Removed SNMP support */
} }
#line 1731 "cfparse.c" #line 1724 "cfparse.c"
break; break;
case 23: case 23:
#line 237 "cfparse.y" #line 230 "cfparse.y"
{ {
/* Removed SNMP support */ /* Removed SNMP support */
} }
#line 1739 "cfparse.c" #line 1732 "cfparse.c"
break; break;
case 24: case 24:
#line 241 "cfparse.y" #line 234 "cfparse.y"
{ {
/* Removed SNMP support */ /* Removed SNMP support */
} }
#line 1747 "cfparse.c" #line 1740 "cfparse.c"
break; break;
case 25: case 25:
#line 245 "cfparse.y" #line 238 "cfparse.y"
{ {
if ((yyvsp[0].num) < 1 || (yyvsp[0].num) > 1024) if ((yyvsp[0].num) < 1 || (yyvsp[0].num) > 1024)
fatal("Invalid IGMP query interval [1,1024]: %d", (yyvsp[0].num)) ; fatal("Invalid IGMP query interval [1,1024]: %d", (yyvsp[0].num)) ;
igmp_query_interval = (yyvsp[0].num); igmp_query_interval = (yyvsp[0].num);
} }
#line 1757 "cfparse.c" #line 1750 "cfparse.c"
break; break;
case 26: case 26:
#line 251 "cfparse.y" #line 244 "cfparse.y"
{ {
if ((yyvsp[0].num) < 1 || (yyvsp[0].num) > 1024) if ((yyvsp[0].num) < 1 || (yyvsp[0].num) > 1024)
fatal("Invalid IGMP query interval [1,1024]: %d", (yyvsp[0].num)) ; fatal("Invalid IGMP query interval [1,1024]: %d", (yyvsp[0].num)) ;
igmp_last_member_interval = (yyvsp[0].num); igmp_last_member_interval = (yyvsp[0].num);
} }
#line 1767 "cfparse.c" #line 1760 "cfparse.c"
break; break;
case 27: case 27:
#line 257 "cfparse.y" #line 250 "cfparse.y"
{ {
if ((yyvsp[0].num) < 2 || (yyvsp[0].num) > 10) if ((yyvsp[0].num) < 2 || (yyvsp[0].num) > 10)
fatal("Invalid IGMP robustness value [2,10]: %d", (yyvsp[0].num)) ; fatal("Invalid IGMP robustness value [2,10]: %d", (yyvsp[0].num)) ;
igmp_robustness = (yyvsp[0].num); igmp_robustness = (yyvsp[0].num);
} }
#line 1777 "cfparse.c" #line 1770 "cfparse.c"
break; break;
case 31: case 31:
#line 270 "cfparse.y" #line 263 "cfparse.y"
{ {
v->uv_flags |= VIFF_OTUNNEL; v->uv_flags |= VIFF_OTUNNEL;
} }
#line 1785 "cfparse.c" #line 1778 "cfparse.c"
break; break;
case 32: case 32:
#line 274 "cfparse.y" #line 267 "cfparse.y"
{ {
if ((yyvsp[0].num)) if ((yyvsp[0].num))
v->uv_flags |= VIFF_OTUNNEL; v->uv_flags |= VIFF_OTUNNEL;
else else
v->uv_flags &= ~VIFF_OTUNNEL; v->uv_flags &= ~VIFF_OTUNNEL;
} }
#line 1796 "cfparse.c" #line 1789 "cfparse.c"
break; break;
case 33: case 33:
#line 281 "cfparse.y" #line 274 "cfparse.y"
{ {
fatal("Source-route tunnels not supported"); fatal("Source-route tunnels not supported");
} }
#line 1804 "cfparse.c" #line 1797 "cfparse.c"
break; break;
case 37: case 37:
#line 291 "cfparse.y" #line 284 "cfparse.y"
{ v->uv_flags |= VIFF_DISABLED; } { v->uv_flags |= VIFF_DISABLED; }
#line 1810 "cfparse.c" #line 1803 "cfparse.c"
break; break;
case 38: case 38:
#line 292 "cfparse.y" #line 285 "cfparse.y"
{ v->uv_flags &= ~VIFF_DISABLED; } { v->uv_flags &= ~VIFF_DISABLED; }
#line 1816 "cfparse.c" #line 1809 "cfparse.c"
break; break;
case 39: case 39:
#line 293 "cfparse.y" #line 286 "cfparse.y"
{ v->uv_flags &= ~VIFF_IGMPV2; v->uv_flags |= VI FF_IGMPV1; } { v->uv_flags &= ~VIFF_IGMPV2; v->uv_flags |= VI FF_IGMPV1; }
#line 1822 "cfparse.c" #line 1815 "cfparse.c"
break; break;
case 40: case 40:
#line 294 "cfparse.y" #line 287 "cfparse.y"
{ v->uv_flags &= ~VIFF_IGMPV1; v->uv_flags |= VI FF_IGMPV2; } { v->uv_flags &= ~VIFF_IGMPV1; v->uv_flags |= VI FF_IGMPV2; }
#line 1828 "cfparse.c" #line 1821 "cfparse.c"
break; break;
case 41: case 41:
#line 295 "cfparse.y" #line 288 "cfparse.y"
{ v->uv_flags &= ~VIFF_IGMPV1; v->uv_flags &= ~V IFF_IGMPV2; } { v->uv_flags &= ~VIFF_IGMPV1; v->uv_flags &= ~V IFF_IGMPV2; }
#line 1834 "cfparse.c" #line 1827 "cfparse.c"
break; break;
case 42: case 42:
#line 297 "cfparse.y" #line 290 "cfparse.y"
{ {
struct listaddr *a; struct listaddr *a;
a = calloc(1, sizeof(struct listaddr)); a = calloc(1, sizeof(struct listaddr));
if (!a) { if (!a) {
fatal("Failed allocating memory for 'struct listaddr'"); fatal("Failed allocating memory for 'struct listaddr'");
return 0; return 0;
} }
a->al_addr = (yyvsp[0].addr); a->al_addr = (yyvsp[0].addr);
a->al_pv = 2; /* IGMPv2 only, no SSM */ a->al_pv = 2; /* IGMPv2 only, no SSM */
a->al_flags = NBRF_STATIC_GROUP; a->al_flags = NBRF_STATIC_GROUP;
time(&a->al_ctime); time(&a->al_ctime);
TAILQ_INSERT_TAIL(&v->uv_static, a, al_link); TAILQ_INSERT_TAIL(&v->uv_static, a, al_link);
} }
#line 1855 "cfparse.c" #line 1848 "cfparse.c"
break; break;
case 43: case 43:
#line 314 "cfparse.y" #line 307 "cfparse.y"
{ {
uint32_t subnet, mask; uint32_t subnet, mask;
mask = (yyvsp[0].addr); mask = (yyvsp[0].addr);
subnet = v->uv_lcl_addr & mask; subnet = v->uv_lcl_addr & mask;
if (!inet_valid_subnet(subnet, mask)) if (!inet_valid_subnet(subnet, mask))
fatal("Invalid netmask"); fatal("Invalid netmask");
v->uv_subnet = subnet; v->uv_subnet = subnet;
v->uv_subnetmask = mask; v->uv_subnetmask = mask;
v->uv_subnetbcast = subnet | ~mask; v->uv_subnetbcast = subnet | ~mask;
} }
#line 1871 "cfparse.c" #line 1864 "cfparse.c"
break; break;
case 44: case 44:
#line 326 "cfparse.y" #line 319 "cfparse.y"
{ {
warn("Expected address after netmask keyword, ignored"); warn("Expected address after netmask keyword, ignored");
} }
#line 1879 "cfparse.c" #line 1872 "cfparse.c"
break; break;
case 45: case 45:
#line 330 "cfparse.y" #line 323 "cfparse.y"
{ {
struct phaddr *ph; struct phaddr *ph;
ph = calloc(1, sizeof(struct phaddr)); ph = calloc(1, sizeof(struct phaddr));
if (!ph) { if (!ph) {
fatal("Failed allocating memory for 'struct phaddr'"); fatal("Failed allocating memory for 'struct phaddr'");
return 0; return 0;
} }
if ((yyvsp[0].addrmask).mask) if ((yyvsp[0].addrmask).mask)
skipping to change at line 1874 skipping to change at line 1867
ph->pa_subnet = (yyvsp[0].addrmask).addr & ph->pa_subnetmask; ph->pa_subnet = (yyvsp[0].addrmask).addr & ph->pa_subnetmask;
ph->pa_subnetbcast = ph->pa_subnet | ~ph->pa_subnetmask; ph->pa_subnetbcast = ph->pa_subnet | ~ph->pa_subnetmask;
if ((yyvsp[0].addrmask).addr & ~ph->pa_subnetmask) if ((yyvsp[0].addrmask).addr & ~ph->pa_subnetmask)
warn("Extra subnet %s/%d has host bits set", warn("Extra subnet %s/%d has host bits set",
inet_fmt((yyvsp[0].addrmask).addr, s1, sizeof(s1)), (yyvsp[0 ].addrmask).mask); inet_fmt((yyvsp[0].addrmask).addr, s1, sizeof(s1)), (yyvsp[0 ].addrmask).mask);
ph->pa_next = v->uv_addrs; ph->pa_next = v->uv_addrs;
v->uv_addrs = ph; v->uv_addrs = ph;
} }
#line 1908 "cfparse.c" #line 1901 "cfparse.c"
break; break;
case 46: case 46:
#line 355 "cfparse.y" #line 348 "cfparse.y"
{ {
warn("Expected address after altnet keyword, ignored"); warn("Expected address after altnet keyword, ignored");
} }
#line 1916 "cfparse.c" #line 1909 "cfparse.c"
break; break;
case 47: case 47:
#line 359 "cfparse.y" #line 352 "cfparse.y"
{ {
v->uv_flags |= VIFF_FORCE_LEAF; v->uv_flags |= VIFF_FORCE_LEAF;
} }
#line 1924 "cfparse.c" #line 1917 "cfparse.c"
break; break;
case 48: case 48:
#line 363 "cfparse.y" #line 356 "cfparse.y"
{ {
if ((yyvsp[0].num)) if ((yyvsp[0].num))
v->uv_flags |= VIFF_FORCE_LEAF; v->uv_flags |= VIFF_FORCE_LEAF;
else else
v->uv_flags &= ~VIFF_FORCE_LEAF; v->uv_flags &= ~VIFF_FORCE_LEAF;
} }
#line 1935 "cfparse.c" #line 1928 "cfparse.c"
break; break;
case 49: case 49:
#line 372 "cfparse.y" #line 365 "cfparse.y"
{ {
if ((yyvsp[0].num) < 1 || (yyvsp[0].num) > 255) if ((yyvsp[0].num) < 1 || (yyvsp[0].num) > 255)
fatal("Invalid threshold %d",(yyvsp[0].num)); fatal("Invalid threshold %d",(yyvsp[0].num));
v->uv_threshold = (yyvsp[0].num); v->uv_threshold = (yyvsp[0].num);
} }
#line 1945 "cfparse.c" #line 1938 "cfparse.c"
break; break;
case 50: case 50:
#line 378 "cfparse.y" #line 371 "cfparse.y"
{ {
warn("Expected number after threshold keyword, ignored"); warn("Expected number after threshold keyword, ignored");
} }
#line 1953 "cfparse.c" #line 1946 "cfparse.c"
break; break;
case 51: case 51:
#line 382 "cfparse.y" #line 375 "cfparse.y"
{ {
if ((yyvsp[0].num) < 1 || (yyvsp[0].num) > UNREACHABLE) if ((yyvsp[0].num) < 1 || (yyvsp[0].num) > UNREACHABLE)
fatal("Invalid metric %d",(yyvsp[0].num)); fatal("Invalid metric %d",(yyvsp[0].num));
v->uv_metric = (yyvsp[0].num); v->uv_metric = (yyvsp[0].num);
} }
#line 1963 "cfparse.c" #line 1956 "cfparse.c"
break; break;
case 52: case 52:
#line 388 "cfparse.y" #line 381 "cfparse.y"
{ {
warn("Expected number after metric keyword, ignored"); warn("Expected number after metric keyword, ignored");
} }
#line 1971 "cfparse.c" #line 1964 "cfparse.c"
break; break;
case 53: case 53:
#line 392 "cfparse.y" #line 385 "cfparse.y"
{ {
if ((yyvsp[0].num) < 0 || (yyvsp[0].num) > UNREACHABLE - 1) if ((yyvsp[0].num) < 0 || (yyvsp[0].num) > UNREACHABLE - 1)
fatal("Invalid advert-metric %d", (yyvsp[0].num)); fatal("Invalid advert-metric %d", (yyvsp[0].num));
v->uv_admetric = (yyvsp[0].num); v->uv_admetric = (yyvsp[0].num);
} }
#line 1981 "cfparse.c" #line 1974 "cfparse.c"
break; break;
case 54: case 54:
#line 398 "cfparse.y" #line 391 "cfparse.y"
{ {
warn("Expected number after advert-metric keyword, ignored"); warn("Expected number after advert-metric keyword, ignored");
} }
#line 1989 "cfparse.c" #line 1982 "cfparse.c"
break; break;
case 55: case 55:
#line 402 "cfparse.y" #line 395 "cfparse.y"
{ {
if ((yyvsp[0].num) > MAX_RATE_LIMIT) if ((yyvsp[0].num) > MAX_RATE_LIMIT)
fatal("Invalid rate-limit %d",(yyvsp[0].num)); fatal("Invalid rate-limit %d",(yyvsp[0].num));
v->uv_rate_limit = (yyvsp[0].num); v->uv_rate_limit = (yyvsp[0].num);
} }
#line 1999 "cfparse.c" #line 1992 "cfparse.c"
break; break;
case 56: case 56:
#line 408 "cfparse.y" #line 401 "cfparse.y"
{ {
warn("Expected number after rate-limit keyword, ignored"); warn("Expected number after rate-limit keyword, ignored");
} }
#line 2007 "cfparse.c" #line 2000 "cfparse.c"
break; break;
case 57: case 57:
#line 412 "cfparse.y" #line 405 "cfparse.y"
{ {
struct vif_acl *v_acl; struct vif_acl *v_acl;
v_acl = calloc(1, sizeof(struct vif_acl)); v_acl = calloc(1, sizeof(struct vif_acl));
if (!v_acl) { if (!v_acl) {
fatal("Failed allocating memory for 'struct vif_acl'"); fatal("Failed allocating memory for 'struct vif_acl'");
return 0; return 0;
} }
VAL_TO_MASK(v_acl->acl_mask, (yyvsp[0].addrmask).mask); VAL_TO_MASK(v_acl->acl_mask, (yyvsp[0].addrmask).mask);
v_acl->acl_addr = (yyvsp[0].addrmask).addr & v_acl->acl_mask; v_acl->acl_addr = (yyvsp[0].addrmask).addr & v_acl->acl_mask;
if ((yyvsp[0].addrmask).addr & ~v_acl->acl_mask) if ((yyvsp[0].addrmask).addr & ~v_acl->acl_mask)
warn("Boundary spec %s/%d has host bits set", warn("Boundary spec %s/%d has host bits set",
inet_fmt((yyvsp[0].addrmask).addr, s1, sizeof(s1)), (yyvsp[0 ].addrmask).mask); inet_fmt((yyvsp[0].addrmask).addr, s1, sizeof(s1)), (yyvsp[0 ].addrmask).mask);
v_acl->acl_next = v->uv_acl; v_acl->acl_next = v->uv_acl;
v->uv_acl = v_acl; v->uv_acl = v_acl;
} }
#line 2029 "cfparse.c" #line 2022 "cfparse.c"
break; break;
case 58: case 58:
#line 430 "cfparse.y" #line 423 "cfparse.y"
{ {
warn("Expected boundary spec after boundary keyword, ignored"); warn("Expected boundary spec after boundary keyword, ignored");
} }
#line 2037 "cfparse.c" #line 2030 "cfparse.c"
break; break;
case 59: case 59:
#line 434 "cfparse.y" #line 427 "cfparse.y"
{ {
v->uv_flags |= VIFF_REXMIT_PRUNES; v->uv_flags |= VIFF_REXMIT_PRUNES;
} }
#line 2045 "cfparse.c" #line 2038 "cfparse.c"
break; break;
case 60: case 60:
#line 438 "cfparse.y" #line 431 "cfparse.y"
{ {
if ((yyvsp[0].num)) if ((yyvsp[0].num))
v->uv_flags |= VIFF_REXMIT_PRUNES; v->uv_flags |= VIFF_REXMIT_PRUNES;
else else
v->uv_flags &= ~VIFF_REXMIT_PRUNES; v->uv_flags &= ~VIFF_REXMIT_PRUNES;
} }
#line 2056 "cfparse.c" #line 2049 "cfparse.c"
break; break;
case 61: case 61:
#line 445 "cfparse.y" #line 438 "cfparse.y"
{ {
v->uv_flags |= VIFF_PASSIVE; v->uv_flags |= VIFF_PASSIVE;
} }
#line 2064 "cfparse.c" #line 2057 "cfparse.c"
break; break;
case 62: case 62:
#line 449 "cfparse.y" #line 442 "cfparse.y"
{ {
v->uv_flags |= VIFF_NOFLOOD; v->uv_flags |= VIFF_NOFLOOD;
} }
#line 2072 "cfparse.c" #line 2065 "cfparse.c"
break; break;
case 63: case 63:
#line 453 "cfparse.y" #line 446 "cfparse.y"
{ {
v->uv_flags |= VIFF_NOTRANSIT; v->uv_flags |= VIFF_NOTRANSIT;
} }
#line 2080 "cfparse.c" #line 2073 "cfparse.c"
break; break;
case 64: case 64:
#line 457 "cfparse.y" #line 450 "cfparse.y"
{ {
v->uv_flags |= VIFF_BLASTER; v->uv_flags |= VIFF_BLASTER;
blaster_alloc(v); blaster_alloc(v);
} }
#line 2089 "cfparse.c" #line 2082 "cfparse.c"
break; break;
case 65: case 65:
#line 462 "cfparse.y" #line 455 "cfparse.y"
{ {
v->uv_flags |= VIFF_ALLOW_NONPRUNERS; v->uv_flags |= VIFF_ALLOW_NONPRUNERS;
} }
#line 2097 "cfparse.c" #line 2090 "cfparse.c"
break; break;
case 66: case 66:
#line 466 "cfparse.y" #line 459 "cfparse.y"
{ {
if ((yyvsp[0].num) < MIN_PRUNE_LIFETIME) if ((yyvsp[0].num) < MIN_PRUNE_LIFETIME)
warn("prune-lifetime %d must be at least %d", (yyvsp[0].num), MIN _PRUNE_LIFETIME); warn("prune-lifetime %d must be at least %d", (yyvsp[0].num), MIN _PRUNE_LIFETIME);
else else
v->uv_prune_lifetime = (yyvsp[0].num); v->uv_prune_lifetime = (yyvsp[0].num);
} }
#line 2108 "cfparse.c" #line 2101 "cfparse.c"
break; break;
case 67: case 67:
#line 473 "cfparse.y" #line 466 "cfparse.y"
{ {
if (v->uv_filter == NULL) { if (v->uv_filter == NULL) {
struct vif_filter *v_filter; struct vif_filter *v_filter;
v_filter = calloc(1, sizeof(struct vif_filter)); v_filter = calloc(1, sizeof(struct vif_filter));
if (!v_filter) { if (!v_filter) {
fatal("Failed allocating memory for 'struct vif_filter'"); fatal("Failed allocating memory for 'struct vif_filter'");
return 0; return 0;
} }
skipping to change at line 2105 skipping to change at line 2098
fatal("Cannot accept and deny"); fatal("Cannot accept and deny");
} else { } else {
struct vf_element *p; struct vf_element *p;
p = v->uv_filter->vf_filter; p = v->uv_filter->vf_filter;
while (p->vfe_next) while (p->vfe_next)
p = p->vfe_next; p = p->vfe_next;
p->vfe_next = (yyvsp[0].filterelem); p->vfe_next = (yyvsp[0].filterelem);
} }
} }
#line 2139 "cfparse.c" #line 2132 "cfparse.c"
break; break;
case 68: case 68:
#line 500 "cfparse.y" #line 493 "cfparse.y"
{ {
warn("Expected filter spec after accept keyword, ignored"); warn("Expected filter spec after accept keyword, ignored");
} }
#line 2147 "cfparse.c" #line 2140 "cfparse.c"
break; break;
case 69: case 69:
#line 504 "cfparse.y" #line 497 "cfparse.y"
{ {
if (!v->uv_filter) { if (!v->uv_filter) {
struct vif_filter *v_filter; struct vif_filter *v_filter;
v_filter = calloc(1, sizeof(struct vif_filter)); v_filter = calloc(1, sizeof(struct vif_filter));
if (!v_filter) { if (!v_filter) {
fatal("Failed allocating memory for 'struct vif_filter'"); fatal("Failed allocating memory for 'struct vif_filter'");
return 0; return 0;
} }
skipping to change at line 2144 skipping to change at line 2137
fatal("Cannot accept and deny"); fatal("Cannot accept and deny");
} else { } else {
struct vf_element *p; struct vf_element *p;
p = v->uv_filter->vf_filter; p = v->uv_filter->vf_filter;
while (p->vfe_next) while (p->vfe_next)
p = p->vfe_next; p = p->vfe_next;
p->vfe_next = (yyvsp[0].filterelem); p->vfe_next = (yyvsp[0].filterelem);
} }
} }
#line 2178 "cfparse.c" #line 2171 "cfparse.c"
break; break;
case 70: case 70:
#line 531 "cfparse.y" #line 524 "cfparse.y"
{ {
warn("Expected filter spec after deny keyword, ignored"); warn("Expected filter spec after deny keyword, ignored");
} }
#line 2186 "cfparse.c" #line 2179 "cfparse.c"
break; break;
case 71: case 71:
#line 535 "cfparse.y" #line 528 "cfparse.y"
{ {
if (!v->uv_filter) { if (!v->uv_filter) {
fatal("bidir goes after filters"); fatal("bidir goes after filters");
return 0; /* Never reached */ return 0; /* Never reached */
} }
v->uv_filter->vf_flags |= VFF_BIDIR; v->uv_filter->vf_flags |= VFF_BIDIR;
} }
#line 2198 "cfparse.c" #line 2191 "cfparse.c"
break; break;
case 72: case 72:
#line 545 "cfparse.y" #line 538 "cfparse.y"
{ {
(yyval.addr) = (yyvsp[0].addr); (yyval.addr) = (yyvsp[0].addr);
} }
#line 2206 "cfparse.c" #line 2199 "cfparse.c"
break; break;
case 73: case 73:
#line 549 "cfparse.y" #line 542 "cfparse.y"
{ {
struct uvif *v; struct uvif *v;
/* /*
* Looks a little weird, but the orig. code was based around * Looks a little weird, but the orig. code was based around
* the addresses being used to identify interfaces. * the addresses being used to identify interfaces.
*/ */
v = config_find_ifname((yyvsp[0].ptr)); v = config_find_ifname((yyvsp[0].ptr));
if (!v) { if (!v) {
warn("phyint %s not available, continuing ...", (yyvsp[0].ptr)); warn("phyint %s not available, continuing ...", (yyvsp[0].ptr));
(yyval.addr) = 0; (yyval.addr) = 0;
} else } else
(yyval.addr) = v->uv_lcl_addr; (yyval.addr) = v->uv_lcl_addr;
} }
#line 2225 "cfparse.c" #line 2218 "cfparse.c"
break; break;
case 74: case 74:
#line 566 "cfparse.y" #line 559 "cfparse.y"
{ {
(yyval.addr) = (yyvsp[0].addr); (yyval.addr) = (yyvsp[0].addr);
} }
#line 2233 "cfparse.c" #line 2226 "cfparse.c"
break; break;
case 75: case 75:
#line 570 "cfparse.y" #line 563 "cfparse.y"
{ {
struct sockaddr_in *sin; struct sockaddr_in *sin;
struct addrinfo *result; struct addrinfo *result;
struct addrinfo hints; struct addrinfo hints;
int rc; int rc;
memset(&hints, 0, sizeof(struct addrinfo)); memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_DGRAM; hints.ai_socktype = SOCK_DGRAM;
skipping to change at line 2230 skipping to change at line 2223
if (result->ai_next) { if (result->ai_next) {
freeaddrinfo(result); freeaddrinfo(result);
fatal("Hostname %s does not %s", (yyvsp[0].ptr), "map to a unique address"); fatal("Hostname %s does not %s", (yyvsp[0].ptr), "map to a unique address");
} }
sin = (struct sockaddr_in *)result->ai_addr; sin = (struct sockaddr_in *)result->ai_addr;
(yyval.addr) = sin->sin_addr.s_addr; (yyval.addr) = sin->sin_addr.s_addr;
freeaddrinfo(result); freeaddrinfo(result);
} }
#line 2264 "cfparse.c" #line 2257 "cfparse.c"
break; break;
case 76: case 76:
#line 598 "cfparse.y" #line 591 "cfparse.y"
{ {
(yyval.addrmask) = (yyvsp[0].addrmask); (yyval.addrmask) = (yyvsp[0].addrmask);
} }
#line 2272 "cfparse.c" #line 2265 "cfparse.c"
break; break;
case 77: case 77:
#line 602 "cfparse.y" #line 595 "cfparse.y"
{ {
int i; int i;
for (i = 0; i < numbounds; i++) { for (i = 0; i < numbounds; i++) {
if (!strcmp(boundlist[i].name, (yyvsp[0].ptr))) { if (!strcmp(boundlist[i].name, (yyvsp[0].ptr))) {
(yyval.addrmask) = boundlist[i].bound; (yyval.addrmask) = boundlist[i].bound;
break; break;
} }
} }
if (i == numbounds) if (i == numbounds)
fatal("Invalid boundary name %s", (yyvsp[0].ptr)); fatal("Invalid boundary name %s", (yyvsp[0].ptr));
} }
#line 2290 "cfparse.c" #line 2283 "cfparse.c"
break; break;
case 78: case 78:
#line 618 "cfparse.y" #line 611 "cfparse.y"
{ {
#ifdef ALLOW_BLACK_HOLES #ifdef ALLOW_BLACK_HOLES
if (!allow_black_holes) if (!allow_black_holes)
#endif #endif
if ((ntohl((yyvsp[0].addrmask).addr) & 0xff000000) != 0xef000000) { if ((ntohl((yyvsp[0].addrmask).addr) & 0xff000000) != 0xef000000) {
fatal("Boundaries must be 239.x.x.x, not %s/%d", fatal("Boundaries must be 239.x.x.x, not %s/%d",
inet_fmt((yyvsp[0].addrmask).addr, s1, sizeof(s1)), (yy vsp[0].addrmask).mask); inet_fmt((yyvsp[0].addrmask).addr, s1, sizeof(s1)), (yy vsp[0].addrmask).mask);
} }
(yyval.addrmask) = (yyvsp[0].addrmask); (yyval.addrmask) = (yyvsp[0].addrmask);
} }
#line 2305 "cfparse.c" #line 2298 "cfparse.c"
break; break;
case 79: case 79:
#line 630 "cfparse.y" #line 623 "cfparse.y"
{ (yyval.addrmask) = (yyvsp[0].addrmask); } { (yyval.addrmask) = (yyvsp[0].addrmask); }
#line 2311 "cfparse.c" #line 2304 "cfparse.c"
break; break;
case 80: case 80:
#line 631 "cfparse.y" #line 624 "cfparse.y"
{ (yyval.addrmask).addr = (yyvsp[0].addr); (yyva l.addrmask).mask = 0; } { (yyval.addrmask).addr = (yyvsp[0].addr); (yyva l.addrmask).mask = 0; }
#line 2317 "cfparse.c" #line 2310 "cfparse.c"
break; break;
case 81: case 81:
#line 634 "cfparse.y" #line 627 "cfparse.y"
{ (yyval.filterelem) = (yyvsp[0].filterelem); } { (yyval.filterelem) = (yyvsp[0].filterelem); }
#line 2323 "cfparse.c" #line 2316 "cfparse.c"
break; break;
case 82: case 82:
#line 635 "cfparse.y" #line 628 "cfparse.y"
{ fatal("named filters no implemented yet"); } { fatal("named filters no implemented yet"); }
#line 2329 "cfparse.c" #line 2322 "cfparse.c"
break; break;
case 83: case 83:
#line 638 "cfparse.y" #line 631 "cfparse.y"
{ (yyval.filterelem) = (yyvsp[0].filterelem); } { (yyval.filterelem) = (yyvsp[0].filterelem); }
#line 2335 "cfparse.c" #line 2328 "cfparse.c"
break; break;
case 84: case 84:
#line 639 "cfparse.y" #line 632 "cfparse.y"
{ (yyvsp[-1].filterelem)->vfe_next = (yyvsp[0].f ilterelem); (yyval.filterelem) = (yyvsp[-1].filterelem); } { (yyvsp[-1].filterelem)->vfe_next = (yyvsp[0].f ilterelem); (yyval.filterelem) = (yyvsp[-1].filterelem); }
#line 2341 "cfparse.c" #line 2334 "cfparse.c"
break; break;
case 85: case 85:
#line 642 "cfparse.y" #line 635 "cfparse.y"
{ (yyval.filterelem) = (yyvsp[0].filterelem); } { (yyval.filterelem) = (yyvsp[0].filterelem); }
#line 2347 "cfparse.c" #line 2340 "cfparse.c"
break; break;
case 86: case 86:
#line 643 "cfparse.y" #line 636 "cfparse.y"
{ (yyvsp[-1].filterelem)->vfe_flags |= VFEF_EXAC T; (yyval.filterelem) = (yyvsp[-1].filterelem); } { (yyvsp[-1].filterelem)->vfe_flags |= VFEF_EXAC T; (yyval.filterelem) = (yyvsp[-1].filterelem); }
#line 2353 "cfparse.c" #line 2346 "cfparse.c"
break; break;
case 87: case 87:
#line 647 "cfparse.y" #line 640 "cfparse.y"
{ {
struct vf_element *vfe; struct vf_element *vfe;
vfe = calloc(1, sizeof(struct vf_element)); vfe = calloc(1, sizeof(struct vf_element));
if (!vfe) { if (!vfe) {
fatal("Failed allocating memory for 'struct vf_element'"); fatal("Failed allocating memory for 'struct vf_element'");
return 0; return 0;
} }
vfe->vfe_addr = (yyvsp[0].addrmask).addr; vfe->vfe_addr = (yyvsp[0].addrmask).addr;
VAL_TO_MASK(vfe->vfe_mask, (yyvsp[0].addrmask).mask); VAL_TO_MASK(vfe->vfe_mask, (yyvsp[0].addrmask).mask);
vfe->vfe_flags = 0; vfe->vfe_flags = 0;
vfe->vfe_next = NULL; vfe->vfe_next = NULL;
(yyval.filterelem) = vfe; (yyval.filterelem) = vfe;
} }
#line 2374 "cfparse.c" #line 2367 "cfparse.c"
break; break;
#line 2378 "cfparse.c" #line 2371 "cfparse.c"
default: break; default: break;
} }
/* User semantic actions sometimes alter yychar, and that requires /* User semantic actions sometimes alter yychar, and that requires
that yytoken be updated with the new translation. We take the that yytoken be updated with the new translation. We take the
approach of translating immediately before every use of yytoken. approach of translating immediately before every use of yytoken.
One alternative is translating here after every semantic action, One alternative is translating here after every semantic action,
but that translation would be missed if the semantic action invokes but that translation would be missed if the semantic action invokes
YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
skipping to change at line 2564 skipping to change at line 2557
#ifndef yyoverflow #ifndef yyoverflow
if (yyss != yyssa) if (yyss != yyssa)
YYSTACK_FREE (yyss); YYSTACK_FREE (yyss);
#endif #endif
#if YYERROR_VERBOSE #if YYERROR_VERBOSE
if (yymsg != yymsgbuf) if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg); YYSTACK_FREE (yymsg);
#endif #endif
return yyresult; return yyresult;
} }
#line 663 "cfparse.y" #line 656 "cfparse.y"
static void fatal(const char *fmt, ...) static void fatal(const char *fmt, ...)
{ {
va_list ap; va_list ap;
char buf[MAXHOSTNAMELEN + 100]; char buf[MAXHOSTNAMELEN + 100];
va_start(ap, fmt); va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap); vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap); va_end(ap);
skipping to change at line 2796 skipping to change at line 2789
} }
yyparse(); yyparse();
fclose(fp); fclose(fp);
} }
/** /**
* Local Variables: * Local Variables:
* indent-tabs-mode: t * indent-tabs-mode: t
* c-file-style: "ellemtel" * c-file-style: "cc-mode"
* c-basic-offset: 4
* End: * End:
*/ */
 End of changes. 148 change blocks. 
164 lines changed or deleted 154 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)