From: Dave Hart Date: Thu, 10 Sep 2009 04:31:45 +0000 (+0000) Subject: switch to verb then object order, "nic listen all", "interface drop eth0" X-Git-Tag: NTP_4_2_5P212~4^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00f02e79d438e6cec48d3d84fa6c738d70bd12b5;p=thirdparty%2Fntp.git switch to verb then object order, "nic listen all", "interface drop eth0" Correct syntax error line & column numbers. bk: 4aa88131iSbAIkFeS14yaYGHgSxl9A --- diff --git a/ChangeLog b/ChangeLog index 1286103cf..3ac6bc2fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ -* [Bug 983] add interface ... [listen | ignore | drop] directive. +* [Bug 983] add interface [listen | ignore | drop] ... directive. * document interface (alias nic) and unpeer. +* Correct syntax error line & column numbers. (4.2.5p210) 2009/09/06 Released by Harlan Stenn * [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros for Windows and remove unnecessary reference to applink.c for Windows diff --git a/html/miscopt.html b/html/miscopt.html index 99ea2d09c..30c5ec37d 100644 --- a/html/miscopt.html +++ b/html/miscopt.html @@ -50,8 +50,8 @@
includefile includefile
This command allows additional configuration commands to be included from a separate file. Include files may be nested to a depth of five; upon reaching the end of any include file, command processing resumes in the previous configuration file. This option is useful for sites that run ntpd on multiple hosts, with (mostly) common options (e.g., a restriction list).
-
interface [all | ipv4 | ipv6 | name | address] [[prefixlen bits]] [listen | ignore | drop]
-
This command controls which network addresses ntpd opens, and whether input is dropped without processing. The first argument specifies a class of addresses, or a specific interface name, or an address. In the latter case, prefixlen determines how many bits must match for this rule to apply. The action defaults to listen if not specified. The ignore action prevents opening matching addresses, in contrast, drop causes ntpd to open the interface and drop all received packets without examination. Multiple interface commands can be used. The last one which matches a particular address determines the action for it. The nic command is an alias for interface.
+
interface [listen | ignore | drop] [all | ipv4 | ipv6 | name | address] [[prefixlen bits]]
+
This command controls which network addresses ntpd opens, and whether input is dropped without processing. The first parameter determines the action for addresses which match the second parameter. That parameter specifies a class of addresses, or a specific interface name, or an address. In the address case, prefixlen determines how many bits must match for this rule to apply. The ignore action prevents opening matching addresses, in contrast, drop causes ntpd to open the interface and drop all received packets without examination. Multiple interface commands can be used. The last rule which matches a particular address determines the action for it. The nic command is an alias for interface.
leapfile leapfile
This command loads the NIST leapseconds file and initializes the leapsecond values for the next leapsecond time, expiration time and TAI offset. The file can be obtained directly from NIST national time servers using ftp as the ASCII file pub/leap-seconds.

While not strictly a security function, the Autokey protocol provides means to securely retrieve the current or updated leapsecond values from a server.

diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 1f864abbd..9c3204f2b 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -1361,6 +1361,27 @@ dump_config_tree( fprintf(df, "interface "); + switch (rule_node->action) { + + default: + fprintf(df, "\n# dump error:\n" + "# unknown nic action %d\n", + rule_node->action); + break; + + case T_Listen: + fprintf(df, "listen "); + break; + + case T_Ignore: + fprintf(df, "ignore "); + break; + + case T_Drop: + fprintf(df, "drop "); + break; + } + switch (rule_node->match_class) { default: @@ -1389,27 +1410,6 @@ dump_config_tree( if (-1 != rule_node->prefixlen) fprintf(df, " prefixlen %d", rule_node->prefixlen); - switch (rule_node->action) { - - default: - fprintf(df, "\n# dump error:\n" - "# unknown nic action %d\n", - rule_node->action); - break; - - case T_Listen: - /* listen is the default without a modifier */ - break; - - case T_Ignore: - fprintf(df, " ignore"); - break; - - case T_Drop: - fprintf(df, " drop"); - break; - } - fprintf(df, "\n"); } @@ -3923,8 +3923,14 @@ config_remotely( ) { struct FILE_INFO remote_cuckoo; + char origin[128]; + snprintf(origin, sizeof(origin), "remote config from %s", + stoa(remote_addr)); memset(&remote_cuckoo, 0, sizeof(remote_cuckoo)); + remote_cuckoo.fname = origin; + remote_cuckoo.line_no = 1; + remote_cuckoo.line_no = 1; ip_file = &remote_cuckoo; input_from_file = 0; diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c index 5f123b81c..6247fa64f 100644 --- a/ntpd/ntp_control.c +++ b/ntpd/ntp_control.c @@ -2508,17 +2508,13 @@ static void configure( * Succeeded'. Else output the error count. It would be nice * to output any parser error messages. */ - if (0 == remote_config.no_errors) + if (0 == remote_config.no_errors) { retval = snprintf(remote_config.err_msg, sizeof(remote_config.err_msg), "Config Succeeded"); - else - retval = snprintf(remote_config.err_msg, - sizeof(remote_config.err_msg), - "%d error, failure", - remote_config.no_errors); - if (retval > 0) - remote_config.err_pos += retval; + if (retval > 0) + remote_config.err_pos += retval; + } ctl_putdata(remote_config.err_msg, remote_config.err_pos, 0); ctl_flushpkt(0); diff --git a/ntpd/ntp_parser.c b/ntpd/ntp_parser.c index 666ea1156..e68c6efbf 100644 --- a/ntpd/ntp_parser.c +++ b/ntpd/ntp_parser.c @@ -710,16 +710,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 171 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 652 +#define YYLAST 681 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 167 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 68 /* YYNRULES -- Number of rules. */ -#define YYNRULES 245 +#define YYNRULES 244 /* YYNRULES -- Number of states. */ -#define YYNSTATES 385 +#define YYNSTATES 383 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -800,11 +800,11 @@ static const yytype_uint16 yyprhs[] = 433, 436, 439, 441, 445, 447, 450, 453, 456, 459, 462, 465, 468, 471, 474, 477, 480, 483, 487, 490, 493, 495, 498, 499, 504, 508, 511, 513, 516, 519, - 522, 524, 526, 530, 536, 540, 542, 544, 546, 548, - 550, 551, 553, 555, 557, 560, 562, 565, 567, 570, - 572, 574, 576, 578, 580, 582, 588, 590, 594, 597, - 601, 605, 608, 610, 616, 621, 625, 628, 630, 637, - 641, 644, 648, 652, 656, 660 + 522, 524, 526, 530, 534, 540, 542, 544, 546, 548, + 550, 552, 554, 556, 559, 561, 564, 566, 569, 571, + 573, 575, 577, 579, 581, 587, 589, 593, 596, 600, + 604, 607, 609, 615, 620, 624, 627, 629, 636, 640, + 643, 647, 651, 655, 659 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -862,21 +862,21 @@ static const yytype_int16 yyrhs[] = 115, 131, -1, 131, -1, 131, 30, -1, -1, 131, 164, 131, 26, -1, 131, 164, 131, -1, 210, 211, -1, 211, -1, 109, 52, -1, 53, 174, -1, 212, - 213, -1, 213, -1, 131, -1, 215, 216, 217, -1, - 215, 131, 112, 52, 217, -1, 215, 131, 217, -1, + 213, -1, 213, -1, 131, -1, 215, 217, 216, -1, + 215, 217, 131, -1, 215, 217, 131, 112, 52, -1, 53, -1, 88, -1, 4, -1, 54, -1, 56, -1, - -1, 67, -1, 50, -1, 32, -1, 218, 52, -1, - 52, -1, 219, 131, -1, 131, -1, 220, 173, -1, - 173, -1, 52, -1, 140, -1, 35, -1, 52, -1, - 30, -1, 224, 165, 225, 227, 166, -1, 154, -1, - 225, 226, 153, -1, 226, 153, -1, 155, 164, 222, - -1, 156, 164, 222, -1, 227, 228, -1, 228, -1, - 230, 165, 229, 231, 166, -1, 157, 164, 222, 153, - -1, 122, 164, 173, -1, 231, 232, -1, 232, -1, - 158, 164, 222, 165, 233, 166, -1, 233, 234, 153, - -1, 234, 153, -1, 159, 164, 222, -1, 160, 164, - 222, -1, 161, 164, 222, -1, 162, 164, 222, -1, - 163, 164, 222, -1 + 67, -1, 50, -1, 32, -1, 218, 52, -1, 52, + -1, 219, 131, -1, 131, -1, 220, 173, -1, 173, + -1, 52, -1, 140, -1, 35, -1, 52, -1, 30, + -1, 224, 165, 225, 227, 166, -1, 154, -1, 225, + 226, 153, -1, 226, 153, -1, 155, 164, 222, -1, + 156, 164, 222, -1, 227, 228, -1, 228, -1, 230, + 165, 229, 231, 166, -1, 157, 164, 222, 153, -1, + 122, 164, 173, -1, 231, 232, -1, 232, -1, 158, + 164, 222, 165, 233, 166, -1, 233, 234, 153, -1, + 234, 153, -1, 159, 164, 222, -1, 160, 164, 222, + -1, 161, 164, 222, -1, 162, 164, 222, -1, 163, + 164, 222, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -903,10 +903,10 @@ static const yytype_uint16 yyrline[] = 807, 809, 811, 814, 816, 818, 820, 822, 824, 826, 831, 833, 837, 841, 843, 848, 850, 854, 855, 859, 860, 864, 879, 884, 889, 897, 898, 902, 903, 904, - 908, 909, 910, 911, 921, 922, 926, 927, 931, 932, - 936, 945, 946, 950, 951, 960, 975, 979, 980, 984, - 985, 989, 990, 994, 999, 1003, 1007, 1008, 1012, 1017, - 1018, 1022, 1024, 1026, 1028, 1030 + 908, 909, 910, 920, 921, 925, 926, 930, 931, 935, + 944, 945, 949, 950, 959, 974, 978, 979, 983, 984, + 988, 989, 993, 998, 1002, 1006, 1007, 1011, 1016, 1017, + 1021, 1023, 1025, 1027, 1029 }; #endif @@ -1017,10 +1017,10 @@ static const yytype_uint8 yyr1[] = 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, 208, 209, 209, 210, 210, 211, 211, 212, 212, 213, 214, 214, 214, 215, 215, 216, 216, 216, - 217, 217, 217, 217, 218, 218, 219, 219, 220, 220, - 221, 221, 221, 222, 222, 223, 224, 225, 225, 226, - 226, 227, 227, 228, 229, 230, 231, 231, 232, 233, - 233, 234, 234, 234, 234, 234 + 217, 217, 217, 218, 218, 219, 219, 220, 220, 221, + 221, 221, 222, 222, 223, 224, 225, 225, 226, 226, + 227, 227, 228, 229, 230, 231, 231, 232, 233, 233, + 234, 234, 234, 234, 234 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -1046,11 +1046,11 @@ static const yytype_uint8 yyr2[] = 2, 2, 1, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 2, 0, 4, 3, 2, 1, 2, 2, 2, - 1, 1, 3, 5, 3, 1, 1, 1, 1, 1, - 0, 1, 1, 1, 2, 1, 2, 1, 2, 1, - 1, 1, 1, 1, 1, 5, 1, 3, 2, 3, - 3, 2, 1, 5, 4, 3, 2, 1, 6, 3, - 2, 3, 3, 3, 3, 3 + 1, 1, 3, 3, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, + 1, 1, 1, 1, 5, 1, 3, 2, 3, 3, + 2, 1, 5, 4, 3, 2, 1, 6, 3, 2, + 3, 3, 3, 3, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -1062,111 +1062,111 @@ static const yytype_uint8 yydefact[] = 0, 0, 192, 0, 174, 0, 0, 0, 205, 0, 0, 0, 0, 0, 25, 0, 0, 206, 0, 23, 0, 0, 22, 0, 0, 0, 21, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 48, 49, 226, 0, + 0, 0, 0, 0, 0, 0, 48, 49, 225, 0, 2, 0, 7, 0, 8, 0, 9, 10, 13, 11, 12, 14, 15, 16, 17, 172, 0, 18, 0, 5, - 53, 182, 224, 223, 175, 176, 54, 0, 0, 0, + 53, 182, 223, 222, 175, 176, 54, 0, 0, 0, 0, 0, 0, 55, 61, 64, 155, 156, 157, 158, 159, 160, 161, 152, 154, 0, 0, 0, 113, 136, 190, 178, 151, 90, 91, 92, 93, 97, 94, 95, 96, 0, 0, 0, 29, 0, 26, 6, 56, 57, - 179, 201, 183, 200, 181, 219, 51, 52, 60, 217, + 179, 201, 183, 200, 181, 218, 51, 52, 60, 216, 184, 180, 189, 58, 119, 0, 0, 119, 26, 0, 185, 85, 89, 86, 177, 0, 0, 0, 0, 0, 0, 0, 162, 164, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 71, 73, 186, 215, 59, - 188, 1, 0, 4, 20, 47, 207, 208, 209, 210, - 210, 0, 65, 66, 67, 68, 69, 70, 63, 153, - 137, 138, 139, 135, 191, 105, 104, 0, 102, 103, - 0, 87, 99, 27, 28, 0, 0, 0, 0, 0, - 0, 0, 0, 140, 142, 173, 199, 218, 216, 115, - 119, 119, 114, 0, 0, 88, 165, 166, 167, 168, - 169, 170, 171, 163, 83, 74, 222, 220, 221, 76, - 75, 81, 79, 84, 80, 78, 82, 77, 72, 0, - 0, 187, 196, 214, 3, 32, 0, 34, 35, 0, - 0, 0, 0, 39, 40, 41, 42, 0, 0, 43, - 19, 31, 213, 212, 211, 0, 204, 202, 0, 0, - 0, 0, 100, 112, 108, 110, 106, 107, 109, 111, - 101, 98, 147, 148, 149, 150, 146, 145, 143, 144, - 141, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 120, 116, 117, 119, 194, - 198, 197, 195, 33, 36, 38, 37, 45, 44, 46, - 30, 210, 0, 0, 0, 0, 0, 232, 0, 228, - 118, 193, 203, 229, 230, 0, 227, 225, 231, 0, - 235, 0, 0, 0, 0, 0, 237, 0, 0, 233, - 236, 234, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 238, 0, 240, 241, - 242, 243, 244, 245, 239 + 0, 0, 0, 0, 0, 71, 73, 186, 214, 59, + 188, 1, 0, 4, 20, 47, 212, 211, 210, 0, + 0, 65, 66, 67, 68, 69, 70, 63, 153, 137, + 138, 139, 135, 191, 105, 104, 0, 102, 103, 0, + 87, 99, 27, 28, 0, 0, 0, 0, 0, 0, + 0, 0, 140, 142, 173, 199, 217, 215, 115, 119, + 119, 114, 0, 0, 88, 165, 166, 167, 168, 169, + 170, 171, 163, 83, 74, 221, 219, 220, 76, 75, + 81, 79, 84, 80, 78, 82, 77, 72, 0, 0, + 187, 196, 213, 3, 32, 0, 34, 35, 0, 0, + 0, 0, 39, 40, 41, 42, 0, 0, 43, 19, + 31, 207, 208, 209, 203, 202, 0, 0, 0, 0, + 100, 112, 108, 110, 106, 107, 109, 111, 101, 98, + 147, 148, 149, 150, 146, 145, 143, 144, 141, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 120, 116, 117, 119, 194, 198, 197, + 195, 33, 36, 38, 37, 45, 44, 46, 30, 0, + 0, 0, 0, 0, 0, 231, 0, 227, 118, 193, + 204, 228, 229, 0, 226, 224, 230, 0, 234, 0, + 0, 0, 0, 0, 236, 0, 0, 232, 235, 233, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 237, 0, 239, 240, 241, 242, + 243, 244, 238 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 49, 50, 51, 52, 53, 125, 116, 270, 271, + -1, 49, 50, 51, 52, 53, 125, 116, 269, 270, 54, 55, 56, 57, 83, 84, 85, 58, 165, 166, - 59, 141, 111, 201, 202, 290, 60, 219, 315, 98, - 99, 61, 213, 214, 62, 93, 94, 63, 152, 153, - 64, 101, 140, 251, 252, 122, 123, 65, 66, 180, - 276, 169, 130, 126, 239, 74, 67, 68, 280, 281, - 336, 337, 352, 338, 355, 356, 369, 370 + 59, 141, 111, 200, 201, 288, 60, 218, 313, 98, + 99, 61, 212, 213, 62, 93, 94, 63, 152, 153, + 64, 101, 140, 250, 251, 122, 123, 65, 66, 275, + 179, 169, 130, 126, 238, 74, 67, 68, 278, 279, + 334, 335, 350, 336, 353, 354, 367, 368 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -178 +#define YYPACT_NINF -136 static const yytype_int16 yypact[] = { - 124, -120, -10, -7, -178, -178, -8, -5, 3, 121, - 4, -4, -90, 4, -178, 46, 17, -72, -178, -66, - -64, -63, -60, -55, -178, 17, 17, -178, -52, -178, - -47, -44, -178, -33, 40, -19, -178, -32, 46, -31, - -8, -1, 207, -28, 52, 52, -178, -178, -178, 114, - 292, -38, -178, 17, -178, 17, -178, -178, -178, -178, - -178, -178, -178, -178, -178, -178, 2, -178, -30, -178, - -178, -178, -178, -178, -178, -178, -178, 9, 12, 14, - 18, 77, 22, -178, 121, -178, -178, -178, -178, -178, - -178, -178, -178, 4, -178, 108, 110, 112, -4, -178, - 135, -178, 4, -178, -178, -178, -178, -178, -178, -178, - -178, -9, 35, 37, -178, 167, -178, 434, -178, -178, - -178, -178, -60, -178, -178, -178, 17, 17, -178, -178, - 42, -178, -178, -178, -178, -14, -11, -178, 100, 15, - -178, 46, -178, -178, -178, -8, -8, -8, -8, -8, - -8, -8, -1, -178, 128, 129, -27, 134, -8, -8, - 138, -8, -8, 139, 142, 207, -178, -36, -178, 143, - 143, -178, 23, -178, 503, -178, -178, -178, -178, -16, - -13, -126, -178, -178, -178, -178, -178, -178, -178, -178, - -178, -178, -178, -178, -178, -178, -178, 56, -178, -178, - 50, -9, -178, -178, -178, -27, -27, -27, -27, 68, - 149, -8, -8, 167, -178, -178, -178, -178, -178, -2, - -178, -178, -2, -28, 71, -178, -178, -178, -178, -178, - -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, - -178, -178, -178, -178, -178, -178, -178, -178, -178, -28, - 151, -36, -178, -178, -178, -178, -8, -178, -178, 152, - 157, 158, 161, -178, -178, -178, -178, 162, 165, -178, - 503, -178, -178, -178, -178, 173, -178, -178, 66, 69, - -73, 81, -178, -178, -178, -178, -178, -178, -178, -178, - -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, - -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, - -178, -178, -178, -178, -178, -178, -2, -2, -178, 210, - -178, -178, -178, -178, -178, -178, -178, -178, -178, -178, - -178, -13, -8, -8, 74, 87, -102, -178, 76, -178, - -2, -178, -178, -178, -178, 17, -178, -178, -178, 91, - -178, 94, 102, -8, 103, -127, -178, 111, -8, -178, - -178, -178, 109, 60, 115, 116, 117, 125, 127, 93, - 122, -8, -8, -8, -8, -8, -178, 123, -178, -178, - -178, -178, -178, -178, -178 + 129, -119, -17, -11, -136, -136, -9, -5, -1, 24, + 6, 9, -85, 6, -136, 109, -35, -82, -136, -78, + -76, -74, -71, -68, -136, -35, -35, -136, -66, -136, + -63, -62, -136, -60, 22, -18, -136, -51, 109, -48, + -9, -2, 580, -44, 34, 34, -136, -136, -136, 88, + 290, -61, -136, -35, -136, -35, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -6, -136, -72, -136, + -136, -136, -136, -136, -136, -136, -136, -42, -36, -33, + -32, 49, 3, -136, 24, -136, -136, -136, -136, -136, + -136, -136, -136, 6, -136, 51, 62, 73, 9, -136, + 98, -136, 6, -136, -136, -136, -136, -136, -136, -136, + -136, -8, 8, 10, -136, 145, -136, 432, -136, -136, + -136, -136, -71, -136, -136, -136, -35, -35, -136, -136, + 15, -136, -136, -136, -136, -16, -15, -136, 75, -14, + -136, 109, -136, -136, -136, -9, -9, -9, -9, -9, + -9, -9, -2, -136, 101, 102, -28, 103, -9, -9, + 106, -9, -9, 112, 113, 580, -136, -47, -136, 115, + 115, -136, 16, -136, 501, -136, -136, -136, -136, 0, + -125, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, 37, -136, -136, 11, + -8, -136, -136, -136, -28, -28, -28, -28, 41, 121, + -9, -9, 145, -136, -136, -136, -136, -136, 525, -136, + -136, 525, -44, 56, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -44, 139, + -47, -136, -136, -136, -136, -9, -136, -136, 140, 142, + 143, 144, -136, -136, -136, -136, 147, 148, -136, 501, + -136, -136, -136, -136, 96, -136, 45, 46, -89, 58, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, + -136, -136, -136, -136, 525, 525, -136, 186, -136, -136, + -136, -136, -136, -136, -136, -136, -136, -136, -136, 166, + -9, -9, 55, 67, -107, -136, 59, -136, 525, -136, + -136, -136, -136, -35, -136, -136, -136, 64, -136, 61, + 65, -9, 63, -118, -136, 77, -9, -136, -136, -136, + 66, 44, 69, 71, 74, 76, 78, -84, 86, -9, + -9, -9, -9, -9, -136, 90, -136, -136, -136, -136, + -136, -136, -136 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -178, -178, -178, -39, -178, -178, -3, -34, -178, 24, - -178, -178, -178, -178, -178, -178, 204, -178, -178, 130, - -178, -178, -15, -178, 95, -178, -178, -135, -178, -178, - 200, -178, -178, 90, -178, 291, -67, -178, -178, 159, - -178, -178, -178, -178, 58, -178, 190, -178, -178, -178, - -177, 271, -178, 295, 65, -40, -178, -178, -178, 44, - -178, -6, -178, -178, -178, -17, -178, -42 + -136, -136, -136, -45, -136, -136, -3, -34, -136, -41, + -136, -136, -136, -136, -136, -136, 162, -136, -136, 82, + -136, -136, -21, -136, 50, -136, -136, -135, -136, -136, + 155, -136, -136, 43, -136, 244, -64, -136, -136, 107, + -136, -136, -136, -136, 14, -136, 136, -136, -136, -136, + -136, 215, -136, 235, -29, -40, -136, -136, -136, -13, + -136, -65, -136, -136, -136, -81, -136, -91 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -1176,142 +1176,148 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -7 static const yytype_int16 yytable[] = { - 144, 138, 222, 277, 145, 95, 176, 134, 236, 167, - 86, 172, 220, 115, 87, 221, 272, 249, 195, 272, - 334, 88, 72, 142, 196, 237, 189, 197, 146, 278, - 279, 354, 137, 69, 273, 189, 135, 273, 136, 359, - 301, 100, 70, 147, 73, 71, 148, 75, 302, 334, - 174, 274, 175, 283, 274, 76, 177, 198, 178, 117, - 303, 304, 89, 305, 347, 118, 103, 119, 120, 306, - 104, 121, 112, 250, 113, 284, 124, 96, 215, 128, - 199, 97, 278, 279, 129, 316, 317, 131, 307, 90, - 308, 309, 133, 310, 311, 312, 275, 313, 132, 139, - 143, 149, 91, 114, 168, 226, 227, 228, 229, 230, - 231, 232, 114, 238, 171, 173, 105, 203, 241, 242, - 204, 244, 245, 217, 217, 1, 225, 150, 151, 186, - 92, 2, 3, 179, 200, 181, 285, 4, 5, 6, - 182, 286, 7, 183, 314, 184, 8, 9, 114, 185, - 106, 10, 11, 187, 342, 12, 287, 13, 14, 107, - 190, 15, 191, 108, 192, 194, 203, 77, 204, 16, - 78, 298, 299, 218, 223, 17, 254, 18, 109, 224, - 234, 235, 110, 340, 19, 20, 240, 282, 21, 318, - 243, 246, 22, 23, 247, 253, 24, 25, 288, 296, - 289, 297, 319, 321, 324, 205, 206, 207, 208, 325, - 326, 26, 27, 327, 328, 320, 323, 329, 154, 364, - 365, 366, 367, 368, 28, 331, 155, 29, 156, 30, - 332, 31, 32, 333, 339, 79, 341, 80, 345, 33, - 346, 349, 81, 34, 35, 82, 36, 37, 351, 38, - 157, 39, 364, 365, 366, 367, 368, 40, 353, 376, - 354, 41, 42, 43, 361, 44, 45, 358, 46, 47, - 292, 293, 294, 295, 363, 378, 384, -6, 48, 371, - 372, 373, 158, 159, 160, 209, 161, 162, 188, 374, - 163, 375, 343, 344, 330, 248, 291, 210, 193, 2, - 3, 211, 212, 300, 102, 4, 5, 6, 164, 322, - 7, 233, 216, 357, 8, 9, 170, 0, 362, 10, - 11, 127, 0, 12, 335, 13, 14, 377, 0, 15, - 348, 379, 380, 381, 382, 383, 0, 16, 360, 0, - 0, 0, 350, 17, 0, 18, 0, 0, 0, 0, + 144, 138, 221, 145, 271, 172, 248, 235, 134, 167, + 219, 220, 86, 115, 281, 332, 87, 142, 95, 194, + 112, 72, 113, 88, 236, 195, 176, 146, 196, 188, + 276, 277, 137, 332, 69, 70, 282, 135, 188, 136, + 352, 71, 147, 73, 177, 148, 100, 75, 357, 117, + 174, 76, 175, 118, 272, 119, 273, 120, 197, 345, + 121, 178, 249, 124, 89, 128, 276, 277, 129, 131, + 77, 132, 214, 78, 133, 362, 363, 364, 365, 366, + 139, 198, 374, 143, 314, 315, 168, 114, 171, 181, + 96, 90, 173, 180, 97, 182, 114, 283, 183, 184, + 149, 185, 284, 189, 91, 225, 226, 227, 228, 229, + 230, 231, 237, 114, 190, 202, 203, 285, 240, 241, + 224, 243, 244, 216, 216, 191, 150, 151, 193, 103, + 1, 274, 92, 104, 186, 199, 2, 3, 79, 202, + 80, 203, 4, 5, 6, 81, 217, 7, 82, 222, + 223, 8, 9, 233, 234, 239, 10, 11, 242, 286, + 12, 287, 13, 14, 245, 246, 15, 252, 280, 253, + 296, 297, 294, 295, 16, 290, 291, 292, 293, 105, + 17, 338, 18, 204, 205, 206, 207, 317, 316, 19, + 20, 319, 322, 21, 323, 324, 325, 22, 23, 326, + 327, 24, 25, 362, 363, 364, 365, 366, 329, 330, + 331, 337, 339, 106, 318, 321, 26, 27, 340, 343, + 344, 349, 107, 352, 347, 351, 108, 356, 328, 28, + 359, 361, 29, 369, 30, 370, 31, 32, 371, 376, + 372, 109, 373, 382, 33, 110, 187, 247, 34, 35, + 289, 36, 37, 192, 38, 298, 39, 102, 215, 232, + 170, 127, 40, 208, 320, 333, 41, 42, 43, 346, + 44, 45, 358, 46, 47, 209, 375, 0, 0, 210, + 211, 0, -6, 48, 0, 0, 0, 0, 0, 0, + 341, 342, 0, 0, 0, 0, 0, 2, 3, 0, + 0, 0, 0, 4, 5, 6, 0, 0, 7, 0, + 0, 355, 8, 9, 0, 0, 360, 10, 11, 0, + 0, 12, 0, 13, 14, 0, 0, 15, 0, 377, + 378, 379, 380, 381, 0, 16, 0, 0, 0, 0, + 348, 17, 0, 18, 0, 0, 0, 0, 0, 0, + 19, 20, 0, 0, 21, 0, 0, 0, 22, 23, + 0, 0, 24, 25, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 26, 27, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 28, 0, 0, 29, 0, 30, 0, 31, 32, 0, + 0, 0, 0, 0, 0, 33, 0, 0, 0, 34, + 35, 0, 36, 37, 0, 38, 0, 39, 0, 0, + 0, 0, 0, 40, 0, 0, 0, 41, 42, 43, + 0, 44, 45, 0, 46, 47, 0, 0, 0, 2, + 3, 0, 0, -6, 48, 4, 5, 6, 0, 0, + 7, 0, 0, 0, 8, 9, 0, 0, 0, 10, + 11, 0, 0, 12, 0, 13, 14, 0, 0, 15, + 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, + 0, 0, 0, 17, 0, 18, 0, 0, 0, 0, 0, 0, 19, 20, 0, 0, 21, 0, 0, 0, - 22, 23, 0, 0, 24, 25, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, + 22, 23, 0, 0, 24, 25, 0, 0, 254, 0, + 0, 0, 0, 255, 0, 0, 0, 256, 0, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 29, 0, 30, 0, 31, - 32, 0, 0, 0, 0, 0, 0, 33, 0, 0, + 32, 0, 0, 0, 0, 0, 0, 33, 0, 257, 0, 34, 35, 0, 36, 37, 0, 38, 0, 39, - 0, 0, 0, 0, 0, 40, 0, 0, 0, 41, - 42, 43, 0, 44, 45, 0, 46, 47, 0, 0, - 0, 2, 3, 0, 0, -6, 48, 4, 5, 6, - 0, 0, 7, 0, 0, 0, 8, 9, 0, 0, - 0, 10, 11, 0, 0, 12, 0, 13, 14, 0, - 0, 15, 0, 0, 0, 0, 0, 0, 0, 16, - 0, 0, 0, 0, 0, 17, 0, 18, 0, 0, - 0, 0, 0, 0, 19, 20, 0, 0, 21, 0, - 0, 0, 22, 23, 0, 0, 24, 25, 0, 0, - 255, 0, 0, 0, 0, 256, 0, 0, 0, 257, - 0, 26, 27, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 28, 0, 0, 29, 0, 30, - 0, 31, 32, 0, 0, 0, 0, 0, 0, 33, - 0, 258, 0, 34, 35, 0, 36, 37, 0, 38, - 0, 39, 259, 0, 0, 0, 0, 40, 0, 0, - 0, 41, 42, 43, 0, 44, 45, 0, 46, 47, - 0, 260, 0, 0, 0, 261, 0, 262, 48, 0, - 0, 0, 0, 0, 0, 0, 0, 263, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 264, 265, 0, 0, 0, 0, 0, + 258, 0, 0, 0, 0, 40, 0, 299, 0, 41, + 42, 43, 0, 44, 45, 300, 46, 47, 0, 259, + 0, 0, 0, 260, 0, 261, 48, 301, 302, 0, + 303, 154, 0, 0, 0, 262, 304, 0, 0, 155, + 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 263, 264, 0, 0, 305, 0, 306, 307, 0, + 308, 309, 310, 157, 311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 266, 0, 267, 0, 0, 0, 268, - 0, 0, 269 + 0, 265, 0, 266, 0, 0, 0, 267, 0, 0, + 268, 0, 0, 0, 0, 158, 159, 160, 0, 161, + 162, 0, 0, 163, 0, 0, 0, 0, 0, 0, + 0, 312, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 164 }; static const yytype_int16 yycheck[] = { - 40, 35, 137, 180, 5, 9, 4, 26, 35, 43, - 6, 50, 26, 16, 10, 26, 32, 53, 27, 32, - 122, 17, 30, 38, 33, 52, 93, 36, 29, 155, - 156, 158, 35, 153, 50, 102, 55, 50, 57, 166, - 42, 131, 52, 44, 52, 52, 47, 52, 50, 122, - 53, 67, 55, 3, 67, 52, 54, 66, 56, 131, - 62, 63, 58, 65, 166, 131, 20, 131, 131, 71, - 24, 131, 55, 109, 57, 25, 131, 81, 117, 131, - 89, 85, 155, 156, 131, 220, 221, 131, 90, 85, - 92, 93, 52, 95, 96, 97, 112, 99, 131, 131, - 131, 102, 98, 131, 52, 145, 146, 147, 148, 149, - 150, 151, 131, 140, 0, 153, 70, 131, 158, 159, - 131, 161, 162, 126, 127, 1, 141, 128, 129, 52, - 126, 7, 8, 131, 143, 165, 86, 13, 14, 15, - 131, 91, 18, 131, 146, 131, 22, 23, 131, 131, - 104, 27, 28, 131, 331, 31, 106, 33, 34, 113, - 52, 37, 52, 117, 52, 30, 131, 46, 131, 45, - 49, 211, 212, 131, 74, 51, 153, 53, 132, 164, - 52, 52, 136, 318, 60, 61, 52, 131, 64, 223, - 52, 52, 68, 69, 52, 52, 72, 73, 148, 131, - 150, 52, 131, 52, 52, 38, 39, 40, 41, 52, - 52, 87, 88, 52, 52, 249, 256, 52, 11, 159, - 160, 161, 162, 163, 100, 52, 19, 103, 21, 105, - 164, 107, 108, 164, 153, 114, 26, 116, 164, 115, - 153, 165, 121, 119, 120, 124, 122, 123, 157, 125, - 43, 127, 159, 160, 161, 162, 163, 133, 164, 166, - 158, 137, 138, 139, 153, 141, 142, 164, 144, 145, - 205, 206, 207, 208, 165, 153, 153, 153, 154, 164, - 164, 164, 75, 76, 77, 118, 79, 80, 84, 164, - 83, 164, 332, 333, 270, 165, 201, 130, 98, 7, - 8, 134, 135, 213, 13, 13, 14, 15, 101, 251, - 18, 152, 122, 353, 22, 23, 45, -1, 358, 27, - 28, 26, -1, 31, 280, 33, 34, 369, -1, 37, - 336, 371, 372, 373, 374, 375, -1, 45, 355, -1, - -1, -1, 345, 51, -1, 53, -1, -1, -1, -1, + 40, 35, 137, 5, 4, 50, 53, 35, 26, 43, + 26, 26, 6, 16, 3, 122, 10, 38, 9, 27, + 55, 30, 57, 17, 52, 33, 32, 29, 36, 93, + 155, 156, 35, 122, 153, 52, 25, 55, 102, 57, + 158, 52, 44, 52, 50, 47, 131, 52, 166, 131, + 53, 52, 55, 131, 54, 131, 56, 131, 66, 166, + 131, 67, 109, 131, 58, 131, 155, 156, 131, 131, + 46, 131, 117, 49, 52, 159, 160, 161, 162, 163, + 131, 89, 166, 131, 219, 220, 52, 131, 0, 131, + 81, 85, 153, 165, 85, 131, 131, 86, 131, 131, + 102, 52, 91, 52, 98, 145, 146, 147, 148, 149, + 150, 151, 140, 131, 52, 131, 131, 106, 158, 159, + 141, 161, 162, 126, 127, 52, 128, 129, 30, 20, + 1, 131, 126, 24, 131, 143, 7, 8, 114, 131, + 116, 131, 13, 14, 15, 121, 131, 18, 124, 74, + 164, 22, 23, 52, 52, 52, 27, 28, 52, 148, + 31, 150, 33, 34, 52, 52, 37, 52, 131, 153, + 210, 211, 131, 52, 45, 204, 205, 206, 207, 70, + 51, 316, 53, 38, 39, 40, 41, 131, 222, 60, + 61, 52, 52, 64, 52, 52, 52, 68, 69, 52, + 52, 72, 73, 159, 160, 161, 162, 163, 112, 164, + 164, 153, 26, 104, 248, 255, 87, 88, 52, 164, + 153, 157, 113, 158, 165, 164, 117, 164, 269, 100, + 153, 165, 103, 164, 105, 164, 107, 108, 164, 153, + 164, 132, 164, 153, 115, 136, 84, 165, 119, 120, + 200, 122, 123, 98, 125, 212, 127, 13, 122, 152, + 45, 26, 133, 118, 250, 278, 137, 138, 139, 334, + 141, 142, 353, 144, 145, 130, 367, -1, -1, 134, + 135, -1, 153, 154, -1, -1, -1, -1, -1, -1, + 330, 331, -1, -1, -1, -1, -1, 7, 8, -1, + -1, -1, -1, 13, 14, 15, -1, -1, 18, -1, + -1, 351, 22, 23, -1, -1, 356, 27, 28, -1, + -1, 31, -1, 33, 34, -1, -1, 37, -1, 369, + 370, 371, 372, 373, -1, 45, -1, -1, -1, -1, + 343, 51, -1, 53, -1, -1, -1, -1, -1, -1, + 60, 61, -1, -1, 64, -1, -1, -1, 68, 69, + -1, -1, 72, 73, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 87, 88, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 100, -1, -1, 103, -1, 105, -1, 107, 108, -1, + -1, -1, -1, -1, -1, 115, -1, -1, -1, 119, + 120, -1, 122, 123, -1, 125, -1, 127, -1, -1, + -1, -1, -1, 133, -1, -1, -1, 137, 138, 139, + -1, 141, 142, -1, 144, 145, -1, -1, -1, 7, + 8, -1, -1, 153, 154, 13, 14, 15, -1, -1, + 18, -1, -1, -1, 22, 23, -1, -1, -1, 27, + 28, -1, -1, 31, -1, 33, 34, -1, -1, 37, + -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, + -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, 64, -1, -1, -1, - 68, 69, -1, -1, 72, 73, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 87, + 68, 69, -1, -1, 72, 73, -1, -1, 7, -1, + -1, -1, -1, 12, -1, -1, -1, 16, -1, 87, 88, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 100, -1, -1, 103, -1, 105, -1, 107, - 108, -1, -1, -1, -1, -1, -1, 115, -1, -1, + 108, -1, -1, -1, -1, -1, -1, 115, -1, 48, -1, 119, 120, -1, 122, 123, -1, 125, -1, 127, - -1, -1, -1, -1, -1, 133, -1, -1, -1, 137, - 138, 139, -1, 141, 142, -1, 144, 145, -1, -1, - -1, 7, 8, -1, -1, 153, 154, 13, 14, 15, - -1, -1, 18, -1, -1, -1, 22, 23, -1, -1, - -1, 27, 28, -1, -1, 31, -1, 33, 34, -1, - -1, 37, -1, -1, -1, -1, -1, -1, -1, 45, - -1, -1, -1, -1, -1, 51, -1, 53, -1, -1, - -1, -1, -1, -1, 60, 61, -1, -1, 64, -1, - -1, -1, 68, 69, -1, -1, 72, 73, -1, -1, - 7, -1, -1, -1, -1, 12, -1, -1, -1, 16, - -1, 87, 88, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 100, -1, -1, 103, -1, 105, - -1, 107, 108, -1, -1, -1, -1, -1, -1, 115, - -1, 48, -1, 119, 120, -1, 122, 123, -1, 125, - -1, 127, 59, -1, -1, -1, -1, 133, -1, -1, - -1, 137, 138, 139, -1, 141, 142, -1, 144, 145, - -1, 78, -1, -1, -1, 82, -1, 84, 154, -1, - -1, -1, -1, -1, -1, -1, -1, 94, -1, -1, + 59, -1, -1, -1, -1, 133, -1, 42, -1, 137, + 138, 139, -1, 141, 142, 50, 144, 145, -1, 78, + -1, -1, -1, 82, -1, 84, 154, 62, 63, -1, + 65, 11, -1, -1, -1, 94, 71, -1, -1, 19, + -1, 21, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 110, 111, -1, -1, 90, -1, 92, 93, -1, + 95, 96, 97, 43, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 110, 111, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 140, -1, 142, -1, -1, -1, 146, - -1, -1, 149 + -1, 140, -1, 142, -1, -1, -1, 146, -1, -1, + 149, -1, -1, -1, -1, 75, 76, 77, -1, 79, + 80, -1, -1, 83, -1, -1, -1, -1, -1, -1, + -1, 146, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 101 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1335,28 +1341,28 @@ static const yytype_uint8 yystos[] = 209, 188, 189, 131, 222, 5, 29, 44, 47, 102, 128, 129, 205, 206, 11, 19, 21, 43, 75, 76, 77, 79, 80, 83, 101, 185, 186, 174, 52, 218, - 218, 0, 170, 153, 173, 173, 4, 54, 56, 131, - 216, 165, 131, 131, 131, 131, 52, 131, 183, 203, - 52, 52, 52, 197, 30, 27, 33, 36, 66, 89, - 143, 190, 191, 131, 131, 38, 39, 40, 41, 118, - 130, 134, 135, 199, 200, 170, 213, 173, 131, 194, - 26, 26, 194, 74, 164, 189, 222, 222, 222, 222, - 222, 222, 222, 206, 52, 52, 35, 52, 140, 221, - 52, 222, 222, 52, 222, 222, 52, 52, 186, 53, - 109, 210, 211, 52, 153, 7, 12, 16, 48, 59, - 78, 82, 84, 94, 110, 111, 140, 142, 146, 149, - 175, 176, 32, 50, 67, 112, 217, 217, 155, 156, - 225, 226, 131, 3, 25, 86, 91, 106, 148, 150, - 192, 191, 221, 221, 221, 221, 131, 52, 222, 222, - 200, 42, 50, 62, 63, 65, 71, 90, 92, 93, - 95, 96, 97, 99, 146, 195, 194, 194, 174, 131, - 174, 52, 211, 222, 52, 52, 52, 52, 52, 52, - 176, 52, 164, 164, 122, 226, 227, 228, 230, 153, - 194, 26, 217, 222, 222, 164, 153, 166, 228, 165, - 173, 157, 229, 164, 158, 231, 232, 222, 164, 166, - 232, 153, 222, 165, 159, 160, 161, 162, 163, 233, - 234, 164, 164, 164, 164, 164, 166, 234, 153, 222, - 222, 222, 222, 222, 153 + 218, 0, 170, 153, 173, 173, 32, 50, 67, 217, + 165, 131, 131, 131, 131, 52, 131, 183, 203, 52, + 52, 52, 197, 30, 27, 33, 36, 66, 89, 143, + 190, 191, 131, 131, 38, 39, 40, 41, 118, 130, + 134, 135, 199, 200, 170, 213, 173, 131, 194, 26, + 26, 194, 74, 164, 189, 222, 222, 222, 222, 222, + 222, 222, 206, 52, 52, 35, 52, 140, 221, 52, + 222, 222, 52, 222, 222, 52, 52, 186, 53, 109, + 210, 211, 52, 153, 7, 12, 16, 48, 59, 78, + 82, 84, 94, 110, 111, 140, 142, 146, 149, 175, + 176, 4, 54, 56, 131, 216, 155, 156, 225, 226, + 131, 3, 25, 86, 91, 106, 148, 150, 192, 191, + 221, 221, 221, 221, 131, 52, 222, 222, 200, 42, + 50, 62, 63, 65, 71, 90, 92, 93, 95, 96, + 97, 99, 146, 195, 194, 194, 174, 131, 174, 52, + 211, 222, 52, 52, 52, 52, 52, 52, 176, 112, + 164, 164, 122, 226, 227, 228, 230, 153, 194, 26, + 52, 222, 222, 164, 153, 166, 228, 165, 173, 157, + 229, 164, 158, 231, 232, 222, 164, 166, 232, 153, + 222, 165, 159, 160, 161, 162, 163, 233, 234, 164, + 164, 164, 164, 164, 166, 234, 153, 222, 222, 222, + 222, 222, 153 }; #define yyerrok (yyerrstatus = 0) @@ -2174,23 +2180,13 @@ yyreduce: { /* I will need to incorporate much more fine grained * error messages. The following should suffice for - * the time being. ip_file->col_no is always 1 here, - * and ip_file->line_no is one higher than the - * problem line. In other words, the scanner has - * moved on to the start of the next line. + * the time being. */ - if (input_from_file == 1) { msyslog(LOG_ERR, - "syntax error in %s line %d, " - "ignored", + "syntax error in %s line %d, column %d", ip_file->fname, - ip_file->line_no - - (ip_file->col_no == 1) - ? 1 - : 2); - } else if (input_from_file != 0) - msyslog(LOG_ERR, - "parse: bad boolean input flag"); + ip_file->err_line_no, + ip_file->err_col_no); } break; @@ -3493,7 +3489,7 @@ yyreduce: #line 880 "ntp_parser.y" { enqueue(cfgt.nic_rules, - create_nic_rule_node((yyvsp[(2) - (3)].Integer), NULL, -1, (yyvsp[(3) - (3)].Integer))); + create_nic_rule_node((yyvsp[(3) - (3)].Integer), NULL, -1, (yyvsp[(2) - (3)].Integer))); } break; @@ -3503,7 +3499,7 @@ yyreduce: #line 885 "ntp_parser.y" { enqueue(cfgt.nic_rules, - create_nic_rule_node(0, (yyvsp[(2) - (5)].String), (yyvsp[(4) - (5)].Integer), (yyvsp[(5) - (5)].Integer))); + create_nic_rule_node(0, (yyvsp[(3) - (3)].String), -1, (yyvsp[(2) - (3)].Integer))); } break; @@ -3513,63 +3509,56 @@ yyreduce: #line 890 "ntp_parser.y" { enqueue(cfgt.nic_rules, - create_nic_rule_node(0, (yyvsp[(2) - (3)].String), -1, (yyvsp[(3) - (3)].Integer))); + create_nic_rule_node(0, (yyvsp[(3) - (5)].String), (yyvsp[(5) - (5)].Integer), (yyvsp[(2) - (5)].Integer))); } break; - case 210: + case 213: /* Line 1455 of yacc.c */ -#line 908 "ntp_parser.y" - { (yyval.Integer) = T_Listen; } +#line 920 "ntp_parser.y" + { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), create_ival((yyvsp[(2) - (2)].Integer))); } break; case 214: /* Line 1455 of yacc.c */ #line 921 "ntp_parser.y" - { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), create_ival((yyvsp[(2) - (2)].Integer))); } + { (yyval.Queue) = enqueue_in_new_queue(create_ival((yyvsp[(1) - (1)].Integer))); } break; case 215: /* Line 1455 of yacc.c */ -#line 922 "ntp_parser.y" - { (yyval.Queue) = enqueue_in_new_queue(create_ival((yyvsp[(1) - (1)].Integer))); } +#line 925 "ntp_parser.y" + { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), create_pval((yyvsp[(2) - (2)].String))); } break; case 216: /* Line 1455 of yacc.c */ #line 926 "ntp_parser.y" - { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), create_pval((yyvsp[(2) - (2)].String))); } + { (yyval.Queue) = enqueue_in_new_queue(create_pval((yyvsp[(1) - (1)].String))); } break; case 217: /* Line 1455 of yacc.c */ -#line 927 "ntp_parser.y" - { (yyval.Queue) = enqueue_in_new_queue(create_pval((yyvsp[(1) - (1)].String))); } +#line 930 "ntp_parser.y" + { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Address_node)); } break; case 218: /* Line 1455 of yacc.c */ #line 931 "ntp_parser.y" - { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Address_node)); } - break; - - case 219: - -/* Line 1455 of yacc.c */ -#line 932 "ntp_parser.y" { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Address_node)); } break; - case 220: + case 219: /* Line 1455 of yacc.c */ -#line 937 "ntp_parser.y" +#line 936 "ntp_parser.y" { if ((yyvsp[(1) - (1)].Integer) != 0 && (yyvsp[(1) - (1)].Integer) != 1) { yyerror("Integer value is not boolean (0 or 1). Assuming 1"); @@ -3580,31 +3569,31 @@ yyreduce: } break; - case 221: + case 220: /* Line 1455 of yacc.c */ -#line 945 "ntp_parser.y" +#line 944 "ntp_parser.y" { (yyval.Integer) = 1; } break; - case 222: + case 221: /* Line 1455 of yacc.c */ -#line 946 "ntp_parser.y" +#line 945 "ntp_parser.y" { (yyval.Integer) = 0; } break; - case 223: + case 222: /* Line 1455 of yacc.c */ -#line 950 "ntp_parser.y" +#line 949 "ntp_parser.y" { (yyval.Double) = (double)(yyvsp[(1) - (1)].Integer); } break; - case 225: + case 224: /* Line 1455 of yacc.c */ -#line 961 "ntp_parser.y" +#line 960 "ntp_parser.y" { cfgt.sim_details = create_sim_node((yyvsp[(3) - (5)].Queue), (yyvsp[(4) - (5)].Queue)); @@ -3613,25 +3602,32 @@ yyreduce: } break; - case 226: + case 225: /* Line 1455 of yacc.c */ -#line 975 "ntp_parser.y" +#line 974 "ntp_parser.y" { old_config_style = 0; } break; + case 226: + +/* Line 1455 of yacc.c */ +#line 978 "ntp_parser.y" + { (yyval.Queue) = enqueue((yyvsp[(1) - (3)].Queue), (yyvsp[(2) - (3)].Attr_val)); } + break; + case 227: /* Line 1455 of yacc.c */ #line 979 "ntp_parser.y" - { (yyval.Queue) = enqueue((yyvsp[(1) - (3)].Queue), (yyvsp[(2) - (3)].Attr_val)); } + { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (2)].Attr_val)); } break; case 228: /* Line 1455 of yacc.c */ -#line 980 "ntp_parser.y" - { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (2)].Attr_val)); } +#line 983 "ntp_parser.y" + { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); } break; case 229: @@ -3644,119 +3640,112 @@ yyreduce: case 230: /* Line 1455 of yacc.c */ -#line 985 "ntp_parser.y" - { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); } +#line 988 "ntp_parser.y" + { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Sim_server)); } break; case 231: /* Line 1455 of yacc.c */ #line 989 "ntp_parser.y" - { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Sim_server)); } + { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Sim_server)); } break; case 232: /* Line 1455 of yacc.c */ -#line 990 "ntp_parser.y" - { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Sim_server)); } +#line 994 "ntp_parser.y" + { (yyval.Sim_server) = create_sim_server((yyvsp[(1) - (5)].Address_node), (yyvsp[(3) - (5)].Double), (yyvsp[(4) - (5)].Queue)); } break; case 233: /* Line 1455 of yacc.c */ -#line 995 "ntp_parser.y" - { (yyval.Sim_server) = create_sim_server((yyvsp[(1) - (5)].Address_node), (yyvsp[(3) - (5)].Double), (yyvsp[(4) - (5)].Queue)); } +#line 998 "ntp_parser.y" + { (yyval.Double) = (yyvsp[(3) - (4)].Double); } break; case 234: /* Line 1455 of yacc.c */ -#line 999 "ntp_parser.y" - { (yyval.Double) = (yyvsp[(3) - (4)].Double); } +#line 1002 "ntp_parser.y" + { (yyval.Address_node) = (yyvsp[(3) - (3)].Address_node); } break; case 235: /* Line 1455 of yacc.c */ -#line 1003 "ntp_parser.y" - { (yyval.Address_node) = (yyvsp[(3) - (3)].Address_node); } +#line 1006 "ntp_parser.y" + { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Sim_script)); } break; case 236: /* Line 1455 of yacc.c */ #line 1007 "ntp_parser.y" - { (yyval.Queue) = enqueue((yyvsp[(1) - (2)].Queue), (yyvsp[(2) - (2)].Sim_script)); } + { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Sim_script)); } break; case 237: /* Line 1455 of yacc.c */ -#line 1008 "ntp_parser.y" - { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (1)].Sim_script)); } +#line 1012 "ntp_parser.y" + { (yyval.Sim_script) = create_sim_script_info((yyvsp[(3) - (6)].Double), (yyvsp[(5) - (6)].Queue)); } break; case 238: /* Line 1455 of yacc.c */ -#line 1013 "ntp_parser.y" - { (yyval.Sim_script) = create_sim_script_info((yyvsp[(3) - (6)].Double), (yyvsp[(5) - (6)].Queue)); } +#line 1016 "ntp_parser.y" + { (yyval.Queue) = enqueue((yyvsp[(1) - (3)].Queue), (yyvsp[(2) - (3)].Attr_val)); } break; case 239: /* Line 1455 of yacc.c */ #line 1017 "ntp_parser.y" - { (yyval.Queue) = enqueue((yyvsp[(1) - (3)].Queue), (yyvsp[(2) - (3)].Attr_val)); } + { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (2)].Attr_val)); } break; case 240: /* Line 1455 of yacc.c */ -#line 1018 "ntp_parser.y" - { (yyval.Queue) = enqueue_in_new_queue((yyvsp[(1) - (2)].Attr_val)); } +#line 1022 "ntp_parser.y" + { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); } break; case 241: /* Line 1455 of yacc.c */ -#line 1023 "ntp_parser.y" +#line 1024 "ntp_parser.y" { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); } break; case 242: /* Line 1455 of yacc.c */ -#line 1025 "ntp_parser.y" +#line 1026 "ntp_parser.y" { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); } break; case 243: /* Line 1455 of yacc.c */ -#line 1027 "ntp_parser.y" +#line 1028 "ntp_parser.y" { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); } break; case 244: /* Line 1455 of yacc.c */ -#line 1029 "ntp_parser.y" - { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); } - break; - - case 245: - -/* Line 1455 of yacc.c */ -#line 1031 "ntp_parser.y" +#line 1030 "ntp_parser.y" { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); } break; /* Line 1455 of yacc.c */ -#line 3760 "ntp_parser.c" +#line 3759 "ntp_parser.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -3968,24 +3957,27 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1035 "ntp_parser.y" +#line 1034 "ntp_parser.y" void yyerror (char *msg) { int retval; + + ip_file->err_line_no = ip_file->prev_token_line_no; + ip_file->err_col_no = ip_file->prev_token_col_no; - if (input_from_file) - msyslog(LOG_ERR, - "line %d column %d %s", - ip_file->line_no, - ip_file->prev_token_col_no, - msg); - else { + msyslog(LOG_ERR, + "line %d column %d %s", + ip_file->err_line_no, + ip_file->err_col_no, + msg); + if (!input_from_file) { /* Save the error message in the correct buffer */ retval = snprintf(remote_config.err_msg + remote_config.err_pos, MAXLINE - remote_config.err_pos, - "%s\n", msg); + "column %d %s", + ip_file->err_col_no, msg); /* Increment the value of err_pos */ if (retval > 0) diff --git a/ntpd/ntp_parser.y b/ntpd/ntp_parser.y index 6e5f3e3d0..a35d151fe 100644 --- a/ntpd/ntp_parser.y +++ b/ntpd/ntp_parser.y @@ -303,23 +303,13 @@ command_list { /* I will need to incorporate much more fine grained * error messages. The following should suffice for - * the time being. ip_file->col_no is always 1 here, - * and ip_file->line_no is one higher than the - * problem line. In other words, the scanner has - * moved on to the start of the next line. + * the time being. */ - if (input_from_file == 1) { msyslog(LOG_ERR, - "syntax error in %s line %d, " - "ignored", + "syntax error in %s line %d, column %d", ip_file->fname, - ip_file->line_no - - (ip_file->col_no == 1) - ? 1 - : 2); - } else if (input_from_file != 0) - msyslog(LOG_ERR, - "parse: bad boolean input flag"); + ip_file->err_line_no, + ip_file->err_col_no); } ; @@ -876,20 +866,20 @@ log_config_command ; interface_command - : interface_nic nic_rule_class nic_rule_action + : interface_nic nic_rule_action nic_rule_class { enqueue(cfgt.nic_rules, - create_nic_rule_node($2, NULL, -1, $3)); + create_nic_rule_node($3, NULL, -1, $2)); } - | interface_nic T_String T_Prefixlen T_Integer nic_rule_action + | interface_nic nic_rule_action T_String { enqueue(cfgt.nic_rules, - create_nic_rule_node(0, $2, $4, $5)); + create_nic_rule_node(0, $3, -1, $2)); } - | interface_nic T_String nic_rule_action + | interface_nic nic_rule_action T_String T_Prefixlen T_Integer { enqueue(cfgt.nic_rules, - create_nic_rule_node(0, $2, -1, $3)); + create_nic_rule_node(0, $3, $5, $2)); } ; @@ -905,8 +895,7 @@ nic_rule_class ; nic_rule_action - : /* listen if not specified */ { $$ = T_Listen; } - | T_Listen + : T_Listen | T_Ignore | T_Drop ; @@ -1037,18 +1026,21 @@ sim_act_stmt void yyerror (char *msg) { int retval; + + ip_file->err_line_no = ip_file->prev_token_line_no; + ip_file->err_col_no = ip_file->prev_token_col_no; - if (input_from_file) - msyslog(LOG_ERR, - "line %d column %d %s", - ip_file->line_no, - ip_file->prev_token_col_no, - msg); - else { + msyslog(LOG_ERR, + "line %d column %d %s", + ip_file->err_line_no, + ip_file->err_col_no, + msg); + if (!input_from_file) { /* Save the error message in the correct buffer */ retval = snprintf(remote_config.err_msg + remote_config.err_pos, MAXLINE - remote_config.err_pos, - "%s\n", msg); + "column %d %s", + ip_file->err_col_no, msg); /* Increment the value of err_pos */ if (retval > 0) diff --git a/ntpd/ntp_scanner.c b/ntpd/ntp_scanner.c index 9c2d86044..b277ad26a 100644 --- a/ntpd/ntp_scanner.c +++ b/ntpd/ntp_scanner.c @@ -297,13 +297,23 @@ get_next_char( void ) { + char ch; + if (input_from_file) return (char)FGETC(ip_file); else { if (remote_config.buffer[remote_config.pos] == '\0') return EOF; - else - return(remote_config.buffer[remote_config.pos++]); + else { + ip_file->col_no++; + ch = remote_config.buffer[remote_config.pos++]; + if (ch == '\n') { + ip_file->prev_line_col_no = ip_file->col_no; + ++ip_file->line_no; + ip_file->col_no = 1; + } + return ch; + } } } @@ -314,8 +324,16 @@ push_back_char( { if (input_from_file) UNGETC(ch, ip_file); - else + else { + if (ch == '\n') { + ip_file->col_no = ip_file->prev_line_col_no; + ip_file->prev_line_col_no = -1; + --ip_file->line_no; + } + --ip_file->col_no; + remote_config.pos--; + } } @@ -531,7 +549,8 @@ yylex( } else push_back_char(ch); - /* save the column of start of the token */ + /* save the position of start of the token */ + ip_file->prev_token_line_no = ip_file->line_no; ip_file->prev_token_col_no = ip_file->col_no; /* Read in the lexeme */ diff --git a/ntpd/ntp_scanner.h b/ntpd/ntp_scanner.h index f1f4d3725..71aa4ed12 100644 --- a/ntpd/ntp_scanner.h +++ b/ntpd/ntp_scanner.h @@ -37,8 +37,12 @@ struct FILE_INFO { int prev_line_col_no; /* Col No on the previous line when a '\n' was seen */ + int prev_token_line_no; /* Line at start of + token */ int prev_token_col_no; /* Col No at start of token */ + int err_line_no; + int err_col_no; };