Skip to content
This repository was archived by the owner on Jul 30, 2018. It is now read-only.

Commit a9b1fd9

Browse files
author
wouter
committed
- Fix to rename _t typedefs because POSIX reserves them.
git-svn-id: svn+ssh://open.nlnetlabs.nl/svn/nsd/trunk@4731 a26ef69c-88ff-0310-839f-98b793d9c207
1 parent e52ea8d commit a9b1fd9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+981
-942
lines changed

axfr.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ query_axfr(struct nsd *nsd, struct query *query)
164164
query_state_type
165165
answer_axfr_ixfr(struct nsd *nsd, struct query *q)
166166
{
167-
acl_options_t *acl = NULL;
167+
struct acl_options *acl = NULL;
168168
/* Is it AXFR? */
169169
switch (q->qtype) {
170170
case TYPE_AXFR:
171171
if (q->tcp) {
172-
zone_options_t* zone_opt;
172+
struct zone_options* zone_opt;
173173
zone_opt = zone_options_find(nsd->options, q->qname);
174174
if(!zone_opt ||
175175
acl_check_incoming(zone_opt->pattern->provide_xfr, q, &acl)==-1)

configparser.y

+14-14
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extern "C"
3030
#endif /* __cplusplus */
3131

3232
/* these need to be global, otherwise they cannot be used inside yacc */
33-
extern config_parser_state_t* cfg_parser;
33+
extern config_parser_state_type* cfg_parser;
3434

3535
#if 0
3636
#define OUTYY(s) printf s /* used ONLY when debugging */
@@ -108,15 +108,15 @@ server_ip_address: VAR_IP_ADDRESS STRING
108108
OUTYY(("P(server_ip_address:%s)\n", $2));
109109
if(cfg_parser->current_ip_address_option) {
110110
cfg_parser->current_ip_address_option->next =
111-
(ip_address_option_t*)region_alloc(
112-
cfg_parser->opt->region, sizeof(ip_address_option_t));
111+
(ip_address_option_type*)region_alloc(
112+
cfg_parser->opt->region, sizeof(ip_address_option_type));
113113
cfg_parser->current_ip_address_option =
114114
cfg_parser->current_ip_address_option->next;
115115
cfg_parser->current_ip_address_option->next=0;
116116
} else {
117117
cfg_parser->current_ip_address_option =
118-
(ip_address_option_t*)region_alloc(
119-
cfg_parser->opt->region, sizeof(ip_address_option_t));
118+
(ip_address_option_type*)region_alloc(
119+
cfg_parser->opt->region, sizeof(ip_address_option_type));
120120
cfg_parser->current_ip_address_option->next=0;
121121
cfg_parser->opt->ip_addresses = cfg_parser->current_ip_address_option;
122122
}
@@ -528,8 +528,8 @@ rc_control_port: VAR_CONTROL_PORT STRING
528528
;
529529
rc_control_interface: VAR_CONTROL_INTERFACE STRING
530530
{
531-
ip_address_option_t* o = (ip_address_option_t*)region_alloc(
532-
cfg_parser->opt->region, sizeof(ip_address_option_t));
531+
ip_address_option_type* o = (ip_address_option_type*)region_alloc(
532+
cfg_parser->opt->region, sizeof(ip_address_option_type));
533533
OUTYY(("P(control_interface:%s)\n", $2));
534534
o->next = cfg_parser->opt->control_interface;
535535
cfg_parser->opt->control_interface = o;
@@ -706,7 +706,7 @@ zone_zonestats: VAR_ZONESTATS STRING
706706
;
707707
zone_allow_notify: VAR_ALLOW_NOTIFY STRING STRING
708708
{
709-
acl_options_t* acl = parse_acl_info(cfg_parser->opt->region, $2, $3);
709+
acl_options_type* acl = parse_acl_info(cfg_parser->opt->region, $2, $3);
710710
OUTYY(("P(allow_notify:%s %s)\n", $2, $3));
711711
if(cfg_parser->current_allow_notify)
712712
cfg_parser->current_allow_notify->next = acl;
@@ -729,7 +729,7 @@ zone_size_limit_xfr: VAR_SIZE_LIMIT_XFR STRING
729729
;
730730
zone_request_xfr_data: STRING STRING
731731
{
732-
acl_options_t* acl = parse_acl_info(cfg_parser->opt->region, $1, $2);
732+
acl_options_type* acl = parse_acl_info(cfg_parser->opt->region, $1, $2);
733733
OUTYY(("P(request_xfr:%s %s)\n", $1, $2));
734734
if(acl->blocked) c_error("blocked address used for request-xfr");
735735
if(acl->rangetype!=acl_range_single) c_error("address range used for request-xfr");
@@ -741,7 +741,7 @@ zone_request_xfr_data: STRING STRING
741741
}
742742
| VAR_AXFR STRING STRING
743743
{
744-
acl_options_t* acl = parse_acl_info(cfg_parser->opt->region, $2, $3);
744+
acl_options_type* acl = parse_acl_info(cfg_parser->opt->region, $2, $3);
745745
acl->use_axfr_only = 1;
746746
OUTYY(("P(request_xfr:%s %s)\n", $2, $3));
747747
if(acl->blocked) c_error("blocked address used for request-xfr");
@@ -754,7 +754,7 @@ zone_request_xfr_data: STRING STRING
754754
}
755755
| VAR_UDP STRING STRING
756756
{
757-
acl_options_t* acl = parse_acl_info(cfg_parser->opt->region, $2, $3);
757+
acl_options_type* acl = parse_acl_info(cfg_parser->opt->region, $2, $3);
758758
acl->allow_udp = 1;
759759
OUTYY(("P(request_xfr:%s %s)\n", $2, $3));
760760
if(acl->blocked) c_error("blocked address used for request-xfr");
@@ -768,7 +768,7 @@ zone_request_xfr_data: STRING STRING
768768
;
769769
zone_notify: VAR_NOTIFY STRING STRING
770770
{
771-
acl_options_t* acl = parse_acl_info(cfg_parser->opt->region, $2, $3);
771+
acl_options_type* acl = parse_acl_info(cfg_parser->opt->region, $2, $3);
772772
OUTYY(("P(notify:%s %s)\n", $2, $3));
773773
if(acl->blocked) c_error("blocked address used for notify");
774774
if(acl->rangetype!=acl_range_single) c_error("address range used for notify");
@@ -792,7 +792,7 @@ zone_notify_retry: VAR_NOTIFY_RETRY STRING
792792
;
793793
zone_provide_xfr: VAR_PROVIDE_XFR STRING STRING
794794
{
795-
acl_options_t* acl = parse_acl_info(cfg_parser->opt->region, $2, $3);
795+
acl_options_type* acl = parse_acl_info(cfg_parser->opt->region, $2, $3);
796796
OUTYY(("P(provide_xfr:%s %s)\n", $2, $3));
797797
if(cfg_parser->current_provide_xfr)
798798
cfg_parser->current_provide_xfr->next = acl;
@@ -803,7 +803,7 @@ zone_provide_xfr: VAR_PROVIDE_XFR STRING STRING
803803
;
804804
zone_outgoing_interface: VAR_OUTGOING_INTERFACE STRING
805805
{
806-
acl_options_t* acl = parse_acl_info(cfg_parser->opt->region, $2, "NOKEY");
806+
acl_options_type* acl = parse_acl_info(cfg_parser->opt->region, $2, "NOKEY");
807807
OUTYY(("P(outgoing_interface:%s)\n", $2));
808808
if(acl->rangetype!=acl_range_single) c_error("address range used for outgoing interface");
809809
if(cfg_parser->current_outgoing_interface)

dbaccess.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ read_zone_data(udb_base* udb, namedb_type* db, region_type* dname_region,
247247
/** create a zone */
248248
zone_type*
249249
namedb_zone_create(namedb_type* db, const dname_type* dname,
250-
zone_options_t* zo)
250+
struct zone_options* zo)
251251
{
252252
zone_type* zone = (zone_type *) region_alloc(db->region,
253253
sizeof(zone_type));
@@ -321,12 +321,12 @@ namedb_zone_delete(namedb_type* db, zone_type* zone)
321321
#ifdef HAVE_MMAP
322322
/** read a zone */
323323
static void
324-
read_zone(udb_base* udb, namedb_type* db, nsd_options_t* opt,
324+
read_zone(udb_base* udb, namedb_type* db, struct nsd_options* opt,
325325
region_type* dname_region, udb_ptr* z)
326326
{
327327
/* construct dname */
328328
const dname_type* dname = dname_make(dname_region, ZONE(z)->name, 0);
329-
zone_options_t* zo = dname?zone_options_find(opt, dname):NULL;
329+
struct zone_options* zo = dname?zone_options_find(opt, dname):NULL;
330330
zone_type* zone;
331331
if(!dname) return;
332332
if(!zo) {
@@ -353,7 +353,7 @@ read_zone(udb_base* udb, namedb_type* db, nsd_options_t* opt,
353353
#ifdef HAVE_MMAP
354354
/** read zones from nsd.db */
355355
static void
356-
read_zones(udb_base* udb, namedb_type* db, nsd_options_t* opt,
356+
read_zones(udb_base* udb, namedb_type* db, struct nsd_options* opt,
357357
region_type* dname_region)
358358
{
359359
udb_ptr ztree, n, z;
@@ -378,7 +378,7 @@ read_zones(udb_base* udb, namedb_type* db, nsd_options_t* opt,
378378
/** try to read the udb file or fail */
379379
static int
380380
try_read_udb(namedb_type* db, int fd, const char* filename,
381-
nsd_options_t* opt)
381+
struct nsd_options* opt)
382382
{
383383
/*
384384
* Temporary region used while loading domain names from the
@@ -414,7 +414,7 @@ try_read_udb(namedb_type* db, int fd, const char* filename,
414414
#endif /* HAVE_MMAP */
415415

416416
struct namedb *
417-
namedb_open (const char* filename, nsd_options_t* opt)
417+
namedb_open (const char* filename, struct nsd_options* opt)
418418
{
419419
namedb_type* db;
420420

@@ -653,7 +653,7 @@ namedb_read_zonefile(struct nsd* nsd, struct zone* zone, udb_base* taskudb,
653653
}
654654

655655
void namedb_check_zonefile(struct nsd* nsd, udb_base* taskudb,
656-
udb_ptr* last_task, zone_options_t* zopt)
656+
udb_ptr* last_task, struct zone_options* zopt)
657657
{
658658
zone_type* zone;
659659
const dname_type* dname = (const dname_type*)zopt->node.key;
@@ -665,12 +665,12 @@ void namedb_check_zonefile(struct nsd* nsd, udb_base* taskudb,
665665
namedb_read_zonefile(nsd, zone, taskudb, last_task);
666666
}
667667

668-
void namedb_check_zonefiles(struct nsd* nsd, nsd_options_t* opt,
668+
void namedb_check_zonefiles(struct nsd* nsd, struct nsd_options* opt,
669669
udb_base* taskudb, udb_ptr* last_task)
670670
{
671-
zone_options_t* zo;
671+
struct zone_options* zo;
672672
/* check all zones in opt, create if not exist in main db */
673-
RBTREE_FOR(zo, zone_options_t*, opt->zone_options) {
673+
RBTREE_FOR(zo, struct zone_options*, opt->zone_options) {
674674
namedb_check_zonefile(nsd, taskudb, last_task, zo);
675675
if(nsd->signal_hint_shutdown) break;
676676
}

dbcreate.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ create_path_components(const char* path, int* notexist)
326326
}
327327

328328
void
329-
namedb_write_zonefile(struct nsd* nsd, zone_options_t* zopt)
329+
namedb_write_zonefile(struct nsd* nsd, struct zone_options* zopt)
330330
{
331331
const char* zfile;
332332
int notexist = 0;
@@ -412,10 +412,10 @@ namedb_write_zonefile(struct nsd* nsd, zone_options_t* zopt)
412412
}
413413

414414
void
415-
namedb_write_zonefiles(struct nsd* nsd, nsd_options_t* options)
415+
namedb_write_zonefiles(struct nsd* nsd, struct nsd_options* options)
416416
{
417-
zone_options_t* zo;
418-
RBTREE_FOR(zo, zone_options_t*, options->zone_options) {
417+
struct zone_options* zo;
418+
RBTREE_FOR(zo, struct zone_options*, options->zone_options) {
419419
namedb_write_zonefile(nsd, zo);
420420
}
421421
}

difffile.c

+14-13
Original file line numberDiff line numberDiff line change
@@ -858,10 +858,10 @@ add_RR(namedb_type* db, const dname_type* dname,
858858

859859
static zone_type*
860860
find_or_create_zone(namedb_type* db, const dname_type* zone_name,
861-
nsd_options_t* opt, const char* zstr, const char* patname)
861+
struct nsd_options* opt, const char* zstr, const char* patname)
862862
{
863863
zone_type* zone;
864-
zone_options_t* zopt;
864+
struct zone_options* zopt;
865865
zone = namedb_find_zone(db, zone_name);
866866
if(zone) {
867867
return zone;
@@ -958,7 +958,7 @@ delete_zone_rrs(namedb_type* db, zone_type* zone)
958958
/* return value 0: syntaxerror,badIXFR, 1:OK, 2:done_and_skip_it */
959959
static int
960960
apply_ixfr(namedb_type* db, FILE *in, const char* zone, uint32_t serialno,
961-
nsd_options_t* opt, uint32_t seq_nr, uint32_t seq_total,
961+
struct nsd_options* opt, uint32_t seq_nr, uint32_t seq_total,
962962
int* is_axfr, int* delete_mode, int* rr_count,
963963
udb_ptr* udbz, struct zone** zone_res, const char* patname, int* bytes,
964964
int* softfail)
@@ -1256,7 +1256,7 @@ check_for_bad_serial(namedb_type* db, const char* zone_str, uint32_t old_serial)
12561256

12571257
static int
12581258
apply_ixfr_for_zone(nsd_type* nsd, zone_type* zonedb, FILE* in,
1259-
nsd_options_t* opt, udb_base* taskudb, udb_ptr* last_task,
1259+
struct nsd_options* opt, udb_base* taskudb, udb_ptr* last_task,
12601260
uint32_t xfrfilenr)
12611261
{
12621262
char zone_buf[3072];
@@ -1617,7 +1617,7 @@ void* task_new_stat_info(udb_base* udb, udb_ptr* last, struct nsdst* stat,
16171617
udb_ptr e;
16181618
DEBUG(DEBUG_IPC,1, (LOG_INFO, "add task stat_info"));
16191619
if(!task_create_new_elem(udb, last, &e, sizeof(struct task_list_d)+
1620-
sizeof(*stat) + sizeof(stc_t)*child_count, NULL)) {
1620+
sizeof(*stat) + sizeof(stc_type)*child_count, NULL)) {
16211621
log_msg(LOG_ERR, "tasklist: out of space, cannot add stati");
16221622
return NULL;
16231623
}
@@ -1665,7 +1665,7 @@ task_new_del_zone(udb_base* udb, udb_ptr* last, const dname_type* dname)
16651665
udb_ptr_unlink(&e, udb);
16661666
}
16671667

1668-
void task_new_add_key(udb_base* udb, udb_ptr* last, key_options_t* key)
1668+
void task_new_add_key(udb_base* udb, udb_ptr* last, struct key_options* key)
16691669
{
16701670
char* p;
16711671
udb_ptr e;
@@ -1703,7 +1703,8 @@ void task_new_del_key(udb_base* udb, udb_ptr* last, const char* name)
17031703
udb_ptr_unlink(&e, udb);
17041704
}
17051705

1706-
void task_new_add_pattern(udb_base* udb, udb_ptr* last, pattern_options_t* p)
1706+
void task_new_add_pattern(udb_base* udb, udb_ptr* last,
1707+
struct pattern_options* p)
17071708
{
17081709
region_type* temp;
17091710
buffer_type* buffer;
@@ -1743,7 +1744,7 @@ void task_new_del_pattern(udb_base* udb, udb_ptr* last, const char* name)
17431744
udb_ptr_unlink(&e, udb);
17441745
}
17451746

1746-
void task_new_opt_change(udb_base* udb, udb_ptr* last, nsd_options_t* opt)
1747+
void task_new_opt_change(udb_base* udb, udb_ptr* last, struct nsd_options* opt)
17471748
{
17481749
udb_ptr e;
17491750
DEBUG(DEBUG_IPC,1, (LOG_INFO, "add task opt_change"));
@@ -1837,7 +1838,7 @@ task_process_checkzones(struct nsd* nsd, udb_base* udb, udb_ptr* last_task,
18371838
/* on SIGHUP check if zone-text-files changed and if so,
18381839
* reread. When from xfrd-reload, no need to fstat the files */
18391840
if(task->yesno) {
1840-
zone_options_t* zo = zone_options_find(nsd->options,
1841+
struct zone_options* zo = zone_options_find(nsd->options,
18411842
task->zname);
18421843
if(zo)
18431844
namedb_check_zonefile(nsd, udb, last_task, zo);
@@ -1851,7 +1852,7 @@ static void
18511852
task_process_writezones(struct nsd* nsd, struct task_list_d* task)
18521853
{
18531854
if(task->yesno) {
1854-
zone_options_t* zo = zone_options_find(nsd->options,
1855+
struct zone_options* zo = zone_options_find(nsd->options,
18551856
task->zname);
18561857
if(zo)
18571858
namedb_write_zonefile(nsd, zo);
@@ -1893,7 +1894,7 @@ static void
18931894
task_process_del_zone(struct nsd* nsd, struct task_list_d* task)
18941895
{
18951896
zone_type* zone;
1896-
zone_options_t* zopt;
1897+
struct zone_options* zopt;
18971898
DEBUG(DEBUG_IPC,1, (LOG_INFO, "delzone task %s", dname_to_string(
18981899
task->zname, NULL)));
18991900
zone = namedb_find_zone(nsd->db, task->zname);
@@ -1927,7 +1928,7 @@ task_process_del_zone(struct nsd* nsd, struct task_list_d* task)
19271928
static void
19281929
task_process_add_key(struct nsd* nsd, struct task_list_d* task)
19291930
{
1930-
key_options_t key;
1931+
struct key_options key;
19311932
key.name = (char*)task->zname;
19321933
DEBUG(DEBUG_IPC,1, (LOG_INFO, "addkey task %s", key.name));
19331934
key.algorithm = key.name + strlen(key.name)+1;
@@ -1950,7 +1951,7 @@ task_process_add_pattern(struct nsd* nsd, struct task_list_d* task)
19501951
{
19511952
region_type* temp = region_create(xalloc, free);
19521953
buffer_type buffer;
1953-
pattern_options_t *pat;
1954+
struct pattern_options *pat;
19541955
buffer_create_from(&buffer, task->zname, task->yesno);
19551956
pat = pattern_options_unmarshal(temp, &buffer);
19561957
DEBUG(DEBUG_IPC,1, (LOG_INFO, "addpattern task %s", pat->pname));

difffile.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,12 @@ void task_new_set_verbosity(udb_base* udb, udb_ptr* last, int v);
119119
void task_new_add_zone(udb_base* udb, udb_ptr* last, const char* zone,
120120
const char* pattern, unsigned zonestatid);
121121
void task_new_del_zone(udb_base* udb, udb_ptr* last, const dname_type* dname);
122-
void task_new_add_key(udb_base* udb, udb_ptr* last, key_options_t* key);
122+
void task_new_add_key(udb_base* udb, udb_ptr* last, struct key_options* key);
123123
void task_new_del_key(udb_base* udb, udb_ptr* last, const char* name);
124-
void task_new_add_pattern(udb_base* udb, udb_ptr* last, pattern_options_t* p);
124+
void task_new_add_pattern(udb_base* udb, udb_ptr* last,
125+
struct pattern_options* p);
125126
void task_new_del_pattern(udb_base* udb, udb_ptr* last, const char* name);
126-
void task_new_opt_change(udb_base* udb, udb_ptr* last, nsd_options_t* opt);
127+
void task_new_opt_change(udb_base* udb, udb_ptr* last, struct nsd_options* opt);
127128
void task_new_zonestat_inc(udb_base* udb, udb_ptr* last, unsigned sz);
128129
int task_new_apply_xfr(udb_base* udb, udb_ptr* last, const dname_type* zone,
129130
uint32_t old_serial, uint32_t new_serial, uint64_t filenumber);

doc/ChangeLog

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
19 January 2016: Wouter
2+
- Fix to rename _t typedefs because POSIX reserves them.
3+
14
3 January 2016: Wouter
25
- Fix #1195: Fix so that NSD fails on non-compliant values for Serial.
36

doc/RELNOTES

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ BUG FIXES:
99
- Squelch zone transfer error address family not supported by protocol
1010
at low verbosity levels.
1111
- Fix #1195: Fix so that NSD fails on non-compliant values for Serial.
12+
- Fix to rename _t typedefs because POSIX reserves them.
1213

1314

1415
4.1.14

0 commit comments

Comments
 (0)