#include "misc.hh"
#include "pdnsexception.hh"
#include "namespaces.hh"
+#include "iputils.hh"
#define YYDEBUG 1
extern int yydebug;
#include "bindparserclasses.hh"
int yyparse(void);
int yylex(void);
void yyrestart(FILE *);
- int yywrap()
+ int yywrap(void);
+ int yywrap(void)
{
return 1;
}
static void yyerror(const char *str)
{
extern char *current_filename;
- throw PDNSException("Error in bind configuration '"+string(current_filename)+"' on line "+itoa(linenumber)+": "+str);
+ throw PDNSException("Error in bind configuration '"+string(current_filename)+"' on line "+std::to_string(linenumber)+": "+str);
}
extern FILE *yyin;
void BindParser::setDirectory(const string &dir)
{
d_dir=dir;
+ if (d_dir.back() == '/') {
+ d_dir.pop_back();
+ }
bind_directory=d_dir.c_str();
}
void BindParser::commit(BindDomainInfo DI)
{
+ DI.hadFileDirective = (DI.filename != "");
+
if(DI.filename[0]!='/')
DI.filename=d_dir+"/"+DI.filename;
%}
%token AWORD QUOTEDWORD OBRACE EBRACE SEMICOLON ZONETOK FILETOK OPTIONSTOK
-%token DIRECTORYTOK ACLTOK LOGGINGTOK CLASSTOK TYPETOK MASTERTOK ALSONOTIFYTOK
+%token DIRECTORYTOK ACLTOK LOGGINGTOK CLASSTOK TYPETOK PRIMARYTOK ALSONOTIFYTOK
%%
;
/* zone commands that also are available at global scope */
-global_zone_command: zone_file_command | zone_type_command | zone_masters_command
+global_zone_command: zone_file_command | zone_type_command | zone_primaries_command
;
-zone_masters_command: MASTERTOK OBRACE masters EBRACE
+zone_primaries_command: PRIMARYTOK OBRACE primaries EBRACE
;
zone_also_notify_command: ALSONOTIFYTOK OBRACE zone_also_notify_list EBRACE
}
;
-masters: /* empty */
+primaries: /* empty */
|
- masters master SEMICOLON
+ primaries primary SEMICOLON
;
-master: AWORD
+primary: AWORD
{
- s_di.masters.push_back($1);
+ s_di.primaries.push_back(ComboAddress($1, 53));
free($1);
}
;